Skip to content

Commit

Permalink
Merge pull request Checkmarx#899 from Checkmarx/feature/elchanan/dock…
Browse files Browse the repository at this point in the history
…er_sign

Sign docker image (AST-51994)
  • Loading branch information
elchananarb authored Sep 26, 2024
2 parents 25d1809 + 88e932e commit 5ff5a6e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
APPLE_DEVELOPER_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_PUBLIC_KEY: ${{ secrets.COSIGN_PUBLIC_KEY }}
steps:
- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 #v4.0.0
Expand Down Expand Up @@ -125,6 +128,18 @@ jobs:
SIGNING_REMOTE_SSH_HOST: ${{ secrets.SIGNING_REMOTE_SSH_HOST }}
SIGNING_REMOTE_SSH_PRIVATE_KEY: ${{ secrets.SIGNING_REMOTE_SSH_PRIVATE_KEY }}
SIGNING_HSM_CREDS: ${{ secrets.SIGNING_HSM_CREDS }}
- name: Sign Docker Image with Cosign
if: inputs.dev == false
run: |
cosign sign --yes --key env://COSIGN_PRIVATE_KEY checkmarx/ast-cli:${{ inputs.tag }}
- name: Verify Docker image signature
if: inputs.dev == false
run: |
echo "${{ secrets.COSIGN_PUBLIC_KEY }}" > cosign.pub
cosign verify --key cosign.pub checkmarx/ast-cli:${{ inputs.tag }}
env:
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}

notify:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ builds:
- SIGNING_REMOTE_SSH_HOST={{ .Env.SIGNING_REMOTE_SSH_HOST }}
- SIGNING_HSM_CREDS={{ .Env.SIGNING_HSM_CREDS }}
- SIGNING_REMOTE_SSH_PRIVATE_KEY={{ .Env.SIGNING_REMOTE_SSH_PRIVATE_KEY }}

- main: ./cmd/main.go
env:
- CGO_ENABLED=0
Expand Down

0 comments on commit 5ff5a6e

Please sign in to comment.