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

[Draft] Signature verification added for kapp-controller artifacts #1414

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
43 changes: 42 additions & 1 deletion .github/workflows/release-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,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 +53,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/rcmadhankumar \
--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/rcmadhankumar \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com

- name: Add to formatted checksum
run: |
pushd release
Expand All @@ -67,6 +96,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 ./tmp/checksums.txt --output-certificate ./tmp/checksums.pem --output-signature ./tmp/checksums.sig

- name: Verify checksums signature
run: |
cosign verify-blob \
--cert ./tmp/checksums.pem \
--signature ./tmp/checksums.sig \
--certificate-identity-regexp=https://github.com/rcmadhankumar \
--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 All @@ -75,7 +116,7 @@ jobs:
body_path: ./tmp/checksums-formatted.txt
files: |
./release/*
./tmp/checksums.txt
./tmp/*
draft: true
prerelease: true

Expand Down
2 changes: 1 addition & 1 deletion config-release/values-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#@schema/desc "Configuration explicitly for developing kapp-controller"
dev:
#@schema/desc "Location of kapp-controller image"
image_repo: ghcr.io/carvel-dev/kapp-controller
image_repo: ghcr.io/rcmadhankumar/kapp-controller
#@schema/desc "Development version"
version: develop
#@schema/desc "Comma separated list of supported architectures"
Expand Down
2 changes: 1 addition & 1 deletion package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
- .imgpkg/images.yml
export:
- imgpkgBundle:
image: ghcr.io/carvel-dev/kapp-controller-package-bundle
image: ghcr.io/rcmadhankumar/kapp-controller-package-bundle
useKbldImagesLock: false
includePaths:
- config
Expand Down
Loading