diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index 14f4247d..c0d8e7af 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -93,6 +93,8 @@ jobs: contents: read packages: write id-token: write # required for keyless cosign signing via OIDC + attestations: write + artifact-metadata: write strategy: fail-fast: false matrix: @@ -186,6 +188,13 @@ jobs: path: digest-*.json retention-days: 1 + - name: Attest image build provenance + if: needs.pr-author-permission.outputs.is_collaborator == 'true' + uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + with: + subject-name: ${{ env.REGISTRY }}/${{ steps.image.outputs.name }} + subject-digest: ${{ steps.build_and_push.outputs.digest }} + push-to-registry: true post-build: name: Post-Build Digest Collector diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 8850f52a..bf1d81c8 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -48,14 +48,28 @@ jobs: name: Release needs: publish runs-on: ubuntu-latest + permissions: + contents: write + id-token: write steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c with: - name: '*-signed' + pattern: '*-signed' path: packages + merge-multiple: true + + - name: Install cosign + uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 + + - name: Sign release packages + working-directory: packages + run: | + for package in *.deb; do + cosign sign-blob --yes --bundle "${package}.sigstore.json" "${package}" + done - name: Create release working-directory: packages @@ -68,4 +82,5 @@ jobs: --target ${{ github.sha }} \ --generate-notes \ --latest \ - *.deb + *.deb \ + *.sigstore.json