Skip to content

Commit 919853e

Browse files
author
Alexander Schueren
authored
chore(ci): pin 3rd party actions to sha commit (#1335)
1 parent 6b32304 commit 919853e

9 files changed

+46
-14
lines changed

Diff for: .github/workflows/make-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
3131
- name: Cache node modules
3232
id: cache-node-modules
33-
uses: actions/cache@v3
33+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
3434
with:
3535
path: "./node_modules"
3636
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that

Diff for: .github/workflows/measure-packages-size.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
ref: ${{ steps.extract_PR_details.outputs.headSHA }}
3333
- name: Packages size report
34-
uses: flochaz/pkg-size-action@v2.0.0
34+
uses: flochaz/pkg-size-action@e41584e9396375027c8a3c68909e3eca55719e47 # v.2.0.0
3535
with:
3636
build-command: mkdir dist && npm run package -w packages/logger -w packages/tracer -w packages/metrics -w packages/commons -w packages/parameters && npm run package-bundle -w packages/logger -w packages/tracer -w packages/metrics -w packages/commons -w packages/parameters && bash -c "mv ./packages/*/dist/* dist/" && ls dist
3737
dist-directory: /dist

Diff for: .github/workflows/on-merge-to-main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@v3
3030
- name: Update release draft
31-
uses: release-drafter/release-drafter@v5.20.0
31+
uses: release-drafter/release-drafter@569eb7ee3a85817ab916c8f8ff03a5bd96c9c83e # v5.23.0
3232
env:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3434
release_label_on_merge:

Diff for: .github/workflows/on-workflows-push-pr.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lockdown untrusted workflows
2+
3+
on:
4+
push:
5+
paths:
6+
- ".github/workflows/**"
7+
pull_request:
8+
paths:
9+
- ".github/workflows/**"
10+
11+
jobs:
12+
enforce_pinned_workflows:
13+
name: Harden Security
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
- name: Ensure 3rd party workflows have SHA pinned
19+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@b9ddf6a5153efe6fb94f071c8915175afdce60fa # v2.1.0
20+
with:
21+
# Trusted GitHub Actions and/or organizations
22+
allowlist: |
23+
aws-actions/
24+
actions/checkout
25+
actions/github-script
26+
actions/setup-node
27+
actions/setup-python
28+
actions/upload-artifact
29+
actions/download-artifact
30+
github/codeql-action/init
31+
github/codeql-action/analyze
32+
dependabot/fetch-metadata

Diff for: .github/workflows/publish_layer.yaml renamed to .github/workflows/publish_layer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
4848
- name: Cache node modules
4949
id: cache-node-modules
50-
uses: actions/cache@v3
50+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
5151
with:
5252
path: "./node_modules"
5353
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that

Diff for: .github/workflows/reusable-publish-docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
# if one of them changes the cache is invalidated/discarded
5151
- name: Cache node modules
5252
id: cache-node-modules
53-
uses: actions/cache@v3
53+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
5454
with:
5555
path: "./node_modules"
5656
key: 18-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}

Diff for: .github/workflows/reusable-run-linting-check-and-unit-tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: npm i -g npm@next-8
2525
- name: Cache node modules
2626
id: cache-node-modules
27-
uses: actions/cache@v3
27+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
2828
with:
2929
path: "./node_modules"
3030
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
@@ -68,7 +68,7 @@ jobs:
6868
cache: "npm"
6969
- name: Cache node modules
7070
id: cache-node-modules
71-
uses: actions/cache@v3
71+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
7272
with:
7373
path: "./examples/${{ matrix.example }}/node_modules"
7474
# Use the combo between example, name, and SHA-256 hash of all example lock files as cache key.
@@ -98,7 +98,7 @@ jobs:
9898
cache: "npm"
9999
- name: Cache node modules
100100
id: cache-node-modules
101-
uses: actions/cache@v3
101+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
102102
with:
103103
path: "./node_modules"
104104
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
@@ -133,7 +133,7 @@ jobs:
133133
run: npm i -g npm@next-8
134134
- name: Cache node modules
135135
id: cache-node-modules
136-
uses: actions/cache@v3
136+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
137137
with:
138138
path: "./node_modules"
139139
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that

Diff for: .github/workflows/reusable_deploy_layer_stack.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: checkout
6363
uses: actions/checkout@v3
6464
- name: aws credentials
65-
uses: aws-actions/configure-aws-credentials@v1
65+
uses: aws-actions/configure-aws-credentials@186395a8644e48f35e7b453e8a7128d9a3948296
6666
with:
6767
aws-region: ${{ matrix.region }}
6868
role-to-assume: ${{ secrets.target-account-role }}
@@ -72,7 +72,7 @@ jobs:
7272
node-version: "18"
7373
- name: Cache node modules
7474
id: cache-node-modules
75-
uses: actions/cache@v3
75+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
7676
with:
7777
path: "./node_modules"
7878
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that

Diff for: .github/workflows/run-e2e-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
# See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
5353
run: npm ci --foreground-scripts
5454
- name: Setup AWS credentials
55-
uses: aws-actions/configure-aws-credentials@v1.6.1
55+
uses: aws-actions/configure-aws-credentials@186395a8644e48f35e7b453e8a7128d9a3948296
5656
with:
5757
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
5858
aws-region: eu-west-1
@@ -98,13 +98,13 @@ jobs:
9898
- name: Setup npm
9999
run: npm i -g npm@next-8
100100
- name: "Configure AWS credentials"
101-
uses: aws-actions/configure-aws-credentials@v1.6.1
101+
uses: aws-actions/configure-aws-credentials@186395a8644e48f35e7b453e8a7128d9a3948296
102102
with:
103103
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
104104
aws-region: eu-west-1
105105
- name: Cache node modules for commons
106106
id: cache-node-modules
107-
uses: actions/cache@v3
107+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
108108
with:
109109
path: "./node_modules"
110110
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that

0 commit comments

Comments
 (0)