Skip to content

Commit 0ca3620

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/lambdas/nx-f87bce4df0
2 parents db8ccf7 + 72482d0 commit 0ca3620

File tree

98 files changed

+2994
-1977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2994
-1977
lines changed

.ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#syntax=docker/dockerfile:1.2
2-
FROM node:20 as build
2+
FROM node@sha256:0c0734eb7051babbb3e95cd74e684f940552b31472152edf0bb23e54ab44a0d7 as build
33
WORKDIR /lambdas
44
RUN apt-get update \
55
&& apt-get install -y zip \

.devcontainer/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
ARG VARIANT="20-bullseye"
2-
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
1+
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node@sha256:acdce1045a2ddce4c66846d5cd09adf746d157fce9233124e4925b647f192b2e

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,23 @@ updates:
5151
commit-message:
5252
prefix: "fix(lambda)"
5353
prefix-development: "chore(lambda)"
54+
55+
- package-ecosystem: "docker"
56+
directory: "/.ci/Dockerfile"
57+
schedule:
58+
interval: "weekly"
59+
labels:
60+
- "dependencies"
61+
- "docker"
62+
commit-message:
63+
prefix: "chore(docker)"
64+
65+
- package-ecosystem: "docker"
66+
directory: "/.devcontainer/Dockerfile"
67+
schedule:
68+
interval: "weekly"
69+
labels:
70+
- "dependencies"
71+
- "docker"
72+
commit-message:
73+
prefix: "chore(devcontainer)"

.github/workflows/actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ jobs:
4545
security-events: write
4646
steps:
4747
- name: Download SARIF file
48-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
48+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
4949
with:
5050
name: results.sarif
5151
path: results.sarif
5252

5353
- name: Upload SARIF file
54-
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
54+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
5555
with:
5656
sarif_file: results.sarif
5757
category: actions-zizmor

.github/workflows/codeql.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
schedule:
1111
- cron: '25 19 * * 2'
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
analyze:
1518
name: Analyze (${{ matrix.language }})
@@ -24,19 +27,24 @@ jobs:
2427
language: ['javascript-typescript', 'actions']
2528

2629
steps:
30+
- name: Harden the runner (Audit all outbound calls)
31+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
32+
with:
33+
egress-policy: audit
34+
2735
- name: Checkout repository
2836
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2937
with:
3038
persist-credentials: false
3139

3240
# Initializes the CodeQL tools for scanning.
3341
- name: Initialize CodeQL
34-
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
42+
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
3543
with:
3644
languages: ${{ matrix.language }}
3745
build-mode: none
3846

3947
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
48+
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
4149
with:
4250
category: "/language:${{matrix.language}}"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Harden the runner (Audit all outbound calls)
20+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
21+
with:
22+
egress-policy: audit
23+
24+
- name: 'Checkout Repository'
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with:
27+
persist-credentials: false
28+
- name: 'Dependency Review'
29+
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1

.github/workflows/lambda.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
working-directory: ./lambdas
2525

2626
steps:
27+
- name: Harden the runner (Audit all outbound calls)
28+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
29+
with:
30+
egress-policy: audit
31+
2732
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2833
with:
2934
persist-credentials: false
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: OSSF Scorecard supply-chain security
2+
on:
3+
branch_protection_rule:
4+
schedule:
5+
- cron: '44 19 * * 2'
6+
workflow_dispatch:
7+
push:
8+
branches: [ "main" ]
9+
10+
permissions: read-all
11+
12+
jobs:
13+
analysis:
14+
name: Scorecard analysis
15+
runs-on: ubuntu-latest
16+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
17+
permissions:
18+
security-events: write
19+
id-token: write
20+
21+
steps:
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
24+
with:
25+
egress-policy: audit
26+
27+
- name: "Checkout code"
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
31+
32+
- name: "Run analysis"
33+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
34+
with:
35+
results_file: results.sarif
36+
results_format: sarif
37+
publish_results: true
38+
39+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
40+
# format to the repository Actions tab.
41+
- name: "Upload artifact"
42+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
43+
with:
44+
name: SARIF file
45+
path: results.sarif
46+
retention-days: 5
47+
48+
# Upload the results to GitHub's code scanning dashboard (optional).
49+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
50+
- name: "Upload to code-scanning"
51+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b
52+
with:
53+
sarif_file: results.sarif

