Skip to content

Commit

Permalink
ci(github): 🔒 further hardening of workflow actions
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Sep 30, 2024
1 parent df436d7 commit 445c57c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 5 deletions.
43 changes: 39 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
build:
needs: check_release
permissions:
contents: write
contents: read
# if: ${{ !startsWith( 'doc') }}
runs-on: ubuntu-22.04
strategy:
Expand All @@ -60,7 +60,30 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
egress-policy: block
allowed-endpoints: >
api.github.com:443
auth.docker.io:443
azure.archive.ubuntu.com:80
esm.ubuntu.com:443
fyne.io:443
github.com:443
go.dev:443
go.googlesource.com:443
golang.org:443
gopkg.in:443
motd.ubuntu.com:443
objects.githubusercontent.com:443
packages.microsoft.com:443
pkg.go.dev:443
production.cloudflare.docker.com:443
proxy.golang.org:443
raw.githubusercontent.com:443
registry-1.docker.io:443
rekor.sigstore.dev:443
storage.googleapis.com:443
sum.golang.org:443
uploads.github.com:443
- name: Set up environment
run: |
platform=${{ matrix.platform }}
Expand Down Expand Up @@ -210,7 +233,7 @@ jobs:
- check_release
- build_container
permissions:
contents: write
contents: read
packages: write
env:
REGISTRY: ghcr.io
Expand All @@ -219,7 +242,19 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
auth.docker.io:443
ghcr.io:443
github.com:443
objects.githubusercontent.com:443
pkg-containers.githubusercontent.com:443
production.cloudflare.docker.com:443
raw.githubusercontent.com:443
registry-1.docker.io:443
rekor.sigstore.dev:443
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.deps.dev:443
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
- name: "Checkout code"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
Expand Down

0 comments on commit 445c57c

Please sign in to comment.