Skip to content

Commit

Permalink
Signature verification added for kapp-controller artifacts
Browse files Browse the repository at this point in the history
Signed-off-by: rcmadhankumar <[email protected]>
  • Loading branch information
rcmadhankumar committed Dec 11, 2023
1 parent 0594982 commit 94fe6fc
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
kapp-controller-release:
name: kapp-controller release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Check out code
uses: actions/[email protected]
Expand Down Expand Up @@ -37,6 +41,9 @@ jobs:
with:
go-version: 1.21.1

- name: Set up Cosign
uses: sigstore/cosign-installer@v3

- name: Run release script
run: |
set -e -x
Expand All @@ -50,13 +57,39 @@ jobs:
./hack/build-binaries.sh
cp ./kctrl-* ../release/
- name: Sign kapp-controller OCI image
run: |
image_url=`yq e '.spec.template.spec.containers[] | select(.name == "kapp-controller") | .image' release/release.yml`
cosign sign --yes "$image_url"
- name: Verify signature on Kapp-controller OCI image
run: |
image_url=`yq e '.spec.template.spec.containers[] | select(.name == "kapp-controller") | .image' release/release.yml`
cosign verify \
$image_url \
--certificate-identity-regexp=https://github.com/carvel-dev \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com
- name: Run Package build
run: |
constraintVersion="${{ github.ref_name }}"
./cli/kctrl-linux-amd64 pkg release -y -v ${constraintVersion:1} --debug
mv ./carvel-artifacts/packages/kapp-controller.carvel.dev/metadata.yml ./carvel-artifacts/packages/kapp-controller.carvel.dev/package-metadata.yml
mv ./carvel-artifacts/packages/kapp-controller.carvel.dev/* release/
- name: Sign kapp-controller-package-bundle OCI image
run: |
image_url=`yq e '.spec.template.spec.fetch[0].imgpkgBundle.image' release/package.yml`
cosign sign --yes "$image_url"
- name: Verify signature on kapp-controller-package-bundle OCI image
run: |
image_url=`yq e '.spec.template.spec.fetch[0].imgpkgBundle.image' release/package.yml`
cosign verify \
$image_url \
--certificate-identity-regexp=https://github.com/carvel-dev \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com
- name: Add to formatted checksum
run: |
pushd release
Expand All @@ -67,6 +100,18 @@ jobs:
cat ./tmp/checksums.txt | tee -a ./tmp/checksums-formatted.txt
echo '```' | tee -a ./tmp/checksums-formatted.txt
- name: Sign checksums.txt
run: |
cosign sign-blob --yes ./tmp/checksums.txt --output-certificate release/checksums.pem --output-signature release/checksums.sig
- name: Verify checksums signature
run: |
cosign verify-blob \
--cert release/checksums.pem \
--signature release/checksums.sig \
--certificate-identity-regexp=https://github.com/carvel-dev \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com ./tmp/checksums.txt
- name: Create release draft and upload release yaml
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
Expand Down

0 comments on commit 94fe6fc

Please sign in to comment.