implementing-image-provenance-verification-with-cosign

Sign and verify container image provenance using Sigstore Cosign with keyless OIDC signing and Kubernetes admission enforcement.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill implementing-image-provenance-verification-with-cosign
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-image-provenance-verification-with-cosign
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/container-security/implementing-image-provenance-verification-with-cosign
Command: npx skills add https://github.com/xalgord/xalgorix --skill implementing-image-provenance-verification-with-cosign

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Container images deployed to Kubernetes often lack cryptographic proof of origin, leaving clusters exposed to unsigned, tampered, or unverified images. This Skill guides you through signing images with Sigstore Cosign, attaching SBOM and SLSA provenance attestations, and enforcing signature verification at cluster admission.

Core Features & Use Cases

  • Key-Based and Keyless Signing: Sign images with local or KMS-stored keys, or use OIDC-based keyless signing via Fulcio and Rekor in CI/CD pipelines like GitHub Actions.
  • Attestations: Attach and verify SBOM (CycloneDX), vulnerability scan, and SLSA provenance attestations on OCI artifacts.
  • Admission Enforcement: Configure Sigstore policy-controller ClusterImagePolicy or Kyverno verifyImages rules to reject unsigned images in Kubernetes.
  • Use Case: A platform team builds images in GitHub Actions, signs them keylessly by digest, attaches an SBOM attestation, and enforces a ClusterImagePolicy so only images signed by their workflows can run in production.

Quick Start

Ask the AI to show how to keylessly sign a container image in GitHub Actions with Cosign and enforce signature verification in Kubernetes using a ClusterImagePolicy.

Frequently Asked Questions about implementing-image-provenance-verification-with-cosign

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sign a container image with Cosign?

Sign a container image with Cosign using either a generated key pair (cosign sign --key cosign.key IMAGE) or keyless OIDC signing (cosign sign IMAGE). Keyless signing uses Fulcio for certificates and records entries in the Rekor transparency log.

How does keyless signing work in GitHub Actions?

Keyless signing in GitHub Actions uses the workflow's OIDC token, requiring the id-token: write permission. Run cosign sign --yes on the image digest after installing Cosign with the sigstore/cosign-installer action.

How do I enforce signed images in Kubernetes?

Enforce signed images in Kubernetes with the Sigstore policy-controller ClusterImagePolicy or a Kyverno ClusterPolicy with verifyImages rules. Set validationFailureAction to Enforce so unsigned pods are rejected at admission.

Why should I verify images by digest instead of tag?

Verifying by tag is vulnerable to tag re-push attacks (TOCTOU), where a tag is moved to a different image after verification. Verify and admit images by their immutable @sha256: digest to guarantee the verified artifact is the one deployed.

How do I attach an SBOM attestation to a container image?

Generate an SBOM with syft in CycloneDX JSON format, then attach it using cosign attest --type cyclonedx --predicate sbom.json IMAGE. Verify it later with cosign verify-attestation using the same type and key.

What are common Cosign verification misconfigurations?

Common issues include verifying in CI without admission enforcement, leaving Kyverno in Audit mode, over-broad certificate identity regexes, and glob patterns that miss mirrored registries. Pin exact certificate identities and OIDC issuers, and confirm unsigned pods are actually rejected.