This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: sigstore-cosign-keyless-admission-control-standard

Sigstore Cosign Keyless Ephemeral Certificate Admission Control Standard

Enforces cryptographically verifiable, OIDC-bound ephemeral provenance signatures and immutable digest pinning on all container workloads before runtime orchestration. Mandates verifying Fulcio root-of-trust, Rekor transparency log proof of inclusion, and exact workload identity (SAN issuer and subject) within admission webhook pipelines before permitting pod scheduling.

Prohibited Anti-Pattern: Bypassing OIDC Claims Verification, Neglecting Rekor Inclusion Proofs, or Relying on Mutable Tags During Admission

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Sigstore Cosign Keyless Ephemeral Certificate Admission Control Standard - Enforces cryptographically verifiable, OIDC-bound ephemeral provenance signatures and immutable digest pinning on all container workloads before runtime orchestration. Mandates verifying Fulcio root-of-trust, Rekor transparency log proof of inclusion, and exact workload identity (SAN issuer and subject) within admission webhook pipelines before permitting pod scheduling.
globs: **/*admission*.{go,ts,js}, **/*webhook*.{go,ts,js}, **/policies/**/*.{yaml,yml}, **/clusterpolicy*.{yaml,yml}, **/cosign*.{go,ts,js}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/sigstore-cosign-keyless-admission-control-standard"
---

# Sigstore Cosign Keyless Ephemeral Certificate Admission Control Standard

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Bypassing OIDC Claims Verification, Neglecting Rekor Inclusion Proofs, or Relying on Mutable Tags During Admission

## System Constraints
You are a Principal Security Architect enforcing the Sigstore Cosign Keyless Ephemeral Certificate Admission Control Standard. Mandate that every admission control interceptor rigorously verifies cryptographic signatures via Fulcio leaf certificates, enforces Rekor transparency log bundle inclusion, restricts SAN regexes strictly to trusted CI/CD OIDC issuers, and mutates image references to immutable SHA256 digests. Reject any deployment using mutable tags or unpinned root-of-trust certificates.

## Strict Guidelines
- Engineers MUST ALWAYS verify cryptographic signatures against immutable image digests (sha256:...) and reject mutable tags (e.g., :latest, :v1.0.0) without digest resolution.
- Engineers MUST ALWAYS validate the ephemeral X.509 certificate against the trusted Fulcio Root CA and enforce non-empty Rekor transparency log entry inclusion proof.
- Engineers MUST strictly validate the Subject Alternative Name (SAN) and OIDC Issuer extension attributes on the ephemeral certificate to prevent cross-tenant token exploitation.
- Services MUST NOT allow bypass flags or insecure skip-verify settings in admission webhook configurations, even in staging or pre-production environments.
- Mutating webhooks MUST rewrite workload container specifications to use the cryptographic digest identified and verified during admission validation.
- Validating webhooks MUST verify that the certificate validity period aligns with the signed timestamp recorded in the Rekor transparency log.

## Bad vs Good Implementations
### Cosign Keyless Verification in Admission Webhook Handler

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Relies solely on image string prefix checks, skips cryptographic Cosign signature validation, ignores Fulcio certificate verification, and accepts mutable tags susceptible to TOCTOU attacks.
```typescript
import { Request, Response } from 'express';

interface AdmissionReview {
  request: {
    uid: string;
    object: { spec: { containers: Array<{ image: string }> } };
  };
}

export async function handleAdmission(req: Request, res: Response): Promise<void> {
  const admissionRequest = req.body as AdmissionReview;
  const containers = admissionRequest.request.object.spec.containers;

  for (const container of containers) {
    // Flaw: Allows mutable tags without resolving to immutable digest
    // Flaw: Skips Rekor log verification and leaves OIDC issuer open
    if (container.image.startsWith('internal-registry.corp/')) {
      continue;
    }
    res.status(200).json({
      response: {
        uid: admissionRequest.request.uid,
        allowed: false,
        status: { message: 'Image rejected: untrusted source' },
      },
    });
    return;
  }

  res.status(200).json({ response: { uid: admissionRequest.request.uid, allowed: true } });
}
```

