implementing-image-provenance-verification-with-cosign
Sign and verify container image provenance using Sigstore Cosign with keyless OIDC-based signing, attestations, and Kubernetes admission enforcement.
Works with
0
total installs
0
this week
8.6K
GitHub stars
0
upvotes
Install Skill
Run in your terminal
0
installs
0
this week
8.6K
stars
Installation Guide
How to use implementing-image-provenance-verification-with-cosign on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your machine
- ›Node.js 16+ with npm — verify with
node --version - ›Active project directory where you want to add
implementing-image-provenance-verification-with-cosign
Run the install command
Execute the skills CLI command in your project's root directory to begin installation:
Fetches implementing-image-provenance-verification-with-cosign from mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.
Select Cursor when prompted
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate implementing-image-provenance-verification-with-cosign. Access via /implementing-image-provenance-verification-with-cosign in your agent's command palette.
Security Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Documentation
| name | implementing-image-provenance-verification-with-cosign |
| description | Sign and verify container image provenance using Sigstore Cosign with keyless OIDC-based signing, attestations, and Kubernetes admission enforcement. |
| domain | cybersecurity |
| subdomain | container-security |
| tags | - cosign - sigstore - image-signing - supply-chain - provenance - keyless - slsa |
| version | '1.0' |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | - PR.PS-01 - PR.IR-01 - ID.AM-08 - DE.CM-01 |
Implementing Image Provenance Verification with Cosign
Overview
Cosign is a Sigstore tool for signing, verifying, and attaching metadata to container images and OCI artifacts. It supports both key-based and keyless (OIDC) signing, integrates with Fulcio (certificate authority) and Rekor (transparency log), and enables supply chain security for container images.
When to Use
- When deploying or configuring implementing image provenance verification with cosign capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation
Prerequisites
- Cosign CLI installed
- Docker or Podman for building images
- OCI-compliant container registry (Docker Hub, GHCR, GCR, ECR)
- OIDC provider account (GitHub, Google, Microsoft) for keyless signing
Installing Cosign
# Install via Go
go install github.com/sigstore/cosign/v2/cmd/cosign@latest
# Install via Homebrew
brew install cosign
# Install via script
curl -O -L "https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64"
sudo mv cosign-linux-amd64 /usr/local/bin/cosign
sudo chmod +x /usr/local/bin/cosign
# Verify installation
cosign version
Key-Based Signing
Generate Key Pair
# Generate cosign key pair (creates cosign.key and cosign.pub)
cosign generate-key-pair
# Generate key pair stored in KMS
cosign generate-key-pair --kms awskms:///alias/cosign-key
cosign generate-key-pair --kms gcpkms://projects/PROJECT/locations/LOCATION/keyRings/KEYRING/cryptoKeys/KEY
cosign generate-key-pair --kms hashivault://transit/keys/cosign
Sign Image with Key
# Sign an image
cosign sign --key cosign.key ghcr.io/myorg/myapp:v1.0.0
# Sign with annotations
cosign sign --key cosign.key \
-a "build-id=12345" \
-a "git-sha=$(git rev-parse HEAD)" \
ghcr.io/myorg/myapp:v1.0.0
Verify Image with Key
# Verify signature
cosign verify --key cosign.pub ghcr.io/myorg/myapp:v1.0.0
# Verify with annotation check
cosign verify --key cosign.pub \
-a "build-id=12345" \
ghcr.io/myorg/myapp:v1.0.0
Keyless Signing (OIDC)
Sign with Keyless (Interactive)
# Keyless sign - opens browser for OIDC auth
cosign sign ghcr.io/myorg/myapp:v1.0.0
# The signature, certificate, and Rekor entry are created automatically
Sign with Keyless (CI/CD - Non-Interactive)
# GitHub Actions (uses OIDC token automatically)
cosign sign ghcr.io/myorg/myapp:v1.0.0 \
--yes
# With explicit identity token
cosign sign ghcr.io/myorg/myapp:v1.0.0 \
--identity-token=$(cat /var/run/sigstore/cosign/oidc-token) \
--yes
Verify Keyless Signature
# Verify by email identity
cosign verify ghcr.io/myorg/myapp:v1.0.0 \
[email protected] \
--certificate-oidc-issuer=https://accounts.google.com
# Verify by GitHub Actions workflow
cosign verify ghcr.io/myorg/myapp:v1.0.0 \
--certificate-identity=https://github.com/myorg/myrepo/.github/workflows/build.yml@refs/heads/main \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com
# Verify with regex matching
cosign verify ghcr.io/myorg/myapp:v1.0.0 \
--certificate-identity-regexp=".*@example.com" \
--certificate-oidc-issuer=https://accounts.google.com
Attestations (SLSA Provenance)
Attach SBOM Attestation
# Generate SBOM
syft ghcr.io/myorg/myapp:v1.0.0 -o cyclonedx-json > sbom.cdx.json
# Attach SBOM as attestation
cosign attest --key cosign.key \
--type cyclonedx \
--predicate sbom.cdx.json \
ghcr.io/myorg/myapp:v1.0.0
# Verify attestation
cosign verify-attestation --key cosign.pub \
--type cyclonedx \
ghcr.io/myorg/myapp:v1.0.0
Attach Vulnerability Scan Attestation
# Run scan and save results
grype ghcr.io/myorg/myapp:v1.0.0 -o json > vuln-scan.json
# Attach scan results as attestation
cosign attest --key cosign.key \
--type vuln \
--predicate vuln-scan.json \
ghcr.io/myorg/myapp:v1.0.0
SLSA Provenance Attestation
# Attach SLSA provenance
cosign attest --key cosign.key \
--type slsaprovenance \
--predicate provenance.json \
ghcr.io/myorg/myapp:v1.0.0
# Verify SLSA provenance
cosign verify-attestation --key cosign.pub \
--type slsaprovenance \
ghcr.io/myorg/myapp:v1.0.0
CI/CD Integration
GitHub Actions
name: Sign and Publish
on:
push:
tags: ['v*']
permissions:
contents: read
packages: write
id-token: write # Required for keyless signing
jobs:
build-sign:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
- name: Sign image (keyless)
run: |
cosign sign --yes \
ghcr.io/${{ github.repository }}@${{ steps.build.outputs.digest }}
- name: Generate and attach SBOM
run: |
syft ghcr.io/${{ github.repository }}@${{ steps.build.outputs.digest }} -o cyclonedx-json > sbom.json
cosign attest --yes \
--type cyclonedx \
--predicate sbom.json \
ghcr.io/${{ github.repository }}@${{ steps.build.outputs.digest }}
Kubernetes Admission Enforcement
Policy Controller (Sigstore)
# Install policy-controller
helm repo add sigstore https://sigstore.github.io/helm-charts
helm install policy-controller sigstore/policy-controller \
--namespace cosign-system --create-namespace
# Enforce signed images in namespace
apiVersion: policy.sigstore.dev/v1beta1
kind: ClusterImagePolicy
metadata:
name: require-signed-images
spec:
images:
- glob: "ghcr.io/myorg/**"
authorities:
- keyless:
url: https://fulcio.sigstore.dev
identities:
- issuer: https://token.actions.githubusercontent.com
subjectRegExp: "https://github.com/myorg/.*"
ctlog:
url: https://rekor.sigstore.dev
Kyverno Integration
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: verify-image-signature
spec:
validationFailureAction: Enforce
rules:
- name: verify-cosign-signature
match:
any:
- resources:
kinds: ["Pod"]
verifyImages:
- imageReferences:
- "ghcr.io/myorg/*"
attestors:
- entries:
- keyless:
subject: "https://github.com/myorg/*"
issuer: "https://token.actions.githubusercontent.com"
rekor:
url: https://rekor.sigstore.dev
Transparency Log (Rekor)
# Search Rekor for image signatures
rekor-cli search --email [email protected]
# Get specific entry
rekor-cli get --uuid <entry-uuid>
# Verify entry inclusion
cosign verify ghcr.io/myorg/myapp:v1.0.0 \
[email protected] \
--certificate-oidc-issuer=https://accounts.google.com
Best Practices
- Use keyless signing in CI/CD for automated pipelines
- Sign by digest not by tag for immutable references
- Attach SBOM attestations alongside signatures
- Enforce signatures at admission with policy-controller or Kyverno
- Use OIDC identity verification instead of just key verification
- Store keys in KMS (AWS KMS, GCP KMS, HashiCorp Vault) for key-based signing
- Verify the full chain: signature + certificate + Rekor inclusion
- Include build metadata as annotations on signatures
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Steps
- 1Install skill using provided installation command
- 2Test with simple use case relevant to your work
- 3Evaluate output quality and relevance
- 4Iterate on prompts to improve results
- 5Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Related Skills
scanning-container-images-with-grype
1mukul975/Anthropic-Cybersecurity-Skills
performing-cryptographic-audit-of-application
5mukul975/Anthropic-Cybersecurity-Skills
implementing-soar-playbook-with-palo-alto-xsoar
3mukul975/Anthropic-Cybersecurity-Skills
exploiting-deeplink-vulnerabilities
3mukul975/Anthropic-Cybersecurity-Skills
generating-threat-intelligence-reports
2mukul975/Anthropic-Cybersecurity-Skills
scanning-docker-images-with-trivy
2mukul975/Anthropic-Cybersecurity-Skills
Reviews
- LLayla Zhang★★★★★Dec 28, 2024
We added implementing-image-provenance-verification-with-cosign from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- AAanya Rao★★★★★Dec 28, 2024
Keeps context tight: implementing-image-provenance-verification-with-cosign is the kind of skill you can hand to a new teammate without a long onboarding doc.
- PPratham Ware★★★★★Dec 24, 2024
Useful defaults in implementing-image-provenance-verification-with-cosign — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- AAanya Huang★★★★★Dec 12, 2024
I recommend implementing-image-provenance-verification-with-cosign for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- LLayla Malhotra★★★★★Dec 8, 2024
Solid pick for teams standardizing on skills: implementing-image-provenance-verification-with-cosign is focused, and the summary matches what you get after install.
- LLayla Perez★★★★★Dec 4, 2024
Registry listing for implementing-image-provenance-verification-with-cosign matched our evaluation — installs cleanly and behaves as described in the markdown.
- YYusuf Dixit★★★★★Nov 27, 2024
Useful defaults in implementing-image-provenance-verification-with-cosign — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- LLayla Chawla★★★★★Nov 27, 2024
implementing-image-provenance-verification-with-cosign is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- AAditi Taylor★★★★★Nov 23, 2024
implementing-image-provenance-verification-with-cosign fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- YYuki Khan★★★★★Nov 19, 2024
implementing-image-provenance-verification-with-cosign reduced setup friction for our internal harness; good balance of opinion and flexibility.
showing 1-10 of 64
Discussion
Comments — not star reviews- No comments yet — start the thread.