cloud-platform-skills / skills
Cursor rule1 starsChanged 4 months agoMITView on GitHub
Software supply chain security: keyless Sigstore/cosign signing with OIDC, SLSA build levels, in-toto provenance attestations, SBOM attestation, and signature plus identity verification enforced at Kubernetes admission with Kyverno or the sigstore policy-controller. Use when release artifacts or container images need signing, provenance or attestation, when a customer or auditor asks which SLSA level a build meets, or when only trusted and verified images should be allowed to run in a cluster.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,523 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository167 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/rules/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-index.mdcCursor rule
- .cursor/rules/skills/ai-agent-security-llm-threats.mdcCursor rule
- .cursor/rules/skills/api-gateway-service-mesh.mdcCursor rule
- .cursor/rules/skills/aws-cloud-migration-strategies.mdcCursor rule
- .cursor/rules/skills/aws-eks-enterprise-patterns.mdcCursor rule
- .cursor/rules/skills/aws-iam-zero-trust-policies.mdcCursor rule
- .cursor/rules/skills/azure-aks-enterprise-landing-zones.mdcCursor rule
- .cursor/rules/skills/azure-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/backup-and-disaster-recovery.mdcCursor rule
- .cursor/rules/skills/chaos-engineering-resilience-testing.mdcCursor rule
- .cursor/rules/skills/cicd-pipeline-design.mdcCursor rule
- .cursor/rules/skills/cloud-native-microservices-patterns.mdcCursor rule
- .cursor/rules/skills/cloud-security-posture-cspm-cis.mdcCursor rule
- .cursor/rules/skills/configuration-management-ansible.mdcCursor rule
- .cursor/rules/skills/container-runtime-security-falco.mdcCursor rule
- .cursor/rules/skills/database-devops-lifecycle.mdcCursor rule
- .cursor/rules/skills/detection-engineering-threat-hunting.mdcCursor rule
- .cursor/rules/skills/devops-metrics-dora-kpis.mdcCursor rule
- .cursor/rules/skills/docker-containerization-basics.mdcCursor rule
- .cursor/rules/skills/enterprise-iac-governance-terragrunt.mdcCursor rule
- .cursor/rules/skills/finops-framework-inform-optimize-operate.mdcCursor rule
- .cursor/rules/skills/gcp-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/gcp-gke-autopilot-multi-tenant.mdcCursor rule
- .cursor/rules/skills/git-branching-merge-strategies.mdcCursor rule
- .cursor/rules/skills/gitops-multi-cluster-argo-flux.mdcCursor rule
- .cursor/rules/skills/helm-kubernetes-deployment.mdcCursor rule
- .cursor/rules/skills/incident-management-and-postmortem.mdcCursor rule
- .cursor/rules/skills/infrastructure-host-monitoring.mdcCursor rule
- .cursor/rules/skills/internal-developer-portal-backstage.mdcCursor rule
- .cursor/rules/skills/linux-sysadmin-troubleshooting.mdcCursor rule
- .cursor/rules/skills/performance-load-testing.mdcCursor rule
- .cursor/rules/skills/policy-as-code-opa-kyverno.mdcCursor rule
- .cursor/rules/skills/prometheus-grafana-otel-tracing.mdcCursor rule
- .cursor/rules/skills/scalability-high-availability-patterns.mdcCursor rule
- .cursor/rules/skills/scripting-and-automation.mdcCursor rule
- .cursor/rules/skills/secops-incident-triage-forensics.mdcCursor rule
- .cursor/rules/skills/secrets-management-vault-kms.mdcCursor rule
- .cursor/rules/skills/serverless-event-driven-architecture.mdcCursor rule
- .cursor/rules/skills/shift-left-security-sast-sca.mdcCursor rule
- .cursor/rules/skills/sli-slo-error-budget-design.mdcCursor rule
- .cursor/rules/skills/terraform-iac-modules.mdcCursor rule
- .cursor/rules/skills/write-a-skill.mdcCursor rule
- .cursor/rules/skills/zero-downtime-release-strategies.mdcCursor rule
- ai-agent-security-llm-threatsSkill
- api-gateway-service-meshSkill
- aws-cloud-migration-strategiesSkill
- aws-eks-enterprise-patternsSkill
- aws-iam-zero-trust-policiesSkill
- azure-aks-enterprise-landing-zonesSkill
- azure-cloud-engineering-patternsSkill
- backup-and-disaster-recoverySkill
- chaos-engineering-resilience-testingSkill
- cicd-pipeline-designSkill
- cloud-native-microservices-patternsSkill
- cloud-security-posture-cspm-cisSkill
- configuration-management-ansibleSkill
- The first 60 shown.
The file
We split this supply-chain-security-slsa-sigstore.mdc into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Only images with verified provenance should be admitted to a cluster
- Distinctive: line 177
Store a cosign private key in CI secrets: when keyless works. A stored key is a key that leaks, and it cannot be revoked without re-signing …
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: "Software supply chain security: keyless Sigstore/cosign signing with OIDC, SLSA build levels, in-toto provenance attestations, SBOM attestation, and signature plus identity verification enforced at Kubernetes admission with Kyverno or the sigstore policy-controller. Use when release artifacts or container images need signing, provenance or attestation, when a customer or auditor asks which SLSA level a build meets, or when only trusted and verified images should be allowed to run in a cluster."
globs:
alwaysApply: false
---
# Software Supply Chain Security: SLSA, Sigstore, and Attestation
## When to Use This Skill
**Triggers — load this skill when:**
- Container images or release artifacts must be signed, and consumers must verify them
- A customer, auditor, or internal standard asks what SLSA level the build pipeline meets
- Only images with verified provenance should be admitted to a cluster
- An SBOM exists but nothing proves it describes the artifact actually deployed
**Route elsewhere when:**
- Choosing and tuning scanners, or generating the SBOM itself -> `shift-left-security-sast-sca`
- General pipeline structure, caching, OIDC cloud auth -> `cicd-pipeline-design`
- Runtime detection after a workload is already running -> `container-runtime-security-falco`
- Cluster-wide policy authoring beyond image verification -> `policy-as-code-opa-kyverno`
## 1. Sign in CI with keyless OIDC — never a long-lived key
Keyless signing exchanges the workflow's OIDC token for a short-lived Fulcio certificate. There is
no private key to store, rotate, or leak.
```yaml
# .github/workflows/release.yml
permissions:
contents: read
packages: write
id-token: write # REQUIRED: without it, keyless signing cannot mint an OIDC token
attestations: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build and push by digest
id: build
uses: docker/build-push-action@v7
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
- uses: sigstore/cosign-installer@v4
# Sign the DIGEST, never the tag. A tag is a mutable pointer: signing
# `:v1.4.0` signs whatever that tag meant at signing time, and an attacker
# who can move the tag inherits a valid signature.
- name: Sign the image
env:
DIGEST: ${{ steps.build.outputs.digest }}
run: cosign sign --yes "ghcr.io/${{ github.repository }}@${DIGEST}"
# SLSA provenance: what built this, from which source, with which inputs.
- name: Attest build provenance
uses: actions/attest-build-provenance@v4
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true
# Bind the SBOM to the artifact. An unattested SBOM is an unsigned claim.
- name: Attest the SBOM
env:
DIGEST: ${{ steps.build.outputs.digest }}
run: |
cosign attest --yes --type cyclonedx \
--predicate sbom.cdx.json \
"ghcr.io/${{ github.repository }}@${DIGEST}"
```
## 2. Verification must pin identity, not just check a signature
This is the single most common way image verification is deployed and provides no security at all:
```bash
# WRONG — passes for ANY certificate Fulcio ever issued, to anyone.
cosign verify ghcr.io/acme/api@sha256:abc...
# CORRECT — the signature must come from THIS workflow, via THIS issuer.
cosign verify \
--certificate-identity-regexp '^https://github\.com/acme/api/\.github/workflows/release\.yml@refs/tags/v.*$' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/acme/api@sha256:abc...
# Verify provenance and read what it claims about the build
gh attestation verify oci://ghcr.io/acme/api@sha256:abc... --repo acme/api
cosign verify-attestation --type cyclonedx \
--certificate-identity-regexp '^https://github\.com/acme/api/.*$' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/acme/api@sha256:abc...
```
`cosign verify` with no identity flags answers "is this signed by someone?" — which is always yes
for a public transparency log. The security property comes from pinning **who** signed and **which
issuer** attested their identity.
## 3. Enforce at admission, so an unverified image cannot run
Verification in CI is advisory: it proves nothing about what a cluster actually pulls. Enforce at
the admission boundary.
```yaml
# Kyverno: verify signature + identity, and mutate to digest so the check cannot be bypassed
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: verify-image-provenance
spec:
validationFailureAction: Enforce # Audit first, Enforce once the signal is clean
webhookTimeoutSeconds: 30
rules:
- name: verify-signature
match:
any:
- resources:
kinds: [Pod]
namespaces: [production, staging]
verifyImages:
- imageReferences: ["ghcr.io/acme/*"]
mutateDigest: true # rewrite tag -> digest in the admitted spec
required: true
attestors:
- entries:
- keyless:
subject: "https://github.com/acme/*/.github/workflows/release.yml@refs/tags/*"
issuer: "https://token.actions.githubusercontent.com"
```
`mutateDigest: true` matters: without it a verified tag can be repointed at an unsigned image
between admission and pull.
## 4. SLSA levels — what each one actually buys
| Level | Requirement | Attack it stops | Typical cost |
| --- | --- | --- | --- |
| L1 | Provenance exists and is available | Nothing on its own; makes builds auditable | Hours |
| L2 | Hosted build service, signed provenance | Forged provenance from a developer laptop | Days |
| L3 | Hardened builder, non-falsifiable provenance, isolated builds | A compromised build step forging its own provenance | Weeks |
GitHub-hosted runners with `actions/attest-build-provenance` reach **L3** for the provenance
property, because the signing identity is minted by the platform and is not reachable from job
steps. Self-hosted runners generally do not: a job that shares a runner with another job can reach
its credentials.
Claim the level the pipeline actually meets. "SLSA L3" on a self-hosted runner with a shared
Docker socket is a false claim an auditor will find.
## 5. Best practices and anti-patterns
**Do:**
- **Sign and reference by digest everywhere** — in CI, in manifests, in Helm values.
- **Start in `Audit` mode**, measure which workloads would fail, then flip to `Enforce`. Enforcing
first takes production down for images that were fine.
- **Pin third-party GitHub Actions to a commit SHA** and verify the SHA resolves to the tag its
comment claims. A pin comment naming a version the SHA does not match is worse than no comment.
- **Keep a break-glass path** — a documented, time-boxed, logged policy exception with an owner and
an expiry date, so an incident is not the moment someone discovers how to bypass admission.
- **Verify base images too.** Signing your layer while pulling an unverified base secures the wrong
half of the artifact.
**Do not:**
- **Sign a tag.** Mutable reference, worthless signature.
- **Run `cosign verify` without `--certificate-identity*` and `--certificate-oidc-issuer`.** It
reads as verification in a pipeline log and enforces nothing.
- **Treat an SBOM as evidence.** An SBOM not bound by an attestation to a digest is an unsigned
text file; anyone can produce a clean one.
- **Store a cosign private key in CI secrets** when keyless works. A stored key is a key that leaks,
and it cannot be revoked without re-signing every artifact.
- **Enforce policy only in the cluster.** Also block at merge, so failures surface in review rather
than at 03:00 during a rollout.
- **Skip the revocation story.** Decide in advance how a bad-but-signed artifact is blocked — an
explicit deny list keyed by digest, plus a tested rebuild-and-resign path.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