#### Production Standard (Correct)
> **Standard**: Enforces immutable sha256 digest validation, performs Fulcio keyless certificate verification, checks Rekor transparency log inclusion proofs, and asserts strict OIDC SAN subject and issuer constraints.
```typescript
import { Request, Response } from 'express';
import { verifyKeylessSignature, FulcioRoots, RekorClient } from '@sigstore/verify';

interface AdmissionReview {
  request: {
    uid: string;
    object: { spec: { containers: Array<{ image: string; name: string }> } };
  };
}

const DIGEST_REGEX = /^.+@sha256:[a-f0-9]{64}$/;
const EXPECTED_ISSUER = 'https://token.actions.githubusercontent.com';
const EXPECTED_SAN_REGEX = /^https:\/\/github\.com\/org-trusted-root\/[a-zA-Z0-9_-]+\/\.github\/workflows\/release\.yml@refs\/heads\/main$/;

export async function handleAdmission(req: Request, res: Response): Promise<void> {
  const admissionRequest = req.body as AdmissionReview;
  const containers = admissionRequest.request.object.spec.containers;

  for (const container of containers) {
    if (!DIGEST_REGEX.test(container.image)) {
      res.status(200).json({
        response: {
          uid: admissionRequest.request.uid,
          allowed: false,
          status: { message: `Image ${container.image} must be pinned to an immutable @sha256 digest` },
        },
      });
      return;
    }

    const verificationResult = await verifyKeylessSignature({
      imageReference: container.image,
      certificateIssuer: EXPECTED_ISSUER,
      certificateIdentityRegex: EXPECTED_SAN_REGEX,
      requireRekorEntry: true,
      trustedRoots: FulcioRoots.getProductionPool(),
      rekorClient: new RekorClient({ timeoutMs: 5000 }),
    });

    if (!verificationResult.verified) {
      res.status(200).json({
        response: {
          uid: admissionRequest.request.uid,
          allowed: false,
          status: { message: `Cosign verification failed for ${container.image}: ${verificationResult.error}` },
        },
      });
      return;
    }
  }

  res.status(200).json({ response: { uid: admissionRequest.request.uid, allowed: true } });
}
```

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Sigstore Cosign Keyless Ephemeral Certificate Admission Control Standard

Sigstore Cosign Keyless Ephemeral Certificate Admission Control Standard defines an industrial-grade behavioral standard for security engineering. Enforces cryptographically verifiable, OIDC-bound ephemeral provenance signatures and immutable digest pinning on all container workloads before runtime orchestration. Mandates verifying Fulcio root-of-trust, Rekor transparency log proof of inclusion, and exact workload identity (SAN issuer and subject) within admission webhook pipelines before permitting pod scheduling. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Bypassing OIDC Claims Verification, Neglecting Rekor Inclusion Proofs, or Relying on Mutable Tags During Admission Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftBypassing OIDC Claims Verification, Neglecting Rekor Inclusion Proofs, or Relying on Mutable Tags During AdmissionCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Engineers MUST ALWAYS verify cryptographic signatures against immutable image digests (sha256

Engineers MUST ALWAYS verify cryptographic signatures against immutable image digests (sha256:...) and reject mutable tags (e.g., :latest, :v1.0.0) without digest resolution.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Engineers MUST ALWAYS validate the ephemeral X.509 certificate against the trusted Fulcio Root CA and enforce non-empty Rekor transparency log entry inclusion proof.

Engineers MUST ALWAYS validate the ephemeral X.509 certificate against the trusted Fulcio Root CA and enforce non-empty Rekor transparency log entry inclusion proof.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Engineers MUST strictly validate the Subject Alternative Name (SAN) and OIDC Issuer extension attributes on the ephemeral certificate to prevent cross-tenant token exploitation.

Engineers MUST strictly validate the Subject Alternative Name (SAN) and OIDC Issuer extension attributes on the ephemeral certificate to prevent cross-tenant token exploitation.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Services MUST NOT allow bypass flags or insecure skip-verify settings in admission webhook configurations, even in staging or pre-production environments.

Services MUST NOT allow bypass flags or insecure skip-verify settings in admission webhook configurations, even in staging or pre-production environments.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Mutating webhooks MUST rewrite workload container specifications to use the cryptographic digest identified and verified during admission validation.

Mutating webhooks MUST rewrite workload container specifications to use the cryptographic digest identified and verified during admission validation.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
6

Validating webhooks MUST verify that the certificate validity period aligns with the signed timestamp recorded in the Rekor transparency log.

Validating webhooks MUST verify that the certificate validity period aligns with the signed timestamp recorded in the Rekor transparency log.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Sigstore Cosign Keyless Ephemeral Certificate Admission Control Standard critical for AI coding assistants?

Enforces cryptographically verifiable, OIDC-bound ephemeral provenance signatures and immutable digest pinning on all container workloads before runtime orchestration. Mandates verifying Fulcio root-of-trust, Rekor transparency log proof of inclusion, and exact workload identity (SAN issuer and subject) within admission webhook pipelines before permitting pod scheduling. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Bypassing OIDC Claims Verification, Neglecting Rekor Inclusion Proofs, or Relying on Mutable Tags During Admission) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

Sigstore