diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8bbd9b72..d689b9e9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,20 +5,22 @@ on: tags: - "*" -permissions: - contents: read - packages: write - env: REGISTRY: ghcr.io IMAGE_NAME: datadog/stratus-red-team +permissions: + contents: read + jobs: docker-build-push: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Harden Runner - uses: step-security/harden-runner@v1 + uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs @@ -28,14 +30,14 @@ jobs: fetch-depth: 0 - name: Log into registry ${{ env.REGISTRY }} - uses: docker/login-action@v2.0.0 + uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v3.1.1 + uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94 with: context: . push: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f9be8cfa..5aa1e220 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,8 +8,14 @@ on: - "docs/**" - mkdocs.yml - "tools/**" + +permissions: + contents: read + jobs: deploy: + permissions: + contents: write # for mkdocs gh-deploy to publish docs runs-on: ubuntu-latest steps: - name: Harden Runner diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cc0a1b3..2f354b42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,19 +5,21 @@ on: tags: - "*" -permissions: - contents: write - defaults: run: working-directory: ./v2 +permissions: + contents: read + jobs: goreleaser: runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Harden Runner - uses: step-security/harden-runner@v1 + uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs @@ -26,12 +28,12 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 with: go-version: 1.18 - name: Run GoReleaser timeout-minutes: 60 - uses: goreleaser/goreleaser-action@v3 + uses: goreleaser/goreleaser-action@ff11ca24a9b39f2d36796d1fbd7a4e39c182630a with: distribution: goreleaser version: latest diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index c0538e7f..240e667e 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -8,6 +8,9 @@ on: branches: - main +permissions: + contents: read + jobs: static-analysis: name: "Run Go static analysis"