Skip to content

Commit 10f0a77

Browse files
feat: add cosign keyless image signing to release workflow
Sign both initium and initium-jyq container images with cosign keyless signing (Sigstore OIDC) after push, and attach signed SBOM attestations. Add make verify-image target and update security docs. Closes #10 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 35e3a15 commit 10f0a77

4 files changed

Lines changed: 49 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
}
2828
env:
2929
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
30+
- uses: sigstore/cosign-installer@v3
3031
- uses: docker/setup-qemu-action@v3
3132
- uses: docker/setup-buildx-action@v3
3233
- uses: docker/login-action@v3
@@ -51,6 +52,13 @@ jobs:
5152
cache-to: type=gha,mode=max,scope=docker-main
5253
sbom: true
5354
provenance: true
55+
- name: Sign initium image
56+
run: |
57+
cosign sign --yes ghcr.io/kitstream/initium:${{ steps.version.outputs.VERSION }}
58+
cosign sign --yes ghcr.io/kitstream/initium:latest
59+
- name: SBOM attestation for initium image
60+
run: |
61+
cosign attest --yes --predicate <(docker buildx imagetools inspect ghcr.io/kitstream/initium:${{ steps.version.outputs.VERSION }} --format '{{json .SBOM.SPDX}}') --type spdx ghcr.io/kitstream/initium:${{ steps.version.outputs.VERSION }}
5462
- uses: docker/build-push-action@v6
5563
with:
5664
context: .
@@ -66,3 +74,10 @@ jobs:
6674
cache-to: type=gha,mode=max,scope=docker-jyq
6775
sbom: true
6876
provenance: true
77+
- name: Sign initium-jyq image
78+
run: |
79+
cosign sign --yes ghcr.io/kitstream/initium-jyq:${{ steps.version.outputs.VERSION }}
80+
cosign sign --yes ghcr.io/kitstream/initium-jyq:latest
81+
- name: SBOM attestation for initium-jyq image
82+
run: |
83+
cosign attest --yes --predicate <(docker buildx imagetools inspect ghcr.io/kitstream/initium-jyq:${{ steps.version.outputs.VERSION }} --format '{{json .SBOM.SPDX}}') --type spdx ghcr.io/kitstream/initium-jyq:${{ steps.version.outputs.VERSION }}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Security
11+
12+
- Cosign keyless image signing in release workflow for both `initium` and `initium-jyq` container images. Images are signed using Sigstore OIDC via GitHub Actions. SBOM attestations are also signed and attached to each image.
13+
- Added `make verify-image` target to verify cosign signatures locally.
14+
1015
### Added
1116

1217
- `urlencode` template filter for percent-encoding strings in URLs. Useful for embedding passwords or other values containing URL-reserved characters (`@`, `%`, `:`, `/`, etc.) in connection strings.

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BINARY := initium
22
VERSION ?= dev
3-
.PHONY: all build test lint clean
3+
.PHONY: all build test lint clean verify-image
44
all: lint test build
55
build:
66
cargo build --release
@@ -17,3 +17,5 @@ docker-build:
1717
docker build -t ghcr.io/kitstream/initium:$(VERSION) .
1818
docker-push:
1919
docker push ghcr.io/kitstream/initium:$(VERSION)
20+
verify-image:
21+
cosign verify --certificate-oidc-issuer https://token.actions.githubusercontent.com --certificate-identity-regexp '^https://github\.com/KitStream/initium/' ghcr.io/kitstream/initium:$(VERSION)

docs/security.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,36 @@ If your cluster still uses PSPs, the same security context fields apply. Initium
7878

7979
## Image Verification
8080

81-
Release images include SBOM and provenance attestations generated by GitHub Actions with `id-token: write` permissions:
81+
Release images are signed with [cosign](https://github.com/sigstore/cosign) using keyless signing (Sigstore OIDC via GitHub Actions). SBOM and provenance attestations are also signed and attached to each image.
82+
83+
### Verify image signature
84+
85+
```bash
86+
# Verify signature (requires cosign)
87+
cosign verify \
88+
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
89+
--certificate-identity-regexp '^https://github\.com/KitStream/initium/' \
90+
ghcr.io/kitstream/initium:latest
91+
92+
# Or use the Makefile target
93+
make verify-image VERSION=latest
94+
```
95+
96+
### Verify attestations
8297

8398
```bash
84-
# Verify provenance (requires cosign)
99+
# Verify provenance
85100
cosign verify-attestation \
86101
--type https://slsa.dev/provenance/v0.2 \
102+
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
103+
--certificate-identity-regexp '^https://github\.com/KitStream/initium/' \
104+
ghcr.io/kitstream/initium:latest
105+
106+
# Verify SBOM attestation
107+
cosign verify-attestation \
108+
--type spdx \
109+
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
110+
--certificate-identity-regexp '^https://github\.com/KitStream/initium/' \
87111
ghcr.io/kitstream/initium:latest
88112
89113
# View SBOM

0 commit comments

Comments
 (0)