Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 3c3ef19

Browse files
axel3rdnpalm
andauthored
feat: Add option to disable SSL verification support for GitHub Enterprise Server (#1216)
* Disable SSL verification support for GitHub Enterprise Server * Terraform formatting Close #1207 Co-authored-by: Niek Palm <[email protected]> Co-authored-by: Niek Palm <[email protected]>
1 parent 150d227 commit 3c3ef19

File tree

7 files changed

+18
-1
lines changed

7 files changed

+18
-1
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ No requirements.
359359
| enable\_ssm\_on\_runners | Enable to allow access the runner instances for debugging purposes via SSM. Note that this adds additional permissions to the runner instances. | `bool` | `false` | no |
360360
| environment | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes |
361361
| ghes\_url | GitHub Enterprise Server URL. Example: https://github.internal.co - DO NOT SET IF USING PUBLIC GITHUB | `string` | `null` | no |
362+
| ghes\_ssl\_verify | GitHub Enterprise SSL verification. Set to `false` when custom certificate (chains) is used for GitHub Enterprise Server (insecure). | `bool` | `true` | no |
362363
| github\_app | GitHub app parameters, see your github app. Ensure the key is the base64-encoded `.pem` file (the output of `base64 app.private-key.pem`, not the content of `private-key.pem`). | <pre>object({<br> key_base64 = string<br> id = string<br> client_id = string<br> client_secret = string<br> webhook_secret = string<br> })</pre> | n/a | yes |
363364
| idle\_config | List of time period that can be defined as cron expression to keep a minimum amount of runners active instead of scaling down to 0. By defining this list you can ensure that in time periods that match the cron expression within 5 seconds a runner is kept idle. | <pre>list(object({<br> cron = string<br> timeZone = string<br> idleCount = number<br> }))</pre> | `[]` | no |
364365
| instance\_profile\_path | The path that will be added to the instance\_profile, if not set the environment name will be used. | `string` | `null` | no |

Diff for: main.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ module "runners" {
128128

129129
runner_iam_role_managed_policy_arns = var.runner_iam_role_managed_policy_arns
130130

131-
ghes_url = var.ghes_url
131+
ghes_url = var.ghes_url
132+
ghes_ssl_verify = var.ghes_ssl_verify
132133

133134
kms_key_arn = var.kms_key_arn
134135
}

Diff for: modules/runners/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ resource "aws_launch_template" "runner" {
108108
enable_cloudwatch_agent = var.enable_cloudwatch_agent
109109
ssm_key_cloudwatch_agent_config = var.enable_cloudwatch_agent ? aws_ssm_parameter.cloudwatch_agent_config_runner[0].name : ""
110110
ghes_url = var.ghes_url
111+
ghes_ssl_verify = var.ghes_ssl_verify
111112
install_config_runner = local.install_config_runner
112113
}))
113114

Diff for: modules/runners/scale-down.tf

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "aws_lambda_function" "scale_down" {
1818
RUNNER_BOOT_TIME_IN_MINUTES = var.runner_boot_time_in_minutes
1919
SCALE_DOWN_CONFIG = jsonencode(var.idle_config)
2020
GHES_URL = var.ghes_url
21+
NODE_TLS_REJECT_UNAUTHORIZED = var.ghes_url != null && ! var.ghes_ssl_verify ? 0 : 1
2122
PARAMETER_GITHUB_APP_CLIENT_ID_NAME = var.github_app_parameters.client_id.name
2223
PARAMETER_GITHUB_APP_CLIENT_SECRET_NAME = var.github_app_parameters.client_secret.name
2324
PARAMETER_GITHUB_APP_ID_NAME = var.github_app_parameters.id.name

Diff for: modules/runners/scale-up.tf

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ resource "aws_lambda_function" "scale_up" {
1717
ENABLE_ORGANIZATION_RUNNERS = var.enable_organization_runners
1818
ENVIRONMENT = var.environment
1919
GHES_URL = var.ghes_url
20+
NODE_TLS_REJECT_UNAUTHORIZED = var.ghes_url != null && ! var.ghes_ssl_verify ? 0 : 1
2021
RUNNER_EXTRA_LABELS = var.runner_extra_labels
2122
RUNNER_GROUP_NAME = var.runner_group_name
2223
RUNNERS_MAXIMUM_COUNT = var.runners_maximum_count

Diff for: modules/runners/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@ variable "ghes_url" {
303303
default = null
304304
}
305305

306+
variable "ghes_ssl_verify" {
307+
description = "GitHub Enterprise SSL verification. Set to 'false' when custom certificate (chains) is used for GitHub Enterprise Server (insecure)."
308+
type = bool
309+
default = true
310+
}
311+
306312
variable "lambda_subnet_ids" {
307313
description = "List of subnets in which the lambda will be launched, the subnets needs to be subnets in the `vpc_id`."
308314
type = list(string)

Diff for: variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,12 @@ variable "ghes_url" {
313313
default = null
314314
}
315315

316+
variable "ghes_ssl_verify" {
317+
description = "GitHub Enterprise SSL verification. Set to 'false' when custom certificate (chains) is used for GitHub Enterprise Server (insecure)."
318+
type = bool
319+
default = true
320+
}
321+
316322
variable "lambda_subnet_ids" {
317323
description = "List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`."
318324
type = list(string)

0 commit comments

Comments
 (0)