diff --git a/.github/workflows/build-samples.yml b/.github/workflows/build-samples.yml index 4b3abf0cd..27d558c7e 100644 --- a/.github/workflows/build-samples.yml +++ b/.github/workflows/build-samples.yml @@ -7,6 +7,9 @@ on: branches: [ "main" ] workflow_dispatch: +permissions: + contents: read + jobs: # Build a single-arch nginx image for each arch. build-nginx-on-all-arches: @@ -22,7 +25,7 @@ jobs: arch: [x86_64, "386", armv7, aarch64, riscv64, s390x, ppc64le] steps: - - uses: step-security/harden-runner@rc # v2.7.0 + - uses: step-security/harden-runner@c51e8eeb6c4fdcd08f65e43a051dacdbfaa69702 # rc with: egress-policy: audit - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -58,7 +61,7 @@ jobs: contents: read steps: - - uses: step-security/harden-runner@rc # v2.7.0 + - uses: step-security/harden-runner@c51e8eeb6c4fdcd08f65e43a051dacdbfaa69702 # rc with: egress-policy: audit - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -92,7 +95,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: step-security/harden-runner@rc # v2.7.0 + - uses: step-security/harden-runner@c51e8eeb6c4fdcd08f65e43a051dacdbfaa69702 # rc with: egress-policy: audit - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -120,14 +123,14 @@ jobs: contents: read steps: - - uses: step-security/harden-runner@rc # v2.7.0 + - uses: step-security/harden-runner@c51e8eeb6c4fdcd08f65e43a051dacdbfaa69702 # rc with: egress-policy: audit - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v2.1.5 with: go-version-file: 'go.mod' - - uses: chainguard-dev/actions/setup-registry@main + - uses: chainguard-dev/actions/setup-registry@3e8a2a226fad9e1ecbf2d359b8a7697554a4ac6d # main with: port: 5000 @@ -158,14 +161,14 @@ jobs: contents: read steps: - - uses: step-security/harden-runner@rc # v2.7.0 + - uses: step-security/harden-runner@c51e8eeb6c4fdcd08f65e43a051dacdbfaa69702 # rc with: egress-policy: audit - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v2.1.5 with: go-version-file: 'go.mod' - - uses: chainguard-dev/actions/setup-registry@main + - uses: chainguard-dev/actions/setup-registry@3e8a2a226fad9e1ecbf2d359b8a7697554a4ac6d # main with: port: 5000 @@ -196,7 +199,7 @@ jobs: contents: read steps: - - uses: step-security/harden-runner@rc # v2.7.0 + - uses: step-security/harden-runner@c51e8eeb6c4fdcd08f65e43a051dacdbfaa69702 # rc with: egress-policy: audit - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -205,7 +208,7 @@ jobs: go-version: "1.21" check-latest: true - uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.3 - - uses: chainguard-dev/actions/setup-registry@main + - uses: chainguard-dev/actions/setup-registry@3e8a2a226fad9e1ecbf2d359b8a7697554a4ac6d # main with: port: 5000 - run: | diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a2dbf28be..620ae8d3a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,6 +6,9 @@ on: push: branches: [ "main" ] +permissions: + contents: read + jobs: build: name: build diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 85fa95f9c..3207b6690 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -9,6 +9,9 @@ on: env: CODEQL_EXTRACTOR_GO_BUILD_TRACING: true +permissions: + contents: read + jobs: analyze: runs-on: ubuntu-latest diff --git a/.github/workflows/go-tests.yaml b/.github/workflows/go-tests.yaml index bcd89111d..cac5235d7 100644 --- a/.github/workflows/go-tests.yaml +++ b/.github/workflows/go-tests.yaml @@ -6,6 +6,9 @@ on: pull_request: branches: [ "main" ] +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest @@ -14,6 +17,11 @@ jobs: contents: read steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 + with: + egress-policy: audit + - name: Install Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v3.0.0 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index afb831568..c3cd2e065 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,6 +9,9 @@ on: env: GO_VERSION: '1.21' +permissions: + contents: read + jobs: cli: # Only release CLI for tagged releases diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index c98cf1ad5..b65c29ae7 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -6,6 +6,9 @@ on: pull_request: branches: [ "main" ] +permissions: + contents: read + jobs: golangci: name: lint @@ -15,6 +18,11 @@ jobs: contents: read steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 + with: + egress-policy: audit + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v2.2.0 with: