- Keyless Image Signing: Sign OCI container images in CI/CD using OIDC identity tokens (Fulcio CA) without managing private keys.
- Immutable Transparency Log: Record signature metadata in the public Rekor transparency log to prevent signature tampering.
- SLSA Provenance Attestation: Attach cryptographically signed SLSA build provenance attestations to container images.
- Kyverno Policy Enforcement: Block un-signed or non-compliant container images from running in Kubernetes clusters.
1. Software Supply Chain Risks & Container Image Signing
Container registries (Docker Hub, GHCR) store execution binaries for enterprise applications. If an attacker compromises CI/CD credentials or registry access, they can replace legitimate container tags with malicious images containing backdoors.
Sigstore Cosign eliminates supply chain tampering by cryptographically signing OCI container images during the CI/CD build process.
Using keyless signing powered by Fulcio (certificate authority) and Rekor (transparency log), Cosign binds OIDC identities (e.g., GitHub Actions workflow identity) to container digests without long-lived private keys.
This ensures that container images running in Kubernetes can be traced back to exact GitHub workflow runs.
Keyless signing eliminates the security liability of storing long-lived signing keys in CI/CD secrets.
Cryptographic digest binding guarantees that tag overwrite attacks are detected immediately by container runtimes.
Implementing automated continuous monitoring across production nodes ensures that compliance policies remain enforced during infrastructure updates.
Regular security audits should be integrated into DevOps CI/CD pipelines to verify that system configurations conform to zero-trust architecture standards.
Documenting system architecture and access control rules facilitates compliance verification during independent third-party security audits.
Enforcing strict runtime isolation boundaries prevents privilege escalation vectors across multi-tenant cloud environments.
# GitHub Actions Workflow: Keyless Cosign Image Signing
- name: Install Cosign
uses: sigstore/[email protected]
- name: Sign Container Image Keylessly
run: |
cosign sign --yes ghcr.io/zyekh/secure-api:v2.0.0@${{ steps.build.outputs.digest }}
2. Attesting SLSA Provenance & SBOM Materials
Beyond image signing, modern supply chain compliance requires SLSA (Supply-chain Levels for Software Artifacts) build provenance attestations.
Cosign attaches signed SBOM (Software Bill of Materials) and SLSA provenance attestations directly to the target OCI image registry entry.
Downstream security scanners inspect attached SBOM attestations to detect vulnerable packages automatically.
Attestations are cryptographically bound to container image SHA-256 digests, preventing tamper attempts.
Signing build provenance matrices ensures compliance with federal cybersecurity executive orders.
Implementing automated continuous monitoring across production nodes ensures that compliance policies remain enforced during infrastructure updates.
Regular security audits should be integrated into DevOps CI/CD pipelines to verify that system configurations conform to zero-trust architecture standards.
Documenting system architecture and access control rules facilitates compliance verification during independent third-party security audits.
Enforcing strict runtime isolation boundaries prevents privilege escalation vectors across multi-tenant cloud environments.
# Generate and Attach Signed SBOM Attestation
cosign attest --yes --predicate sbom.spdx.json \
--type spdx ghcr.io/zyekh/secure-api:v2.0.0
# Verify Container Image Signature Keylessly
cosign verify \
--certificate-identity "https://github.com/zyekhabdul/zyekh.com/.github/workflows/deploy.yml@refs/heads/main" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/zyekh/secure-api:v2.0.0
3. Enforcing Signature Verification in Kubernetes with Kyverno
Deploy Kyverno admission controller policies in Kubernetes to automatically reject any pod deployment requesting un-signed container images.
Kyverno checks Cosign signatures in real-time before container pods are scheduled to worker nodes.
Policy rules enforce exact OIDC issuer and repository match criteria.
Cluster-wide signature validation ensures un-signed images cannot run in production or staging namespaces.
Implementing automated continuous monitoring across production nodes ensures that compliance policies remain enforced during infrastructure updates.
Regular security audits should be integrated into DevOps CI/CD pipelines to verify that system configurations conform to zero-trust architecture standards.
Documenting system architecture and access control rules facilitates compliance verification during independent third-party security audits.
Enforcing strict runtime isolation boundaries prevents privilege escalation vectors across multi-tenant cloud environments.
# Kyverno ClusterPolicy: Enforce Cosign Image Signature Verification
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: verify-image-signature
spec:
validationFailureAction: Enforce
rules:
- name: verify-signature
match:
any:
- resources:
kinds:
- Pod
verifyImages:
- imageReferences:
- "ghcr.io/zyekh/*"
attestors:
- count: 1
entries:
- keyless:
issuer: "https://token.actions.githubusercontent.com"
subject: "https://github.com/zyekhabdul/zyekh.com/*"
4. Verification & Supply Chain Audit Checklist
Audit container signatures and Rekor transparency log entries using Cosign CLI.
Verify that attestation signatures match public OIDC issuer identities.
Incorporate container image verification checks into git commit hooks and staging deployment workflows.
Regularly audit Rekor transparency log hashes to confirm signature provenance integrity.
Implementing automated continuous monitoring across production nodes ensures that compliance policies remain enforced during infrastructure updates.
Regular security audits should be integrated into DevOps CI/CD pipelines to verify that system configurations conform to zero-trust architecture standards.
Documenting system architecture and access control rules facilitates compliance verification during independent third-party security audits.
Enforcing strict runtime isolation boundaries prevents privilege escalation vectors across multi-tenant cloud environments.
# Verify Rekor transparency log entry
cosign verify-attestation --type spdx ghcr.io/zyekh/secure-api:v2.0.0
# Inspect raw signature payload
crane manifest ghcr.io/zyekh/secure-api:sha256-signature
Frequently Asked Questions (FAQ)
What is keyless signing in Sigstore Cosign?
Keyless signing generates ephemeral key pairs valid for minutes, using OIDC identity tokens (Fulcio CA) and recording signatures in a public transparency log (Rekor).
Does image signing slow down container deployment in Kubernetes?
No. Kyverno and Gatekeeper verify public key signatures in cached memory during admission control in milliseconds.
Utility Security Tools Related to this Article:
Gunakan Hash Generator dan JSON Validator & Formatter untuk membantu alur kerja konfigurasi keamanan Anda secara privasi di browser.