Skip to content

Commit 47bcd5f

Browse files
Founding EngineerPaperclip-Paperclip
andcommitted
feat(CAS-108): pin all GitHub Actions to full SHAs and add actions policy
- Pin all 23 mutable action refs (tags/branches) to full commit SHAs - Critically: replace trivy-action@master with SHA-pinned ref - Manually pin github/codeql-action/upload-sarif@v4 (path action, requires manual resolution: c10b8064de6f491fea524254123dbe5e09572f13) - Add .cascadeguard/actions-policy.yaml with deny-by-default policy - Add exception for deprecated actions/create-release (expires 2026-12-31) Co-Authored-By: Paperclip <noreply@paperclip.ing>
1 parent 582d08f commit 47bcd5f

6 files changed

Lines changed: 54 additions & 24 deletions

File tree

.cascadeguard/actions-policy.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# CascadeGuard Actions Policy
2+
# Schema: https://cascadeguard.dev/schemas/actions-policy/v1
3+
#
4+
# All external GitHub Actions used in this repository must appear in
5+
# allowed_actions or be published by a trusted owner in allowed_owners.
6+
7+
version: "1"
8+
9+
# Reject any action not explicitly permitted below.
10+
default: deny
11+
12+
# GitHub organisations whose actions are trusted by default.
13+
allowed_owners:
14+
- actions # github.com/actions/*
15+
- docker # github.com/docker/*
16+
17+
# Specific actions permitted by name (owner/repo).
18+
allowed_actions:
19+
- arduino/setup-task
20+
- aquasecurity/trivy-action
21+
- github/codeql-action/upload-sarif
22+
23+
# Actions that are always denied, even if the owner is trusted.
24+
denied_actions: []
25+
26+
# One-off exceptions — each must include a 'reason'.
27+
exceptions:
28+
- action: actions/create-release
29+
reason: "Deprecated action still used for release automation; migrate to softprops/action-gh-release"
30+
expires: "2026-12-31"

.github/workflows/_component-test-acceptance.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ jobs:
2121
acceptance-tests:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2525
with:
2626
submodules: recursive
2727
token: ${{ secrets.SUBMODULE_PAT }}
28-
- uses: arduino/setup-task@v1
28+
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
2929
with:
3030
version: 3.x
3131
repo-token: ${{ secrets.GITHUB_TOKEN }}
3232
- name: Setup Node.js (for Playwright tests)
3333
if: hashFiles(format('{0}/tests/acceptance/package.json', inputs.component-path)) != ''
34-
uses: actions/setup-node@v4
34+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
3535
with:
3636
node-version: '18'
3737
cache: 'npm'
3838
cache-dependency-path: ${{ inputs.component-path }}/tests/acceptance/package-lock.json
3939
- name: Setup Python (for pytest tests)
4040
if: hashFiles(format('{0}/**/pytest.ini', inputs.component-path)) != '' || hashFiles(format('{0}/**/pyproject.toml', inputs.component-path)) != ''
41-
uses: actions/setup-python@v4
41+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
4242
with:
4343
python-version: '3.11'
4444
# - name: Install UV (for Python projects)

.github/workflows/_component-test-fast.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ jobs:
2020
test:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2424
with:
2525
submodules: recursive
2626
token: ${{ secrets.SUBMODULE_PAT }}
27-
- uses: arduino/setup-task@v1
27+
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
2828
with:
2929
version: 3.x
3030
repo-token: ${{ secrets.GITHUB_TOKEN }}
3131
- name: Setup Node.js (for npm tests)
3232
if: hashFiles(format('{0}/**/package.json', inputs.component-path)) != ''
33-
uses: actions/setup-node@v4
33+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
3434
with:
3535
node-version: '18'
3636
cache: 'npm'
3737
cache-dependency-path: ${{ inputs.component-path }}/package-lock.json
3838
- name: Setup Python (for pytest tests)
3939
if: hashFiles(format('{0}/**/pytest.ini', inputs.component-path)) != '' || hashFiles(format('{0}/**/pyproject.toml', inputs.component-path)) != ''
40-
uses: actions/setup-python@v4
40+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
4141
with:
4242
python-version: '3.11'
4343
# - name: Install UV (for Python projects)

