Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(db): sign db artifact with cosign #230

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
username: ${{ env.GH_USER }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.9.0'

- name: Install oras
run: |
# oras was rollbacked to v0.12.0, because now v0.13.0 (the latest version) contains bugs: https://github.com/oras-project/oras/issues/447
Expand All @@ -64,3 +69,9 @@ jobs:
--manifest-config /dev/null:application/vnd.aquasec.trivy.config.v1+json \
db.tar.gz:application/vnd.aquasec.trivy.db.layer.v1.tar+gzip
done

- name: Sign DB and push signature to GHCR
env:
COSIGN_REPOSITORY: "ghcr.io/${{ github.repository_owner }}/trivy-db-signatures"
run: |
echo -n "${{ secrets.COSIGN_PRIVATE_KEY_PASSWORD }}" | cosign sign --key <(echo -n "${{ secrets.COSIGN_PRIVATE_KEY }}") ghcr.io/${{ github.repository }}:latest