mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-08 20:08:51 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 72f5246ce3 | |||
| cb308bb4c7 |
@@ -79,10 +79,14 @@ jobs:
|
|||||||
OUTPUT_NAME: ${{ steps.build.outputs.output_name }}
|
OUTPUT_NAME: ${{ steps.build.outputs.output_name }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
# Cosign v3.0 (shipped by cosign-installer@v4.1.1 default
|
||||||
|
# cosign-release=v3.0.5) removed --output-signature/--output-certificate
|
||||||
|
# on sign-blob. The replacement is --bundle, which emits a unified
|
||||||
|
# Sigstore bundle (signature + cert chain + Rekor inclusion proof) as
|
||||||
|
# a single .sigstore.json artefact. M-11.
|
||||||
cosign sign-blob \
|
cosign sign-blob \
|
||||||
--yes \
|
--yes \
|
||||||
--output-signature "dist/${OUTPUT_NAME}.sig" \
|
--bundle "dist/${OUTPUT_NAME}.sigstore.json" \
|
||||||
--output-certificate "dist/${OUTPUT_NAME}.pem" \
|
|
||||||
"dist/${OUTPUT_NAME}"
|
"dist/${OUTPUT_NAME}"
|
||||||
|
|
||||||
- name: Compute SHA-256 sidecar
|
- name: Compute SHA-256 sidecar
|
||||||
@@ -100,8 +104,7 @@ jobs:
|
|||||||
name: binary-${{ steps.build.outputs.output_name }}
|
name: binary-${{ steps.build.outputs.output_name }}
|
||||||
path: |
|
path: |
|
||||||
dist/${{ steps.build.outputs.output_name }}
|
dist/${{ steps.build.outputs.output_name }}
|
||||||
dist/${{ steps.build.outputs.output_name }}.sig
|
dist/${{ steps.build.outputs.output_name }}.sigstore.json
|
||||||
dist/${{ steps.build.outputs.output_name }}.pem
|
|
||||||
dist/${{ steps.build.outputs.output_name }}.sbom.spdx.json
|
dist/${{ steps.build.outputs.output_name }}.sbom.spdx.json
|
||||||
dist/${{ steps.build.outputs.output_name }}.sha256
|
dist/${{ steps.build.outputs.output_name }}.sha256
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
@@ -138,7 +141,7 @@ jobs:
|
|||||||
: > checksums.txt
|
: > checksums.txt
|
||||||
for f in certctl-*; do
|
for f in certctl-*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sig|*.pem|*.sbom.spdx.json|*.sha256|checksums.txt)
|
*.sigstore.json|*.sbom.spdx.json|*.sha256|checksums.txt)
|
||||||
continue ;;
|
continue ;;
|
||||||
esac
|
esac
|
||||||
sha256sum "$f" >> checksums.txt
|
sha256sum "$f" >> checksums.txt
|
||||||
@@ -156,10 +159,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd artifacts
|
cd artifacts
|
||||||
|
# Cosign v3.0 --bundle replaces the removed v2 flag pair
|
||||||
|
# --output-signature / --output-certificate. See M-11.
|
||||||
cosign sign-blob \
|
cosign sign-blob \
|
||||||
--yes \
|
--yes \
|
||||||
--output-signature checksums.txt.sig \
|
--bundle checksums.txt.sigstore.json \
|
||||||
--output-certificate checksums.txt.pem \
|
|
||||||
checksums.txt
|
checksums.txt
|
||||||
|
|
||||||
- name: Upload artefacts to GitHub Release
|
- name: Upload artefacts to GitHub Release
|
||||||
@@ -169,8 +173,7 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
artifacts/certctl-*
|
artifacts/certctl-*
|
||||||
artifacts/checksums.txt
|
artifacts/checksums.txt
|
||||||
artifacts/checksums.txt.sig
|
artifacts/checksums.txt.sigstore.json
|
||||||
artifacts/checksums.txt.pem
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# provenance-binaries (M-3): SLSA Level 3 provenance for every binary.
|
# provenance-binaries (M-3): SLSA Level 3 provenance for every binary.
|
||||||
@@ -402,15 +405,15 @@ jobs:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cosign verify-blob \
|
cosign verify-blob \
|
||||||
--certificate checksums.txt.pem \
|
--bundle checksums.txt.sigstore.json \
|
||||||
--signature checksums.txt.sig \
|
|
||||||
--certificate-identity-regexp '^https://github\.com/shankar0123/certctl/\.github/workflows/release\.yml@refs/tags/' \
|
--certificate-identity-regexp '^https://github\.com/shankar0123/certctl/\.github/workflows/release\.yml@refs/tags/' \
|
||||||
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
|
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
|
||||||
checksums.txt
|
checksums.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace `checksums.txt` with any individual binary name to verify that
|
Replace `checksums.txt` with any individual binary name to verify that
|
||||||
artefact directly (each binary ships with its own `.sig` + `.pem` sidecar).
|
artefact directly (each binary ships with its own `.sigstore.json`
|
||||||
|
bundle, e.g. `cosign verify-blob --bundle certctl-agent-linux-amd64.sigstore.json …`).
|
||||||
|
|
||||||
**3. Verify SLSA Level 3 provenance (binaries):**
|
**3. Verify SLSA Level 3 provenance (binaries):**
|
||||||
|
|
||||||
|
|||||||
@@ -260,15 +260,17 @@ sha256sum -c checksums.txt
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cosign verify-blob \
|
cosign verify-blob \
|
||||||
--certificate checksums.txt.pem \
|
--bundle checksums.txt.sigstore.json \
|
||||||
--signature checksums.txt.sig \
|
|
||||||
--certificate-identity-regexp '^https://github\.com/shankar0123/certctl/\.github/workflows/release\.yml@refs/tags/' \
|
--certificate-identity-regexp '^https://github\.com/shankar0123/certctl/\.github/workflows/release\.yml@refs/tags/' \
|
||||||
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
|
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
|
||||||
checksums.txt
|
checksums.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
Every individual binary has its own `.sig` + `.pem` sidecar; swap
|
Every individual binary ships with its own `.sigstore.json` bundle
|
||||||
`checksums.txt` for any binary name to verify it directly.
|
(unified Sigstore bundle containing signature, certificate chain, and
|
||||||
|
Rekor inclusion proof). Swap `checksums.txt` for any binary name and
|
||||||
|
point `--bundle` at the matching `<binary>.sigstore.json` to verify it
|
||||||
|
directly.
|
||||||
|
|
||||||
**3. Verify SLSA Level 3 provenance on a binary:**
|
**3. Verify SLSA Level 3 provenance on a binary:**
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user