.github/workflows/_docker-build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757

5858
steps:
5959
- name: Checkout code
60-
uses: actions/checkout@v4
60+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
6161
with:
6262
submodules: recursive
6363
fetch-depth: 0
@@ -69,7 +69,7 @@ jobs:
6969

7070
- name: Set up Node.js (for package.json versioning)
7171
if: inputs.version_type == 'package-json'
72-
uses: actions/setup-node@v4
72+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
7373
with:
7474
node-version: '22'
7575

@@ -143,21 +143,21 @@ jobs:
143143
fi
144144
145145
- name: Set up QEMU
146-
uses: docker/setup-qemu-action@v3
146+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
147147

148148
- name: Set up Docker Buildx
149-
uses: docker/setup-buildx-action@v3
149+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
150150

151151
- name: Log in to Registry
152-
uses: docker/login-action@v3
152+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
153153
with:
154154
registry: ${{ inputs.registry }}
155155
username: ${{ github.repository_owner }}
156156
password: ${{ secrets.GHCR_TOKEN || secrets.GITHUB_TOKEN }}
157157

158158
- name: Build and Push Docker image
159159
id: build
160-
uses: docker/build-push-action@v5
160+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
161161
with:
162162
context: ${{ inputs.context }}
163163
file: ${{ inputs.dockerfile }}
@@ -171,15 +171,15 @@ jobs:
171171

172172
# Trivy will now pull the image from the registry since it's not loaded locally
173173
- name: Run Trivy security scan
174-
uses: aquasecurity/trivy-action@master
174+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # master
175175
with:
176176
image-ref: ${{ inputs.registry }}/${{ inputs.image_name }}:${{ steps.new_version.outputs.version }}
177177
format: 'sarif'
178178
output: 'trivy-results.sarif'
179179
severity: 'CRITICAL,HIGH'
180180

181181
- name: Upload Trivy results
182-
uses: github/codeql-action/upload-sarif@v4
182+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4
183183
if: always()
184184
with:
185185
sarif_file: 'trivy-results.sarif'
@@ -267,7 +267,7 @@ jobs:
267267
268268
- name: Create GitHub Release
269269
if: success() && github.ref_name == 'main'
270-
uses: actions/create-release@v1
270+
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
271271
env:
272272
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
273273
continue-on-error: true # Don't fail if release already exists (race condition or re-run)

.github/workflows/backstage.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- name: Checkout code
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
4141
with:
4242
submodules: recursive
4343
token: ${{ secrets.SUBMODULE_PAT }}
4444

4545
- name: Set up Python
46-
uses: actions/setup-python@v4
46+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
4747
with:
4848
python-version: '3.11'
4949

5050
- name: Install Task
51-
uses: arduino/setup-task@v1
51+
uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
5252
with:
5353
version: 3.x
5454
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -65,14 +65,14 @@ jobs:
6565
run: task platform:ingress:test:backstage
6666

6767
- name: Upload test results
68-
uses: actions/upload-artifact@v4
68+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
6969
if: always()
7070
with:
7171
name: backstage-kustomize-test-results
7272
path: platform/ingress/tests/kustomize/backstage-test-results.xml
7373

7474
- name: Upload test report
75-
uses: actions/upload-artifact@v4
75+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
7676
if: always()
7777
with:
7878
name: backstage-kustomize-test-report

.github/workflows/repo-maintenance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
maintenance:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1818
with:
1919
submodules: recursive
2020
token: ${{ secrets.SUBMODULE_PAT }}
2121

22-
- uses: arduino/setup-task@v1
22+
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
2323
with:
2424
version: 3.x
2525
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)