Cosign Keyless Image Admission Verification Prompt
Gate Kubernetes admission on Sigstore cosign signatures and attestations — keyless OIDC signing, policy on issuer/identity, and a fail-closed verifyImages rollout that blocks unsigned images.
- Target user
- Platform and supply-chain security engineers enforcing signed-image policy
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a supply-chain security engineer who has enforced "only signed images run here" in production clusters using Sigstore cosign and admission policy — without locking the cluster out on day one. I will provide: - My signer (cosign keyless via GitHub Actions / GitLab / other OIDC issuer, or KMS keys) - My admission tool (Kyverno verifyImages, Sigstore policy-controller, or Connaisseur) - The registries and namespaces in scope - What I sign today (images? SBOM/provenance attestations?) Your job — DEFENSIVE supply-chain enforcement only: 1. **Decide keyless vs key-based.** Recommend keyless OIDC (Fulcio cert + Rekor transparency log) for CI-built images and explain the trust model: you verify the OIDC *issuer* and *subject identity*, not a long-lived key. Note when KMS keys still make sense. 2. **Define the verification policy.** Write the admission policy (e.g., Kyverno `verifyImages` or policy-controller `ClusterImagePolicy`) that requires a valid cosign signature AND pins the expected `issuer` (e.g., `https://token.actions.githubusercontent.com`) and `subject`/identity regexp (e.g., the exact workflow ref). A signature from the wrong identity must FAIL. 3. **Attestations, not just signatures.** Show how to additionally require a verified SLSA provenance and/or SBOM attestation (`predicateType`), so we prove *how* the image was built, not only that someone signed it. 4. **Fail-closed, rolled out safely.** Start in Audit, identify every running image that wouldn't pass, get those signed, THEN flip to Enforce per namespace. Explain how to avoid bricking system images (exempt registries, sign or allow-list base/operator images). 5. **The signing side** — the cosign CI step for keyless signing with OIDC, signing the SBOM/provenance, and confirming the Rekor entry. Ensure CI has the right `id-token` permission. 6. **Break-glass & key compromise** — documented procedure to temporarily allow an unsigned image, and what to do if a signing identity is compromised (rotate identity, tighten subject regexp, audit Rekor). 7. **Validation** — prove an unsigned and a wrong-identity image are both rejected; prove a correctly signed image passes. Output: (a) the admission policy with issuer/identity pinning, (b) the cosign signing + attestation CI step, (c) an Audit→Enforce rollout checklist, (d) system-image exemption strategy, (e) break-glass procedure, (f) negative + positive test cases. Bias toward: identity-pinned verification, attestations over bare signatures, fail-closed after Audit.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Cosign Bundle Air-Gapped Verification Prompt
Design offline Sigstore verification using cosign bundles and a mirrored trust root so signed images verify in air-gapped clusters with no reachout to Rekor or Fulcio.
-
Kyverno Admission Policy Design Prompt
Design, validate, and roll out Kyverno policies for Kubernetes admission control — validate, mutate, generate, and verifyImages — with Audit-first rollout and CEL where it fits.
-
SBOM & Sigstore Supply-Chain Verification Prompt
Stand up artifact provenance and signature verification — generate SBOMs, sign with Sigstore/cosign, attach SLSA provenance, and enforce admission policies that reject unsigned or untrusted builds.
-
GraphQL API Security Hardening Review Prompt
Review a GraphQL API for the abuse vectors unique to the query model — unbounded depth, introspection exposure, batching amplification, and field-level authorization gaps — and get a hardened schema and gateway config.
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.