Skip to content

Commit

Permalink
🌱 Restrict egress on github actions
Browse files Browse the repository at this point in the history
Signed-off-by: naveensrinivasan <[email protected]>
  • Loading branch information
naveensrinivasan committed Mar 21, 2022
1 parent 0c76ae3 commit 76d3e10
Show file tree
Hide file tree
Showing 8 changed files with 175 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -66,6 +71,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -103,6 +113,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -140,6 +155,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -177,6 +197,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -214,6 +239,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -251,6 +281,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
permissions:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

-
name: Checkout
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v2.3.4
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
approve:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: approve
run: echo For security reasons, all pull requests need to be approved before running integration tests.

Expand All @@ -32,6 +37,11 @@ jobs:
environment: integration-test
needs: [approve]
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: pull_request actions/checkout
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v2.3.4
with:
Expand Down
102 changes: 101 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed #v2.1.7
Expand Down Expand Up @@ -60,6 +65,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -95,6 +105,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -129,6 +144,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -164,6 +184,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -199,6 +224,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -234,6 +264,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -269,6 +304,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -304,6 +344,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -339,6 +384,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -374,6 +424,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -409,6 +464,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -444,6 +504,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -479,6 +544,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -514,6 +584,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -548,6 +623,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
Expand Down Expand Up @@ -582,6 +662,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed #v2.1.7
Expand Down Expand Up @@ -612,6 +697,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed #v2.1.7
Expand Down Expand Up @@ -642,6 +732,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed #v2.1.7
Expand Down Expand Up @@ -672,6 +767,11 @@ jobs:
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v2.3.4
- uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v2.2.0
with:
Expand All @@ -681,4 +781,4 @@ jobs:
go env -w GOFLAGS=-mod=mod
go install github.com/google/addlicense@2fe3ee94479d08be985a84861de4e6b06a1c7208
addlicense -ignore "**/script-empty.sh" -ignore "pkg/testdata/**" -ignore "checks/testdata/**" -l apache -c 'Security Scorecard Authors' -v *
git diff --exit-code
git diff --exit-coden
5 changes: 5 additions & 0 deletions .github/workflows/ok-to-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
# Only run for PRs, not issue comments
if: ${{ github.event.issue.pull_request }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@40877f718dce0101edfc7aea2b3800cc192f9ed5 # v2.1.3
env:
Expand Down
Loading

0 comments on commit 76d3e10

Please sign in to comment.