Skip to content

Commit 34b1a45

Browse files
authored
Harden GitHub Actions workflows (#61)
- Pin actions to full commit SHAs for supply chain security - Add step-security/harden-runner for runtime security monitoring - Set minimum GITHUB_TOKEN permissions - Apply security best practices per StepSecurity recommendations
1 parent 4beab84 commit 34b1a45

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ jobs:
1818
name: Test ${{ matrix.function }}
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v5
21+
- name: Harden Runner
22+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
23+
with:
24+
egress-policy: audit
25+
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5
2227
- name: Setup Python
23-
uses: actions/setup-python@v6
28+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a20 # v6
2429
with:
2530
python-version: '3.13'
2631
cache: 'pip'
@@ -58,9 +63,14 @@ jobs:
5863
name: Build UI
5964
runs-on: ubuntu-latest
6065
steps:
61-
- uses: actions/checkout@v5
66+
- name: Harden Runner
67+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
68+
with:
69+
egress-policy: audit
70+
71+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5
6272
- name: Setup Node
63-
uses: actions/setup-node@v6
73+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v6
6474
with:
6575
node-version: 22
6676
cache: 'npm'

.github/workflows/pylint.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ jobs:
1717
env:
1818
PYTHON_VERSION: '3.13'
1919
steps:
20-
- uses: actions/checkout@v5
20+
- name: Harden Runner
21+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
22+
with:
23+
egress-policy: audit
24+
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5
2126
- name: Set up Python
22-
uses: actions/setup-python@v6
27+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a20 # v6
2328
with:
2429
python-version: ${{ env.PYTHON_VERSION }}
2530
- name: Install global dependencies

.github/workflows/rebuild.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ jobs:
1616
if: github.repository == 'CrowdStrike/foundry-sample-functions-python'
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v5
19+
- name: Harden Runner
20+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
21+
with:
22+
egress-policy: audit
23+
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5
2025
- name: Setup Node
21-
uses: actions/setup-node@v6
26+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v6
2227
with:
2328
node-version: 22
2429
- name: Install dependencies
@@ -32,7 +37,7 @@ jobs:
3237
git add .
3338
git commit -a -m "Rebuild UI with latest dependencies" || true
3439
- name: Create Pull Request
35-
uses: peter-evans/create-pull-request@v7
40+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
3641
with:
3742
token: ${{ secrets.GITHUB_TOKEN }}
3843
commit-message: 'Rebuild with latest dependencies'

0 commit comments

Comments
 (0)