Skip to content

Commit

Permalink
chore: Validate Chainguard's cosign image signatures before proceeding
Browse files Browse the repository at this point in the history
Signed-off-by: RJ Sampson <[email protected]>
  • Loading branch information
EyeCantCU committed Jul 2, 2024
1 parent ab5ee40 commit acdb686
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion sign/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ runs:
username: ${{ github.actor }}
password: ${{ inputs.registry-token }}

- name: Install cosign
- name: Fetch cosign from Chainguard
shell: bash
run: |
docker pull cgr.dev/chainguard/cosign:latest
CONTAINER_ID=$(docker run -d cgr.dev/chainguard/cosign:latest)
docker cp "${CONTAINER_ID}":/usr/bin/cosign /usr/local/bin/cosign
- name: Validate cosign image signatures
shell: bash
run: |
set -o pipefail
if ! cosign verify --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main cgr.dev/chainguard/cosign | jq; then
echo "NOTICE: Failed to verify cosign image signatures."
exit 1
fi
- name: Sign container image
shell: bash
run: |
Expand Down
11 changes: 10 additions & 1 deletion verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,22 @@ inputs:
runs:
using: "composite"
steps:
- name: Install cosign
- name: Fetch cosign from Chainguard
shell: bash
run: |
docker pull cgr.dev/chainguard/cosign:latest
CONTAINER_ID=$(docker run -d cgr.dev/chainguard/cosign:latest)
docker cp "${CONTAINER_ID}":/usr/bin/cosign /usr/local/bin/cosign
- name: Validate cosign image signatures
shell: bash
run: |
set -o pipefail
if ! cosign verify --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main cgr.dev/chainguard/cosign | jq; then
echo "NOTICE: Failed to verify cosign image signatures."
exit 1
fi
- name: Verify container
shell: bash
run: |
Expand Down

0 comments on commit acdb686

Please sign in to comment.