chore(deps): update go-indirect (#1031) #1149
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2026 Phillip Cloud | |
| # Licensed under the Apache License, Version 2.0 | |
| name: Security | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| changes: | |
| name: Detect Changes | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| outputs: | |
| go: ${{ steps.detect.outputs.go }} | |
| ci: ${{ steps.detect.outputs.ci }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1 | |
| with: | |
| deploy-on-self-hosted-vm: true | |
| egress-policy: block | |
| disable-telemetry: true | |
| disable-sudo-and-containers: true | |
| allowed-endpoints: > | |
| api.github.com:443 | |
| github.com:443 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| sparse-checkout: .github/detect-ci-changes.bash | |
| sparse-checkout-cone-mode: false | |
| persist-credentials: false | |
| - name: Check for changes | |
| id: detect | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| EVENT_NAME: ${{ github.event_name }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| BEFORE_SHA: ${{ github.event.before }} | |
| HEAD_SHA: ${{ github.sha }} | |
| run: | | |
| bash .github/detect-ci-changes.bash \ | |
| "$EVENT_NAME" "$PR_NUMBER" "$BEFORE_SHA" "$HEAD_SHA" >> "$GITHUB_OUTPUT" | |
| govulncheck: | |
| name: Vulnerability Check | |
| needs: changes | |
| if: needs.changes.outputs.go == 'true' | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| concurrency: | |
| group: security-govulncheck-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1 | |
| with: | |
| deploy-on-self-hosted-vm: true | |
| egress-policy: block | |
| disable-telemetry: true | |
| allowed-endpoints: > | |
| api.github.com:443 | |
| cache.nixos.org:443 | |
| github.com:443 | |
| proxy.golang.org:443 | |
| releases.nixos.org:443 | |
| storage.googleapis.com:443 | |
| vuln.go.dev:443 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0 | |
| - name: Run govulncheck | |
| run: nix run '.#govulncheck' | |
| osv-scanner: | |
| name: OSV Scan | |
| needs: changes | |
| if: needs.changes.outputs.go == 'true' | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| concurrency: | |
| group: security-osv-scanner-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| CGO_ENABLED: "0" | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1 | |
| with: | |
| deploy-on-self-hosted-vm: true | |
| egress-policy: block | |
| disable-telemetry: true | |
| disable-sudo-and-containers: true | |
| allowed-endpoints: > | |
| api.github.com:443 | |
| api.osv.dev:443 | |
| github.com:443 | |
| proxy.golang.org:443 | |
| release-assets.githubusercontent.com:443 | |
| storage.googleapis.com:443 | |
| sum.golang.org:443 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version: "1.26" | |
| - name: Install osv-scanner | |
| run: go install github.com/google/osv-scanner/v2/cmd/osv-scanner@v2.3.5 | |
| - name: Run osv-scanner | |
| run: osv-scanner scan --config osv-scanner.toml --no-ignore --no-call-analysis=go --recursive . | |
| secrets: | |
| name: Secret Scan | |
| needs: changes | |
| if: needs.changes.outputs.ci == 'true' | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| concurrency: | |
| group: security-secrets-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1 | |
| with: | |
| deploy-on-self-hosted-vm: true | |
| egress-policy: block | |
| disable-telemetry: true | |
| allowed-endpoints: > | |
| ghcr.io:443 | |
| github.com:443 | |
| pkg-containers.githubusercontent.com:443 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: step-security/trufflehog-action@72d1f67314fcd8ca707e19692ff0cb670d7d02c7 # v3.95.9 | |
| with: | |
| version: 3.95.5 | |
| extra_args: --only-verified | |
| codeql: | |
| name: CodeQL (Go) | |
| needs: changes | |
| if: needs.changes.outputs.go == 'true' | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| concurrency: | |
| group: security-codeql-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| security-events: write | |
| env: | |
| CGO_ENABLED: "0" | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1 | |
| with: | |
| deploy-on-self-hosted-vm: true | |
| egress-policy: block | |
| disable-telemetry: true | |
| disable-sudo-and-containers: true | |
| allowed-endpoints: > | |
| api.github.com:443 | |
| github.com:443 | |
| proxy.golang.org:443 | |
| release-assets.githubusercontent.com:443 | |
| storage.googleapis.com:443 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version: "1.26" | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 | |
| with: | |
| languages: go | |
| build-mode: manual | |
| - name: Build | |
| run: go build ./... | |
| - name: Perform CodeQL analysis | |
| uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 | |
| result: | |
| name: Security Result | |
| if: always() | |
| needs: [changes, govulncheck, osv-scanner, secrets, codeql] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1 | |
| with: | |
| egress-policy: block | |
| disable-telemetry: true | |
| disable-sudo-and-containers: true | |
| allowed-endpoints: > | |
| api.github.com:443 | |
| github.com:443 | |
| - run: exit 1 | |
| if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') |