Skip to content

Commit d3de471

Browse files
committed
fix(ci): at attestation for release artifacts
1 parent 2ddd9a5 commit d3de471

File tree

3 files changed

+45
-17
lines changed

3 files changed

+45
-17
lines changed

.github/workflows/release.yml

+20-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ on:
66
- v1
77
workflow_dispatch:
88

9-
109
jobs:
1110
release:
1211
name: Release
1312
runs-on: ubuntu-latest
1413
permissions:
1514
contents: write
1615
actions: write
16+
id-token: write
17+
attestations: write
1718
steps:
1819
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
1920
with:
@@ -34,12 +35,28 @@ jobs:
3435
run: echo "name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
3536
- name: Release
3637
id: release
37-
uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4.1.1
38+
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
3839
with:
3940
target-branch: ${{ steps.branch.outputs.name }}
4041
release-type: terraform-module
4142
token: ${{ steps.token.outputs.token }}
42-
- name: Upload Release Asset
43+
- name: Attest
44+
if: ${{ steps.release.outputs.releases_created == 'true' }}
45+
id: attest
46+
uses: actions/attest-build-provenance@7668571508540a607bdfd90a87a560489fe372eb # v2.1.0
47+
with:
48+
subject-path: '${{ github.workspace }}/lambdas/functions/**/*.zip'
49+
- name: Update release notes with attestation
50+
if: ${{ steps.release.outputs.releases_created == 'true' }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
run: |
54+
gh release view ${{ github.event.inputs.version }} --json body -q '.body' > new-release-notes.md
55+
echo "## Attestation" >> new-release-notes.md
56+
echo "Attestation url: ${{ steps.attest.outputs.attestation-url }}" >> new-release-notes.md
57+
echo "Verify the artifacts by running \`gh attest verify <name_of_artifact> --repo ${{ github.repository }}\`" >> new-release-notes.md
58+
gh release edit ${{ steps.release.outputs.tag_name }} -F new-release-notes.md -t ${{ steps.release.outputs.tag_name }}
59+
- name: Upload release assets
4360
if: ${{ steps.release.outputs.releases_created == 'true' }}
4461
env:
4562
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

SECURITY.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Security Policy
2-
3-
## Reporting a Vulnerability
4-
5-
If you find a vulnerability, or evidence of one, please report it privately.
6-
7-
Vulnerabilities should be reported using [GitHub's mechanism for privately reporting a vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). Under the
8-
[main repository's security tab](https://github.com/github-aws-runners/terraform-aws-github-runner/security), click "Report a vulnerability" to open the advisory form.
9-
10-
A member of the terraform-aws-github-runner team will triage the reported vulnerability and if the vulnerability is accepted a security advisory will be published and all further communication will be done via that security advisory.
1+
# Security Policy
2+
3+
<!-- --8<-- [start:mkdocsrunners] -->
4+
## Reporting a Vulnerability
5+
6+
If you find a vulnerability, or evidence of one, please report it privately.
7+
8+
Vulnerabilities should be reported using [GitHub's mechanism for privately reporting a vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). Under the
9+
[main repository's security tab](https://github.com/github-aws-runners/terraform-aws-github-runner/security), click "Report a vulnerability" to open the advisory form.
10+
11+
A member of the terraform-aws-github-runner team will triage the reported vulnerability and if the vulnerability is accepted a security advisory will be published and all further communication will be done via that security advisory.
12+
<!-- --8<-- [end:mkdocsrunners] -->

docs/security.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11

22
# Security
33

4-
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 limited by using permission boundaries. Instances permissions are limited to retrieve and delete the registration token, access the instance's own tags, and terminate the instance itself. By nature instances are short-lived, we strongly suggest to use ephemeral runners to ensure a safe build environment for each workflow job execution.
4+
This module is not certified by any security organization. The module is build with the best practices in mind, but it is your responsibility to ensure the security of your environment. We welcome any feedback to improve the security of the module.
55

6-
Ephemeral runners are using the JIT configuration, confguration that only can be used once to activate a runner. For non-ephemeral runners this option is not provided by GitHub. For non-ephemeeral runners a registration token is passed via SSM. After using the token, the token is deleted. But the token remains valid and is potential available in memory on the runner. For ephemeral runners this problem is avoid by using just in time tokens.
6+
## Guidelines and directions
77

8-
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 experience by default the module installs and configures 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.
8+
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 limited by using permission boundaries. Instances permissions are limited to retrieve and delete the registration token, access the instance's own tags, and terminate the instance itself. By nature instances are short-lived, we strongly suggest to use *ephemeral runners* to ensure a safe build environment for each workflow job execution.
99

10-
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.
10+
Ephemeral runners are using the *JIT configuration*, configuration that only can be used once to activate a runner. For non-ephemeral runners this option is not provided by GitHub. For non-ephemeral runners a registration token is passed via SSM. After using the token, the token is deleted. But the token remains valid and is potential available in memory on the runner. For ephemeral runners this problem is avoid by using just in time tokens.
11+
12+
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 experience by default the module installs and configures the runner. However secrets are not hard coded, they finally end up in the memory of the instances. We advise to build and harden your own AMIs, you can use the packer images as an example.
13+
14+
15+
## Attestation
16+
17+
The module is released using GitHub actions and the lambda artifacts are attached to the release as attachment. During the release attestation are created. The attestation are created by the release pipeline. You find a link to the attestation in the GitHub release. The attestation only provides provenance information about the release. The attestation are not a security guarantee. We recommend you to verify the attestation after downloading the the lambda artifacts.
18+
19+
--8<-- "SECURITY.md:mkdocsrunners"

0 commit comments

Comments
 (0)