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

Commit 9a9e2ee

Browse files
npalmsemantic-release-botDerekCrosson
committed
feat: Security improvements, add option to disable userdata logging
* chore(release): 0.17.0 [skip ci] * Adding support for new workflow_job event. ([#1019](https://github.com/philips-labs/terraform-aws-github-runner/issues/1019)) ([a74e10b](a74e10b)) * chore(release): 0.18.0 [skip ci] * add format checking for lambdas in CI ([#899](https://github.com/philips-labs/terraform-aws-github-runner/issues/899)) ([#1080](https://github.com/philips-labs/terraform-aws-github-runner/issues/1080)) ([ae9c277](ae9c277)) * add option to overwrite / disable egress [#748](https://github.com/philips-labs/terraform-aws-github-runner/issues/748) ([#1112](https://github.com/philips-labs/terraform-aws-github-runner/issues/1112)) ([9c2548d](9c2548d)) * replace depcrated 'request' dependency by 'node-fetch' ([#903](https://github.com/philips-labs/terraform-aws-github-runner/issues/903)) ([#1082](https://github.com/philips-labs/terraform-aws-github-runner/issues/1082)) ([fb51756](fb51756)) * chore(release): 0.18.1 [skip ci] * webhook labels for `workflow_job` ([#1133](https://github.com/philips-labs/terraform-aws-github-runner/issues/1133)) ([4b39fb9](4b39fb9)) * chore(release): 0.19.0 [skip ci] * **scale-down:** Update Owner Logic ([#1065](https://github.com/philips-labs/terraform-aws-github-runner/issues/1065)) ([ba2536b](ba2536b)), closes [#2](#2) * explicit set region for downloading runner distribution from S3 ([#1204](https://github.com/philips-labs/terraform-aws-github-runner/issues/1204)) ([439fb1b](439fb1b)) * upgrade jest ([#1219](https://github.com/philips-labs/terraform-aws-github-runner/issues/1219)) ([c8b8139](c8b8139)) * use dynamic block to ignore null market opts ([#1202](https://github.com/philips-labs/terraform-aws-github-runner/issues/1202)) ([df9bd78](df9bd78)) * use dynamic block to ignore null market opts ([#1202](https://github.com/philips-labs/terraform-aws-github-runner/issues/1202)) ([06a5598](06a5598)) * **logging:** Additional Logging ([#1135](https://github.com/philips-labs/terraform-aws-github-runner/issues/1135)) ([f7f194d](f7f194d)) * **scale-down:** Clearing cache between runs ([#1164](https://github.com/philips-labs/terraform-aws-github-runner/issues/1164)) ([e72227b](e72227b)) * chore(release): 0.19.1 [skip ci] * `instance_types` from a Set to a List, so instance order preference is preserved ([#1154](https://github.com/philips-labs/terraform-aws-github-runner/issues/1154)) ([150d227](150d227)) * chore(release): 0.20.0 [skip ci] * Add option to disable SSL verification support for GitHub Enterprise Server ([#1216](https://github.com/philips-labs/terraform-aws-github-runner/issues/1216)) ([3c3ef19](3c3ef19)), closes [#1207](https://github.com/philips-labs/terraform-aws-github-runner/issues/1207) * chore(release): 0.20.1 [skip ci] * Upgrade lambda runtime to node 14.x ([#1203](https://github.com/philips-labs/terraform-aws-github-runner/issues/1203)) ([570949a](570949a)) * **webhook:** remove node fetch ([ca14ac5](ca14ac5)) * **webhook:** replace node-fetch by axios [#1247](https://github.com/philips-labs/terraform-aws-github-runner/issues/1247) ([80fff4b](80fff4b)) * added more detailed logging for scaling up and down ([#1222](https://github.com/philips-labs/terraform-aws-github-runner/issues/1222)) ([9aa7456](9aa7456)) * chore(release): 0.21.0 [skip ci] * Ignore github managed labels and add check disable option ([#1244](https://github.com/philips-labs/terraform-aws-github-runner/issues/1244)) ([859fa38](859fa38)) * remove unused app client since SSH key is used to secure app authorization ([#1223](https://github.com/philips-labs/terraform-aws-github-runner/issues/1223)) ([4cb5cf1](4cb5cf1)) * upgrade Terraform version of module 1.0.x ([#1254](https://github.com/philips-labs/terraform-aws-github-runner/issues/1254)) ([2a817dc](2a817dc)) * chore(release): 0.21.1 [skip ci] * **logging:** Adjusting scale logging messages and levels ([#1286](https://github.com/philips-labs/terraform-aws-github-runner/issues/1286)) ([665e1a6](665e1a6)) * **logging:** Adjusting webhook logs and levels ([#1287](https://github.com/philips-labs/terraform-aws-github-runner/issues/1287)) ([9df5fb8](9df5fb8)) * Update launch template to use metadata service v2 ([#1278](https://github.com/philips-labs/terraform-aws-github-runner/issues/1278)) ([ef16287](ef16287)) * chore(release): 0.22.0 [skip ci] * adding message retention seconds ([#1354](https://github.com/philips-labs/terraform-aws-github-runner/issues/1354)) ([a19929f](a19929f)) * adding var for tags for ec2s ([#1357](https://github.com/philips-labs/terraform-aws-github-runner/issues/1357)) ([31cf02d](31cf02d)) * add validation to distribution_bucket_name variable ([#1356](https://github.com/philips-labs/terraform-aws-github-runner/issues/1356)) ([6522317](6522317)) * chore(release): 0.23.0 [skip ci] * add option to format logging in JSON for lambdas ([#1228](https://github.com/philips-labs/terraform-aws-github-runner/issues/1228)) ([a250b96](a250b96)) * add option to specify SSE config for dist bucket ([#1324](https://github.com/philips-labs/terraform-aws-github-runner/issues/1324)) ([ae84302](ae84302)) * reducing verbosity of role and profile ([#1358](https://github.com/philips-labs/terraform-aws-github-runner/issues/1358)) ([922ef99](922ef99)) * chore(release): 0.23.1 [skip ci] * configurable metadata options for runners ([#1377](https://github.com/philips-labs/terraform-aws-github-runner/issues/1377)) ([f37df23](f37df23)) * chore(release): 0.24.0 [skip ci] * support single line for app private key ([#1368](https://github.com/philips-labs/terraform-aws-github-runner/issues/1368)) ([14183ac](14183ac)) * update return codes, no error code for job that are ignored ([#1381](https://github.com/philips-labs/terraform-aws-github-runner/issues/1381)) ([f9f705f](f9f705f)) * chore(release): 0.25.0 [skip ci] * Add option to configure concurrent running scale up lambda ([#1415](https://github.com/philips-labs/terraform-aws-github-runner/issues/1415)) ([23ee630](23ee630)) * clean up non used variables in examples ([#1416](https://github.com/philips-labs/terraform-aws-github-runner/issues/1416)) ([fe65a5f](fe65a5f)) * chore(release): 0.25.1 [skip ci] * Add required providers to module ssm ([#1423](https://github.com/philips-labs/terraform-aws-github-runner/issues/1423)) ([5b68b7b](5b68b7b)) * chore(release): 0.25.2 [skip ci] * add logging context to runner lambda ([#1399](https://github.com/philips-labs/terraform-aws-github-runner/issues/1399)) ([0ba0930](0ba0930)) * **logging:** Add context to webhook logs ([#1401](https://github.com/philips-labs/terraform-aws-github-runner/issues/1401)) ([8094576](8094576)) * chore(release): 0.26.0 [skip ci] * Add hooks for prebuilt images (AMI), including amazon linux packer example ([#1444](https://github.com/philips-labs/terraform-aws-github-runner/issues/1444)) ([060daac](060daac)) * add runners binaries bucket as terraform output ([5809fee](5809fee)) * chore(release): 0.26.1 [skip ci] * Download lambda ([#1480](https://github.com/philips-labs/terraform-aws-github-runner/issues/1480)) ([f1b99d9](f1b99d9)) * **syncer:** Add tests, coverage report, and refactor lambda / naming ([#1478](https://github.com/philips-labs/terraform-aws-github-runner/issues/1478)) ([8266442](8266442)) * install_config_runner -> install_runner ([#1479](https://github.com/philips-labs/terraform-aws-github-runner/issues/1479)) ([de5b93f](de5b93f)) * chore(release): 0.27.0 [skip ci] * add windows support ([#1476](https://github.com/philips-labs/terraform-aws-github-runner/issues/1476)) ([dbba705](dbba705)) * chore(release): 0.27.1 [skip ci] * add --preserve-env to start-runner.sh to enable RUNNER_ALLOW_RUNASROOT ([#1537](https://github.com/philips-labs/terraform-aws-github-runner/issues/1537)) ([1cd9cd3](1cd9cd3)) * remove export from install script. ([#1538](https://github.com/philips-labs/terraform-aws-github-runner/issues/1538)) ([d32ca1b](d32ca1b)) * chore(release): 0.27.2 [skip ci] * Dowload lambda see [#1541](https://github.com/philips-labs/terraform-aws-github-runner/issues/1541) for details. ([#1542](https://github.com/philips-labs/terraform-aws-github-runner/issues/1542)) ([7cb73c8](7cb73c8)) * chore(release): 0.28.0 [skip ci] * add option ephemeral runners ([#1374](https://github.com/philips-labs/terraform-aws-github-runner/issues/1374)) ([2f323d6](2f323d6)), closes [#1399](https://github.com/philips-labs/terraform-aws-github-runner/issues/1399) [#1444](https://github.com/philips-labs/terraform-aws-github-runner/issues/1444) * Change default location of runner to `/opt` and fix Ubuntu example ([#1572](https://github.com/philips-labs/terraform-aws-github-runner/issues/1572)) ([77f350b](77f350b)) * Replace run instance API by create fleet API ([#1556](https://github.com/philips-labs/terraform-aws-github-runner/issues/1556)) ([27e974d](27e974d)) * Support t4g Graviton instance type ([#1561](https://github.com/philips-labs/terraform-aws-github-runner/issues/1561)) ([3fa5896](3fa5896)) * Add config for windows ami ([#1525](https://github.com/philips-labs/terraform-aws-github-runner/issues/1525)) ([7907984](7907984)) * chore(release): 0.29.0 [skip ci] * Strict label check and replace disable_check_wokflow_job_labels by opt in enable_workflow_job_labels_check ([#1591](https://github.com/philips-labs/terraform-aws-github-runner/issues/1591)) ([405b11d](405b11d)) * chore(release): 0.30.0 [skip ci] * Add scheduled / pull based scaling for org level runners ([#1577](https://github.com/philips-labs/terraform-aws-github-runner/issues/1577)) ([8197432](8197432)) * chore(release): 0.30.1 [skip ci] * **runnrs:** Pool runners to allow multiple pool_config objects ([#1621](https://github.com/philips-labs/terraform-aws-github-runner/issues/1621)) ([c9c7c69](c9c7c69)) * chore(release): 0.31.0 [skip ci] * **packer:** add vars and minor clean up ([#1611](https://github.com/philips-labs/terraform-aws-github-runner/issues/1611)) ([1c897a4](1c897a4)) * **webhook:** depcrated warning on ts-jest mocked ([#1615](https://github.com/philips-labs/terraform-aws-github-runner/issues/1615)) ([56c1ece](56c1ece)) * chore(release): 0.32.0 [skip ci] * **runner:** Replace patch by install ICU package for ARM runners ([#1624](https://github.com/philips-labs/terraform-aws-github-runner/issues/1624)) ([74cfa51](74cfa51)) * **images:** use new runner install location ([#1628](https://github.com/philips-labs/terraform-aws-github-runner/issues/1628)) ([36c1bf5](36c1bf5)) * **packer:** Add missing RUNNER_ARCHITECTURE for amazn-linux2 ([#1647](https://github.com/philips-labs/terraform-aws-github-runner/issues/1647)) ([ec497a2](ec497a2)) * chore(release): 0.33.0 [skip ci] * **images:** Added ubuntu-focual example packer configuration ([#1644](https://github.com/philips-labs/terraform-aws-github-runner/issues/1644)) ([997b171](997b171)) * **examples:** Update AMI filter ([#1673](https://github.com/philips-labs/terraform-aws-github-runner/issues/1673)) ([39c019c](39c019c)) * chore(release): 0.34.0 [skip ci] * Add output image id used in launch template ([#1676](https://github.com/philips-labs/terraform-aws-github-runner/issues/1676)) ([a49fab4](a49fab4)) * chore(release): 0.34.1 [skip ci] * **syncer:** Fix for windows binaries in action runner syncer ([#1716](https://github.com/philips-labs/terraform-aws-github-runner/issues/1716)) ([63e0e27](63e0e27)) * chore(release): 0.34.2 [skip ci] * Limit AWS Terraform Provider to 3.* ([#1741](https://github.com/philips-labs/terraform-aws-github-runner/issues/1741)) ([0cf2b5d](0cf2b5d)) * **runner:** Cannot disable cloudwatch agent ([#1738](https://github.com/philips-labs/terraform-aws-github-runner/issues/1738)) ([0f798ca](0f798ca)) * chore(release): 0.35.0 [skip ci] * Parameterise delete_on_termination ([#1758](https://github.com/philips-labs/terraform-aws-github-runner/issues/1758)) ([6282351](6282351)), closes [#1745](https://github.com/philips-labs/terraform-aws-github-runner/issues/1745) * **runner:** Ability to disable default runner security group creation ([#1718](https://github.com/philips-labs/terraform-aws-github-runner/issues/1718)) ([94779f8](94779f8)) * chore(release): 0.36.0 [skip ci] * **runner:** Add option to disable auto update ([#1791](https://github.com/philips-labs/terraform-aws-github-runner/issues/1791)) ([c2a834f](c2a834f)) * chore(release): 0.37.0 [skip ci] * Add associate_public_ip_address variable to windows AMI too ([#1819](https://github.com/philips-labs/terraform-aws-github-runner/issues/1819)) ([0b8e1fc](0b8e1fc)), closes [/github.com/philips-labs/terraform-aws-github-runner/pull/1816#issuecomment-1060650668](https://github.com/philips-labs//github.com/philips-labs/terraform-aws-github-runner/pull/1816/issues/issuecomment-1060650668) * Add associate_public_ip_address variable ([#1816](https://github.com/philips-labs/terraform-aws-github-runner/issues/1816)) ([052e9f8](052e9f8)) * Add option for KMS encryption for cloudwatch log groups ([#1833](https://github.com/philips-labs/terraform-aws-github-runner/issues/1833)) ([3f1a67f](3f1a67f)) * Add SQS queue resource policy to improve security ([#1798](https://github.com/philips-labs/terraform-aws-github-runner/issues/1798)) ([96def9a](96def9a)) * Add Support for Alternative Partitions in ARNs (like govcloud) ([#1815](https://github.com/philips-labs/terraform-aws-github-runner/issues/1815)) ([0ba06c8](0ba06c8)) * Add variable to specify custom commands while building the AMI ([#1838](https://github.com/philips-labs/terraform-aws-github-runner/issues/1838)) ([8f9c342](8f9c342)) * Autoupdate should be disabled by default ([#1797](https://github.com/philips-labs/terraform-aws-github-runner/issues/1797)) ([828bed6](828bed6)) * Create SQS DLQ policy only if DLQ is created ([#1839](https://github.com/philips-labs/terraform-aws-github-runner/issues/1839)) ([c88a005](c88a005)) * Upgrade Amazon base AMI to Amazon Linux 2 kernel 5x ([#1812](https://github.com/philips-labs/terraform-aws-github-runner/issues/1812)) ([9aa5532](9aa5532)) * chore(release): 0.38.0 [skip ci] * Add option for ephemeral to check builds status before scaling ([#1854](https://github.com/philips-labs/terraform-aws-github-runner/issues/1854)) ([7eb0bda](7eb0bda)) * Retention days was used instead of kms key id for pool ([#1855](https://github.com/philips-labs/terraform-aws-github-runner/issues/1855)) ([aa29d93](aa29d93)) * chore(release): 0.39.0 [skip ci] * Add possibility to create multiple ebs ([#1845](https://github.com/philips-labs/terraform-aws-github-runner/issues/1845)) ([7a2ca0d](7a2ca0d)) * Don't delete busy runners ([#1832](https://github.com/philips-labs/terraform-aws-github-runner/issues/1832)) ([0e9b083](0e9b083)) * chore(release): 0.40.0 [skip ci] * Support multi runner process support for runner scale down. ([#1859](https://github.com/philips-labs/terraform-aws-github-runner/issues/1859)) ([3658d6a](3658d6a)) * Set the minimal AWS provider to 3.50 ([#1937](https://github.com/philips-labs/terraform-aws-github-runner/issues/1937)) ([16095d8](16095d8)) * chore(release): 0.40.1 [skip ci] * Avoid non semantic commontes can be merged. ([#1969](https://github.com/philips-labs/terraform-aws-github-runner/issues/1969)) ([ad1c872](ad1c872)) * chore(release): 0.40.2 [skip ci] * Outputs for pool need to account for complexity ([#1970](https://github.com/philips-labs/terraform-aws-github-runner/issues/1970)) ([2d92906](2d92906)) * chore(release): 0.40.3 [skip ci] * Volume size is ingored ([#2014](https://github.com/philips-labs/terraform-aws-github-runner/issues/2014)) ([b733248](b733248)), closes [#1954](https://github.com/philips-labs/terraform-aws-github-runner/issues/1954) * chore(release): 0.40.4 [skip ci] * Wrong block device mapping ([#2019](https://github.com/philips-labs/terraform-aws-github-runner/issues/2019)) ([c42a467](c42a467)) * chore(release): 1.0.0 [skip ci] * var.volume_size replaced by var.block_device_mappings * The module is upgraded to AWS Terraform provider 4.x * Improve syncer s3 kms encryption ([38ed5be](38ed5be)) * Remove var.volume_size in favour of var.block_device_mappings ([4e97048](4e97048)) * Support AWS 4.x Terraform provider ([#1739](https://github.com/philips-labs/terraform-aws-github-runner/issues/1739)) ([cfb6da2](cfb6da2)) * Wrong block device mapping ([#2019](https://github.com/philips-labs/terraform-aws-github-runner/issues/2019)) ([185ef20](185ef20)) * chore(release): 1.1.0 [skip ci] * Add option to enable detailed monitoring for runner launch template ([#2024](https://github.com/philips-labs/terraform-aws-github-runner/issues/2024)) ([e73a267](e73a267)) * chore(release): 1.1.1 [skip ci] * **runner:** Don't treat the string "false" as true. ([#2051](https://github.com/philips-labs/terraform-aws-github-runner/issues/2051)) ([b67c7dc](b67c7dc)) * chore(release): 1.2.0 [skip ci] * Replace environment variable by prefix ([#1858](https://github.com/philips-labs/terraform-aws-github-runner/issues/1858)) ([e2f9a27](e2f9a27)) * docs: fix hyperlinks in the Terraform Registry documentation (#2085) This makes the hyperlink correct in the Terraform Registry documentation * chore(release): 1.3.0 [skip ci] * Support arm64 lambda functions ([#2121](https://github.com/philips-labs/terraform-aws-github-runner/issues/2121)) ([9e2a7b6](9e2a7b6)) * Support Node16 for AWS Lambda ([#2073](https://github.com/philips-labs/terraform-aws-github-runner/issues/2073)) ([68a2014](68a2014)) * replaced old environment variable ([#2146](https://github.com/philips-labs/terraform-aws-github-runner/issues/2146)) ([f2072f7](f2072f7)) * set explicit permissions on s3 for syncer lambda ([#2145](https://github.com/philips-labs/terraform-aws-github-runner/issues/2145)) ([aa7edd1](aa7edd1)) * set kms key on aws_s3_object when encryption is enabled ([#2147](https://github.com/philips-labs/terraform-aws-github-runner/issues/2147)) ([b4dc706](b4dc706)) * chore(release): 1.4.0 [skip ci] * Add option to match some of the labes instead of all [#2122](https://github.com/philips-labs/terraform-aws-github-runner/issues/2122) ([#2123](https://github.com/philips-labs/terraform-aws-github-runner/issues/2123)) ([c5e3c21](c5e3c21)) * don't apply extra labels unless defined ([#2181](https://github.com/philips-labs/terraform-aws-github-runner/issues/2181)) ([c0b11bb](c0b11bb)) * Remove asterik in permission for runner lambda to describe instances ([9b9da03](9b9da03)) * chore(release): 1.4.1 [skip ci] * added server_side_encryption key to download trigger for distribution ([#2207](https://github.com/philips-labs/terraform-aws-github-runner/issues/2207)) ([404e3b6](404e3b6)) * chore(release): 1.5.0 [skip ci] * Add ubuntu-jammy example image based on existing ubuntu-focal ([#2102](https://github.com/philips-labs/terraform-aws-github-runner/issues/2102)) ([486ae91](486ae91)) * **images:** avoid wrong AMI could be selected for ubuntu focal ([#2214](https://github.com/philips-labs/terraform-aws-github-runner/issues/2214)) ([76be94b](76be94b)) * chore(release): 1.6.0 [skip ci] * Add options extra option to ebs block device mapping ([#2052](https://github.com/philips-labs/terraform-aws-github-runner/issues/2052)) ([7cd2524](7cd2524)) * Enable node16 default ([#2074](https://github.com/philips-labs/terraform-aws-github-runner/issues/2074)) ([58aa5ed](58aa5ed)) * Incorrect path of Runner logs ([#2233](https://github.com/philips-labs/terraform-aws-github-runner/issues/2233)) ([98eff98](98eff98)) * Preventing that lambda webhook fails when it tries to process an installation_repositories event ([#2288](https://github.com/philips-labs/terraform-aws-github-runner/issues/2288)) ([8656c83](8656c83)) * Update ubuntu example to fix /opt/hostedtoolcache ([#2302](https://github.com/philips-labs/terraform-aws-github-runner/issues/2302)) ([8eea748](8eea748)) * Webhook lambda misleading log ([#2291](https://github.com/philips-labs/terraform-aws-github-runner/issues/2291)) ([c6275f9](c6275f9)) * chore(release): 1.7.0 [skip ci] * Webhook accept jobs where not all labels are provided in job. ([#2209](https://github.com/philips-labs/terraform-aws-github-runner/issues/2209)) ([6d9116f](6d9116f)) * Ignore case for runner labels. ([#2315](https://github.com/philips-labs/terraform-aws-github-runner/issues/2315)) ([014985a](014985a)) * chore(release): 1.8.0 [skip ci] * Add option to disable lambda to sync runner binaries ([#2314](https://github.com/philips-labs/terraform-aws-github-runner/issues/2314)) ([9f7d32d](9f7d32d)) * **examples:** Upgrading ubuntu example to 22.04 ([#2250](https://github.com/philips-labs/terraform-aws-github-runner/issues/2250)) ([d4b7650](d4b7650)), closes [#2103](https://github.com/philips-labs/terraform-aws-github-runner/issues/2103) * chore(release): 1.8.1 [skip ci] * **runners:** Pass allocation strategy ([#2345](https://github.com/philips-labs/terraform-aws-github-runner/issues/2345)) ([68d3445](68d3445)) * chore(release): 1.9.0 [skip ci] * Add option to enable access log for API gateway ([#2387](https://github.com/philips-labs/terraform-aws-github-runner/issues/2387)) ([fcd9fba](fcd9fba)) * add s3_location_runner_distribution var as expandable for userdata ([#2371](https://github.com/philips-labs/terraform-aws-github-runner/issues/2371)) ([05fe737](05fe737)) * Encrypted data at REST on SQS by default ([#2431](https://github.com/philips-labs/terraform-aws-github-runner/issues/2431)) ([7f3f4bf](7f3f4bf)) * **images:** Allow passing instance type when building windows image ([#2369](https://github.com/philips-labs/terraform-aws-github-runner/issues/2369)) ([eca23bf](eca23bf)) * **runners:** Fetch instance environment tag though metadata ([#2346](https://github.com/philips-labs/terraform-aws-github-runner/issues/2346)) ([27db290](27db290)) * **runners:** Set the default Windows AMI to Server 2022 ([#2325](https://github.com/philips-labs/terraform-aws-github-runner/issues/2325)) ([78e99d1](78e99d1)) * chore(release): 1.9.1 [skip ci] * **webhook:** Use `x-hub-signature-256` header as default ([#2434](https://github.com/philips-labs/terraform-aws-github-runner/issues/2434)) ([9c3e495](9c3e495)) * chore(release): 1.10.0 [skip ci] * Download runner release via latest release API ([#2455](https://github.com/philips-labs/terraform-aws-github-runner/issues/2455)) ([e75e092](e75e092)) * fix: Execute runner in own process, mask token in logs * Add option to disable user_data logging * Enforcing debug is disabled, and introduce option to enable debug logging. * add section related to security considerations * add section related to security considerations Co-authored-by: semantic-release-bot <[email protected]> Co-authored-by: Derek Crosson <[email protected]>
1 parent e197cbd commit 9a9e2ee

File tree

12 files changed

+624
-10
lines changed

12 files changed

+624
-10
lines changed

CHANGELOG.md

+558
Large diffs are not rendered by default.

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This [Terraform](https://www.terraform.io/) module creates the required infrastr
2626
- [Sub modules](#sub-modules)
2727
- [ARM64 configuration for submodules](#arm64-configuration-for-submodules)
2828
- [Debugging](#debugging)
29+
- [Security Consideration](#security-consideration)
2930
- [Requirements](#requirements)
3031
- [Providers](#providers)
3132
- [Modules](#modules)
@@ -352,6 +353,14 @@ In case the setup does not work as intended follow the trace of events:
352353
- Once an EC2 instance is running, you can connect to it in the EC2 user interface using Session Manager (use `enable_ssm_on_runners = true`). Check the user data script using `cat /var/log/user-data.log`. By default several log files of the instances are streamed to AWS CloudWatch, look for a log group named `<environment>/runners`. In the log group you should see at least the log streams for the user data installation and runner agent.
353354
- Registered instances should show up in the Settings - Actions page of the repository or organization (depending on the installation mode).
354355

356+
## Security Consideration
357+
358+
This module creates resources in your AWS infrastructure, and EC2 instances for hosting the self-hosted runners on-demand. IAM permissions are set to a minimal level, and could be further limit by using permission boundaries. Instances permissions are limit to retrieve and delete the registration token, access the instance own tags, and terminate the instance itself.
359+
360+
The examples are using standard AMI's for different operation systems. Instances are not hardened, and sudo operation are not blocked. To provide an out of the box working expierence by default the module installs and configure the runner. However secrets are not hard coded, they finally end up in the memory of the instances. You can harden the instance by providing your own AMI and overwriting the cloud-init script.
361+
362+
We welcome any improvement to the standard module to make the default as secure as possible, in the end it remains your responsibility to keep your environment secure.
363+
355364
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
356365
## Requirements
357366

@@ -409,6 +418,7 @@ In case the setup does not work as intended follow the trace of events:
409418
| <a name="input_enable_runner_binaries_syncer"></a> [enable\_runner\_binaries\_syncer](#input\_enable\_runner\_binaries\_syncer) | Option to disable the lambda to sync GitHub runner distribution, useful when using a pre-build AMI. | `bool` | `true` | no |
410419
| <a name="input_enable_runner_detailed_monitoring"></a> [enable\_runner\_detailed\_monitoring](#input\_enable\_runner\_detailed\_monitoring) | Should detailed monitoring be enabled for the runner. Set this to true if you want to use detailed monitoring. See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch-new.html for details. | `bool` | `false` | no |
411420
| <a name="input_enable_ssm_on_runners"></a> [enable\_ssm\_on\_runners](#input\_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 |
421+
| <a name="input_enable_user_data_debug_logging_runner"></a> [enable\_user\_data\_debug\_logging\_runner](#input\_enable\_user\_data\_debug\_logging\_runner) | Option to enable debug logging for user-data, this logs all secrets as well. | `bool` | `false` | no |
412422
| <a name="input_enabled_userdata"></a> [enabled\_userdata](#input\_enabled\_userdata) | Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI. | `bool` | `true` | no |
413423
| <a name="input_environment"></a> [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | `null` | no |
414424
| <a name="input_fifo_build_queue"></a> [fifo\_build\_queue](#input\_fifo\_build\_queue) | Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners. | `bool` | `false` | no |

examples/arm64/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This module shows how to create GitHub action runners using AWS Graviton instanc
44

55
## Usages
66

7-
Steps for the full setup, such as creating a GitHub app can be found in the root module's [README](../../README.md). First download the Lambda releases from GitHub. Alternatively you can build the lambdas locally with Node or Docker, there is a simple build script in `<root>/.ci/build.sh`. In the `main.tf` you can simply remove the location of the lambda zip files, the default location will work in this case.
7+
Steps for the full setup, such as creating a GitHub app can be found in the root module's [README](https://github.com/philips-labs/terraform-aws-github-runner). First download the Lambda releases from GitHub. Alternatively you can build the lambdas locally with Node or Docker, there is a simple build script in `<root>/.ci/build.sh`. In the `main.tf` you can simply remove the location of the lambda zip files, the default location will work in this case.
88

99
> Ensure you have set the version in `lambdas-download/main.tf` for running the example. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases
1010
@@ -15,7 +15,7 @@ terraform apply
1515
cd ..
1616
```
1717

18-
Before running Terraform, ensure the GitHub app is configured. See the [configuration details](../../README.md#usages) for more details.
18+
Before running Terraform, ensure the GitHub app is configured. See the [configuration details](https://github.com/philips-labs/terraform-aws-github-runner#usages) for more details.
1919

2020
```bash
2121
terraform init

examples/ubuntu/main.tf

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module "runners" {
3232
# runners_lambda_zip = "lambdas-download/runners.zip"
3333

3434
enable_organization_runners = false
35-
runner_extra_labels = "ubuntu,example"
35+
runner_extra_labels = "default,example"
3636

3737
# enable access to the runners via SSM
3838
enable_ssm_on_runners = true
@@ -102,4 +102,6 @@ module "runners" {
102102
# idleCount = 1
103103
# }]
104104

105+
# Enable logging all commands of user_data, secrets will be logged!!!
106+
# enable_user_data_debug_logging_runner = true
105107
}

examples/ubuntu/templates/user-data.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
#!/bin/bash -x
1+
#!/bin/bash
22
exec > >(tee /var/log/user-data.log | logger -t user-data -s 2>/dev/console) 2>&1
33

4+
5+
# AWS suggest to create a log for debug purpose based on https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-log-user-data/
6+
# As side effect all command, set +x disable debugging explicitly.
7+
#
8+
# An alternative for masking tokens could be: exec > >(sed 's/--token\ [^ ]* /--token\ *** /g' > /var/log/user-data.log) 2>&1
9+
set +x
10+
11+
%{ if enable_debug_logging }
12+
set -x
13+
%{ endif }
14+
415
${pre_install}
516

617
# Install AWS CLI

main.tf

+7-6
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,13 @@ module "runners" {
203203
role_path = var.role_path
204204
role_permissions_boundary = var.role_permissions_boundary
205205

206-
enabled_userdata = var.enabled_userdata
207-
userdata_template = var.userdata_template
208-
userdata_pre_install = var.userdata_pre_install
209-
userdata_post_install = var.userdata_post_install
210-
key_name = var.key_name
211-
runner_ec2_tags = var.runner_ec2_tags
206+
enabled_userdata = var.enabled_userdata
207+
enable_user_data_debug_logging = var.enable_user_data_debug_logging_runner
208+
userdata_template = var.userdata_template
209+
userdata_pre_install = var.userdata_pre_install
210+
userdata_post_install = var.userdata_post_install
211+
key_name = var.key_name
212+
runner_ec2_tags = var.runner_ec2_tags
212213

213214
create_service_linked_role_spot = var.create_service_linked_role_spot
214215

modules/runners/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ yarn run dist
130130
| <a name="input_enable_runner_binaries_syncer"></a> [enable\_runner\_binaries\_syncer](#input\_enable\_runner\_binaries\_syncer) | Option to disable the lambda to sync GitHub runner distribution, useful when using a pre-build AMI. | `bool` | `true` | no |
131131
| <a name="input_enable_runner_detailed_monitoring"></a> [enable\_runner\_detailed\_monitoring](#input\_enable\_runner\_detailed\_monitoring) | Enable detailed monitoring for runners | `bool` | `false` | no |
132132
| <a name="input_enable_ssm_on_runners"></a> [enable\_ssm\_on\_runners](#input\_enable\_ssm\_on\_runners) | Enable to allow access to the runner instances for debugging purposes via SSM. Note that this adds additional permissions to the runner instances. | `bool` | n/a | yes |
133+
| <a name="input_enable_user_data_debug_logging"></a> [enable\_user\_data\_debug\_logging](#input\_enable\_user\_data\_debug\_logging) | Option to enable debug logging for user-data, this logs all secrets as well. | `bool` | `false` | no |
133134
| <a name="input_enabled_userdata"></a> [enabled\_userdata](#input\_enabled\_userdata) | Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI | `bool` | `true` | no |
134135
| <a name="input_environment"></a> [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | `null` | no |
135136
| <a name="input_ghes_ssl_verify"></a> [ghes\_ssl\_verify](#input\_ghes\_ssl\_verify) | GitHub Enterprise SSL verification. Set to 'false' when custom certificate (chains) is used for GitHub Enterprise Server (insecure). | `bool` | `true` | no |

modules/runners/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ resource "aws_launch_template" "runner" {
133133
}
134134

135135
user_data = var.enabled_userdata ? base64encode(templatefile(local.userdata_template, {
136+
enable_debug_logging = var.enable_user_data_debug_logging
136137
s3_location_runner_distribution = local.s3_location_runner_distribution
137138
pre_install = var.userdata_pre_install
138139
install_runner = templatefile(local.userdata_install_runner[var.runner_os], {

modules/runners/templates/start-runner.sh

+7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ echo "Starting runner after $(awk '{print int($1/3600)":"int(($1%3600)/60)":"int
8484
echo "Starting the runner as user $run_as"
8585
8686
if [[ $agent_mode = "ephemeral" ]]; then
87+
88+
cat >/opt/start-runner-service.sh <<-EOF
8789
echo "Starting the runner in ephemeral mode"
8890
sudo --preserve-env=RUNNER_ALLOW_RUNASROOT -u "$run_as" -- ./run.sh
8991
echo "Runner has finished"
@@ -92,6 +94,11 @@ if [[ $agent_mode = "ephemeral" ]]; then
9294
systemctl stop amazon-cloudwatch-agent.service
9395
echo "Terminating instance"
9496
aws ec2 terminate-instances --instance-ids "$instance_id" --region "$region"
97+
EOF
98+
chmod 755 /opt/start-runner-service.sh
99+
# Starting the runner via a own process to ensure this process terminates
100+
nohup /opt/start-runner-service.sh &
101+
95102
else
96103
echo "Installing the runner as a service"
97104
./svc.sh install "$run_as"

modules/runners/templates/user-data.sh

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
#!/bin/bash -e
2+
23
exec > >(tee /var/log/user-data.log | logger -t user-data -s 2>/dev/console) 2>&1
34

5+
# AWS suggest to create a log for debug purpose based on https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-log-user-data/
6+
# As side effect all command, set +x disable debugging explicitly.
7+
#
8+
# An alternative for masking tokens could be: exec > >(sed 's/--token\ [^ ]* /--token\ *** /g' > /var/log/user-data.log) 2>&1
9+
10+
set +x
11+
12+
%{ if enable_debug_logging }
13+
set -x
14+
%{ endif }
15+
416
${pre_install}
517

618
yum update -y

modules/runners/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -571,3 +571,9 @@ variable "enable_runner_binaries_syncer" {
571571
type = bool
572572
default = true
573573
}
574+
575+
variable "enable_user_data_debug_logging" {
576+
description = "Option to enable debug logging for user-data, this logs all secrets as well."
577+
type = bool
578+
default = false
579+
}

variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -726,3 +726,8 @@ variable "queue_encryption" {
726726
}
727727
}
728728

729+
variable "enable_user_data_debug_logging_runner" {
730+
description = "Option to enable debug logging for user-data, this logs all secrets as well."
731+
type = bool
732+
default = false
733+
}

0 commit comments

Comments
 (0)