.github/workflows/packer-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
run:
2929
working-directory: images/${{ matrix.image }}
3030
steps:
31+
- name: Harden the runner (Audit all outbound calls)
32+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
33+
with:
34+
egress-policy: audit
35+
3136
- name: "Checkout"
3237
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3338
with:

.github/workflows/release.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- v1
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
release:
1114
name: Release
@@ -16,6 +19,11 @@ jobs:
1619
id-token: write
1720
attestations: write
1821
steps:
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
24+
with:
25+
egress-policy: audit
26+
1927
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2028
with:
2129
node-version: 22
@@ -26,7 +34,7 @@ jobs:
2634
working-directory: lambdas
2735
run: yarn install --frozen-lockfile && yarn run test && yarn dist
2836
- name: Get installation token
29-
uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
37+
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
3038
id: token
3139
with:
3240
app-id: ${{ vars.RELEASER_APP_ID }}
@@ -45,7 +53,7 @@ jobs:
4553
- name: Attest
4654
if: ${{ steps.release.outputs.releases_created == 'true' }}
4755
id: attest
48-
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
56+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
4957
with:
5058
subject-path: '${{ github.workspace }}/lambdas/functions/**/*.zip'
5159
- name: Update release notes with attestation
@@ -62,7 +70,7 @@ jobs:
6270
gh release view $version --json body -q '.body' > new-release-notes.md
6371
echo "## Attestation" >> new-release-notes.md
6472
echo "Attestation url: $attestation_url" >> new-release-notes.md
65-
echo "Verify the artifacts by running \`gh attest verify <name_of_artifact> --repo ${{ github.repository }}\`" >> new-release-notes.md
73+
echo "Verify the artifacts by running \`gh attestation verify <name_of_artifact> --repo ${{ github.repository }}\`" >> new-release-notes.md
6674
gh release edit $tag_name -F new-release-notes.md -t $tag_name
6775
- name: Upload release assets
6876
if: ${{ steps.release.outputs.releases_created == 'true' }}
@@ -74,3 +82,23 @@ jobs:
7482
for f in $(find . -name '*.zip'); do
7583
gh release upload $tag_name $f
7684
done
85+
- name: Attach attestation
86+
if: ${{ steps.release.outputs.releases_created == 'true' }}
87+
env:
88+
ATTESTATION_BUNDLE: ${{ steps.attest.outputs.bundle-path }}
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
TAG_NAME: ${{ steps.release.outputs.tag_name }}
91+
ATTESTATION_ID: ${{ steps.attest.outputs.attestation-id }}
92+
run: |
93+
# rename attest bundle to github-aws-runners-terraform-aws-github-runner-attestation-$attestation-id.sigstore
94+
# OpenSSF expects the attestation bundle to be named in this format (*.sigstore)
95+
SIGSTORE_BUNDLE=$RUNNER_TEMP/github-aws-runners-terraform-aws-github-runner-attestation-${ATTESTATION_ID}.sigstore
96+
INTOTO_BUNDLE=$RUNNER_TEMP/github-aws-runners-terraform-aws-github-runner-attestation-${ATTESTATION_ID}.intoto.jsonl
97+
mv ${ATTESTATION_BUNDLE} $SIGSTORE_BUNDLE
98+
if [ -z "$SIGSTORE_BUNDLE" ]; then
99+
echo "No attestation bundle found, skipping attachment."
100+
exit 0
101+
fi
102+
gh release upload $TAG_NAME "$SIGSTORE_BUNDLE"
103+
cat ${SIGSTORE_BUNDLE} | jq -r '.dsseEnvelope | select(.payloadType == "application/vnd.in-toto+json").payload' | base64 -d | jq .> ${INTOTO_BUNDLE}
104+
gh release upload $TAG_NAME "${INTOTO_BUNDLE}"

0 commit comments

Comments
 (0)