Image Attestations and Signatures
This document explains the security features provided through image attestations and signatures.
Overview
All images built by this project include comprehensive security attestations:
- SBOM (Software Bill of Materials) - Complete inventory of software components
- Cryptographic Signatures - Verification of image authenticity
- SLSA Provenance - Build process metadata and traceability
These attestations are automatically generated for every image build and stored as OCI artifacts in GitHub Container Registry (GHCR).
Features
SBOM (Software Bill of Materials)
Every image includes a Software Bill of Materials in SPDX format, generated using Trivy:
- Lists all packages and dependencies in the image
- Includes version information for each component
- Helps identify vulnerable dependencies
- Supports supply chain security requirements
Cryptographic Signatures
All images are signed using Cosign with keyless signing:
- Uses GitHub OIDC for identity verification
- No secret key management required
- Signatures stored in GHCR alongside images
- Verifiable by anyone with Cosign installed
SLSA Provenance
Build provenance metadata following SLSA v1.0 specification:
- Workflow and repository information
- Build parameters (registry, namespace, version)
- Build invocation ID and timestamps
- Upstream source material references
- Completeness indicators
Verifying Images
Prerequisites
Install the required tools:
# Install Cosign
brew install cosign
# Or download from https://github.com/sigstore/cosign/releasesVerify Image Signature
Verify that an image was built by this repository:
cosign verify \
--certificate-identity-regexp "https://github.com/this-is-tobi/multiarch-mirror" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/this-is-tobi/mirror/mattermost:10.3.1Successful verification output:
Verification for ghcr.io/this-is-tobi/mirror/mattermost:10.3.1 --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- Existence of the claims in the transparency log was verified offline
- The code-signing certificate was verified using trusted certificate authority certificatesView SBOM
View the Software Bill of Materials:
cosign verify-attestation \
--type spdxjson \
--certificate-identity-regexp "https://github.com/this-is-tobi/multiarch-mirror" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/this-is-tobi/mirror/mattermost:10.3.1 | jq -r .payload | base64 -d | jq .To extract just the package list:
cosign verify-attestation \
--type spdxjson \
--certificate-identity-regexp "https://github.com/this-is-tobi/multiarch-mirror" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/this-is-tobi/mirror/mattermost:10.3.1 | \
jq -r '.payload' | base64 -d | jq '.predicate.packages[] | {name: .name, version: .versionInfo}'View Provenance
View build provenance metadata:
cosign verify-attestation \
--type slsaprovenance \
--certificate-identity-regexp "https://github.com/this-is-tobi/multiarch-mirror" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/this-is-tobi/mirror/mattermost:10.3.1 | jq -r .payload | base64 -d | jq .Implementation Details
Attestation Workflow
For each built image, the attestation process:
Install Tools
- Cosign v3 (via sigstore/cosign-installer@v3)
- Trivy (via aquasecurity/setup-trivy@v0.2.0)
Generate SBOM
- Scan image with Trivy
- Output SPDX JSON format
- Includes all packages and dependencies
Attest SBOM
- Attach SBOM as attestation to version tag
- Attach SBOM to latest tag (if applicable)
- Type:
spdxjson
Sign Images
- Sign version tag with Cosign
- Sign latest tag (if applicable)
- Uses keyless signing with GitHub OIDC
Generate and Attest Provenance
- Create SLSA provenance metadata
- Include build parameters and materials
- Attach to version tag and latest tag (if applicable)
- Type:
slsaprovenance
Storage
All attestations are stored in GHCR as OCI artifacts:
- No external storage required
- Attestations linked to specific image digests
- Accessible via standard OCI registry APIs
- Automatically replicated with images
Permissions
The attestation job requires:
permissions:
contents: read # Read repository content
packages: write # Write to GHCR
id-token: write # OIDC token for keyless signingSecurity Considerations
Keyless Signing
This project uses Cosign's keyless signing mode:
- No private keys to manage - Eliminates key rotation and storage concerns
- GitHub OIDC identity - Signatures tied to GitHub Actions workflow identity
- Public transparency log - All signatures recorded in Rekor (public ledger)
- Certificate-based verification - Uses short-lived certificates from Fulcio CA
Trust Model
When verifying images:
- Trust GitHub's OIDC provider (
token.actions.githubusercontent.com) - Trust the repository identity (
this-is-tobi/multiarch-mirror) - Trust the public transparency log (Rekor)
- Trust the certificate authority (Fulcio)
This eliminates the need to trust any long-lived secrets while maintaining strong cryptographic guarantees.
Supply Chain Security
Attestations enable:
- Dependency tracking - Know exactly what's in your images
- Vulnerability management - Scan SBOMs for known CVEs
- Build reproducibility - Provenance links images to source
- Compliance - Meet regulatory requirements for software transparency
Examples
Verify All Tags for an Application
Verify multiple versions:
for tag in 10.3.1 10.3.0 10.2.1 latest; do
echo "Verifying mattermost:$tag..."
cosign verify \
--certificate-identity-regexp "https://github.com/this-is-tobi/multiarch-mirror" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/this-is-tobi/mirror/mattermost:$tag
doneExtract SBOM to File
Save SBOM for offline analysis:
cosign verify-attestation \
--type spdxjson \
--certificate-identity-regexp "https://github.com/this-is-tobi/multiarch-mirror" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/this-is-tobi/mirror/mattermost:10.3.1 | \
jq -r '.payload' | base64 -d | jq '.predicate' > mattermost-10.3.1-sbom.jsonScan SBOM for Vulnerabilities
Use Trivy to scan the extracted SBOM:
trivy sbom mattermost-10.3.1-sbom.jsonTroubleshooting
Verification Fails
If signature verification fails:
- Check repository identity - Ensure you're using the correct certificate identity regex
- Check image digest - Attestations are linked to specific digests, not tags
- Check network - Verification requires access to transparency log and certificate authority
- Check Cosign version - Use Cosign v2.0 or later
SBOM Not Found
If SBOM attestation is missing:
- Check image build date - Attestations were added on [date], older images won't have them
- Check image source - Only images built by this repository have attestations
- Use correct type - Specify
--type spdxjsonnot--type spdx
Provenance Not Found
If provenance attestation is missing:
- Check attestation type - Use
--type slsaprovenance - Check workflow status - Attestation job may have failed during build
- Check permissions - Ensure GHCR allows reading attestations