Skip to content

Commit

Permalink
CI: add attestation to ORAS artifacts
Browse files Browse the repository at this point in the history
If consumers retrieve guest-components via OCI instead of building them
themselves, it makes sense to add attestations so we can assert on the
consumer side that they have been built from untampered upstream
sources on github runners.

Signed-off-by: Magnus Kulke <[email protected]>
  • Loading branch information
mkulke committed Oct 2, 2024
1 parent b46838c commit cc21fef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
contents: read
packages: write
id-token: write
attestations: write
strategy:
matrix:
tee:
Expand Down Expand Up @@ -101,6 +102,7 @@ jobs:
run: make ./target/${{ matrix.arch }}-unknown-linux-${{ matrix.libc}}/release/attestation-agent

- name: Publish to ORAS
id: publish
env:
ARCH: ${{ matrix.arch == 'x86_64' && 'amd64' || matrix.arch }}
run: |
Expand All @@ -118,12 +120,23 @@ jobs:
docker manifest create "${image}:${tag}" --amend "${image}:${arch_tag}"
docker manifest annotate --arch "$ARCH" --os linux "${image}:${tag}" "${image}:${arch_tag}"
docker manifest push "${image}:${tag}"
# add image and digest to output for attestation
echo "image=${image}" >> "$GITHUB_OUTPUT"
digest="$(oras manifest fetch "${image}:${arch_tag}" | jq -r '.manifests[].digest')"
echo "digest=${digest}" >> "$GITHUB_OUTPUT"
- uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ steps.publish.outputs.image }}
subject-digest: ${{ steps.publish.outputs.digest }}
push-to-registry: true

publish-cdh-and-asr:
permissions:
contents: read
packages: write
id-token: write
attestations: write
strategy:
matrix:
arch:
Expand Down

0 comments on commit cc21fef

Please sign in to comment.