enforce-slsa
Skill115 starsChanged 58 days agoApache-2.0View on GitHub
Add an SLSA Verification (SlsaVerification) step to an existing Harness pipeline to verify SLSA provenance attestations and optionally enforce OPA policy sets on provenance data. Supports CI and CD (Deployment) including CI-only pipelines — append a Deploy stage via Phase 3b when verifying before deploy. Supports Docker, ECR, GCR, GAR, ACR, HAR, and Local artifacts. Only works with existing pipelines. Use when asked to verify SLSA, enforce SLSA policies, add SLSA verification step, validate SLSA attestation, or gate deploy on SLSA provenance. Trigger phrases: enforce SLSA, SLSA verification, verify SLSA, SLSA policy enforcement, SlsaVerification, verify SLSA attestation, add SLSA verify step.
In this repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/harness.mdcCursor rule
- ai-operationsSkill
- analyze-costsSkill
- approve-exemptSkill
- audit-reportSkill
- chaos-dr-testSkill
- chaos-experimentSkill
- configure-agent-pr-attestationSkill
- configure-container-scanSkill
- configure-dast-scanSkill
- configure-repo-scanSkill
- configure-secret-scanSkill
- create-agentSkill
- create-agent-templateSkill
- create-connectorSkill
- create-environmentSkill
- create-infrastructureSkill
- create-pipelineSkill
- create-pipeline-v1Skill
- create-policySkill
- create-sbomSkill
- create-secretSkill
- create-serviceSkill
- create-templateSkill
- create-triggerSkill
- dbops-changesetSkill
- debug-pipelineSkill
- deployment-readinessSkill
- dora-metricsSkill
- enforce-sbomSkill
- exempt-vulnSkill
- fme-rollout-pipelineSkill
- generate-slsaSkill
- gitops-statusSkill
- incident-responseSkill
- manage-artifactsSkill
- manage-cdeSkill
- manage-delegatesSkill
- manage-feature-flagsSkill
- manage-freeze-windowsSkill
- manage-iacmSkill
- manage-idpSkill
- manage-pull-requestsSkill
- manage-rolesSkill
- manage-slosSkill
- manage-supply-chainSkill
- manage-usersSkill
- migrate-pipelineSkill
- optimize-pipelineSkill
- pr-analysisSkill
- run-pipelineSkill
- scorecard-reviewSkill
- security-reportSkill
- sei-analyticsSkill
- sign-artifactSkill
- template-usageSkill
- verify-signSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 2 are distinctive, and 11 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.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Add an SLSA Verification (SlsaVerification) step to an existing Harness pipeline.
- Very specific: line 84
After Phase 10 confirm → insert step, harness_update, then provide summary (do not run the pipeline).
- Very specific: line 96
If no Deployment stage and user chose CD verify:
- Very specific: line 101
Run Phase 3b (service, environment, infrastructure, stepGroupInfra) — mirror /generate-slsa Phase 3b.
- Very specific: line 102
Use skills/generate-slsa/references/cd-containerized-step-group.md with SlsaVerification.
- Very specific: line 154
If API validation rejects flat keyless / keybased, retry with nested cosign wrapper — see references/slsa-verification-step.md.
- Distinctive: line 175
Do not modify unrelated steps.
- Distinctive: line 252
Only existing pipelines (may append Deploy stage).
- Very specific: line 268
Add /generate-slsa first with attestation enabled (type: provenance in YAML).
- Very specific: line 273
Verify method must match generation (keyless vs keybased).
- Very specific: line 278
Use same image_path as generation repo field.
- Very specific: line 292
Place inside stepGroup with stepGroupInfra — not top-level execution.steps.
- Very specific: line 299
Use /run-pipeline to execute and /debug-pipeline to diagnose failures
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
Enforce SLSA
Add an SLSA Verification (SlsaVerification) step to an existing Harness pipeline. The step
verifies SLSA provenance attestations (when enabled) and optionally evaluates OPA policy sets against
provenance data.
This skill only works with existing pipelines — do not create standalone verification-only pipelines.
Prerequisites: SLSA provenance must already exist for the artifact (typically from a provenance
step via /generate-slsa — UI label SLSA Generation). Optional policy sets for provenance
enforcement (/create-policy, harness_list policy_set).
Supported stages: CI, CD (Deployment), and Security. CD requires a containerized step group.
Unlike SBOM enforcement, CI and CD both use SlsaVerification (no separate CD step type).
Guide the user through a step-by-step interactive wizard (same UX as /generate-slsa):
- Wizard:
references/interactive-wizard-flow.md - UI ↔ YAML:
references/slsa-verification-step.md - CD containerized step groups:
skills/generate-slsa/references/cd-containerized-step-group.md
Interaction model (mandatory)
- One question per turn — use
AskQuestionwhen available; otherwise numbered options with(Recommended). - Opening message — add SLSA Verification; mention generation + optional policy prerequisites.
- Progress breadcrumb — after pipeline fetch:
Pipeline · Placement · Source · Details · Verify · Policy · Submit - Record answers — running summary; do not re-ask unless the user changes direction.
- Fetch before configure —
harness_getbefore placement/source questions. - Show pipeline structure — highlight
provenance(SLSA Generation) and connectors. - Infer source from generation — when one
provenancestep exists (oridentifier: slsageneration), reuse its source (maprepo→image_path, lowercase → PascalCase types). - Never guess image tags — default from generation step; ask if ambiguous.
- Confirm before write — summary +
harness_updateonly after user confirms. - Stop after update — after successful
harness_update, provide a configuration summary and point the user to/run-pipelineto execute. Do not callharness_execute, poll executions, or runharness_diagnosein this skill (same pattern as/configure-repo-scan). - CD on CI-only pipeline — do not reject CD verify; run Phase 3b to add Deploy stage + containerized group.
- Verify method must match generation — keyless ↔ keyless, keybased ↔ public key from same key pair.
Full phase prompts: references/interactive-wizard-flow.md.
Instructions
Wizard phases
| Phase | Breadcrumb | Action |
| 0 | Pipeline | AskQuestion: pipeline URL ready? |
| 1 | Pipeline | Collect URL → harness_get |
| 2 | Pipeline | Display structure; note missing provenance (SLSA Generation) step |
| 3 | Placement | AskQuestion: after generation, CD before deploy, etc. |
| 3b | Placement (CD) | Service, env, infra, step group if new Deploy stage |
| 4 | Source | Infer from generation or pick registry tile |
| 5 | Source | Registry provider (Third-Party only) |
| 6 | Details | Connector (skip if obvious) |
| 7 | Details | Image / image_path (default from generation) |
| 8 | Verify | AskQuestion: verify attestation method |
| 9 | Policy | AskQuestion: policy set(s) or skip |
| 10 | Submit | AskQuestion: confirm pipeline update |
After Phase 10 confirm → insert step, harness_update, then provide summary (do not run the pipeline).
Supported stage types
| Stage type | Step type | Placement notes |
CI | SlsaVerification | After provenance / slsageneration in the same stage |
Deployment | SlsaVerification | Containerized step group; before deploy |
Security | SlsaVerification | After generation when artifact is in registry |
CD edge case
If no Deployment stage and user chose CD verify:
No CD Deploy stage yet. We can add a Deployment stage with a containerized step group and place SLSA Verification before deploy.
Run Phase 3b (service, environment, infrastructure, stepGroupInfra) — mirror /generate-slsa Phase 3b.
Use skills/generate-slsa/references/cd-containerized-step-group.md with SlsaVerification.
After the wizard — backend steps
Check prerequisites
- SLSA generation — pipeline contains
type: provenance(SLSA Generation) or user confirms provenance exists. - Policy sets (optional) —
harness_list(resource_type="policy_set"). If user wants policy enforcement and none exist, direct to/create-policybefore continuing.
Extract context from pipeline YAML
From provenance step (if present — also match identifier: slsageneration), copy and transform:
| Generation | Verification |
source.type: docker | source.type: Docker |
source.spec.repo | source.spec.image_path |
source.spec.connector | source.spec.connector |
spec.attestation | matching verify_attestation (private → public key for keybased) |
Generate SLSA verification step YAML
CI / Security — Docker Registry, keyless verify:
- step:
identifier: slsaverification
name: SLSA Verification
type: SlsaVerification
spec:
source:
type: Docker
spec:
connector: lavakush07
image_path: lavakush07/easy-buggy-app:blog
verify_attestation:
type: keyless
spec:
oidcProvider: harness
timeout: 15mKey-based verify (generation used keybased + private key):
verify_attestation:
type: keybased
spec:
publicKey: account.cosign_public_keyIf API validation rejects flat keyless / keybased, retry with nested cosign wrapper — see
references/slsa-verification-step.md.
Policy enforcement (Advanced tab — step-level enforce):
enforce:
policySets:
- slsa_provenance_rulesNo attestation verify (policy-only): omit verify_attestation.
CD Deploy — same step type inside containerized stepGroup; use <+artifact.image> for
image_path when verifying service artifacts.
Full provider mapping: references/slsa-verification-step.md.
Insert step into pipeline YAML
- Insert at Phase 3 placement — after
slsagenerationwhen possible. - Do not modify unrelated steps.
- Step identifier:
slsaverification(useslsaverification_cdin CD when CI already has one). - CD: inside containerized step group only.
Update pipeline via MCP
harness_update
resource_type: pipeline
resource_id: <pipeline_identifier>
org_id: <organization>
project_id: <project>
body: { yamlPipeline: "<updated pipeline YAML>" }On validation errors, check PascalCase source.type, image_path vs repo, and verify_attestation
shape (prefer flat keyless; fallback nested cosign).
Provide summary
Report the results to the user (same pattern as /configure-repo-scan — do not execute the pipeline):
## SLSA Verification Configured
**Pipeline:** <pipeline_name>
**Step:** SLSA Verification (SlsaVerification)
**Location:** Stage "<stage_name>", <position>
**Source:** Docker — <connector> — <image_path>
**Verify attestation:** Keyless (Harness OIDC) — or as configured
**Policy sets:** <list or none>
**Pipeline URL:** https://app.harness.io/ng/account/<account_id>/module/ci/orgs/<org_id>/projects/<project_id>/pipelines/<pipeline_id>/pipeline-studio/
**Note:** Review the SLSA Verification step in Pipeline Studio to adjust Advanced settings.
### Next Steps
1. Run the pipeline via `/run-pipeline` to verify SLSA verification executes successfully
2. If the run fails, diagnose with `/debug-pipeline`
3. View verification outcome on the execution **Supply Chain** tab
4. If **Failed** due to policy deny, tune policies via `/create-policy`
5. Add generation with `/generate-slsa` if provenance was missing
6. Automate with `/create-trigger`CD pipelines: note in the summary if runtime inputs (service artifact, environment, infrastructure)
will be required at run time — the user provides those via /run-pipeline or Harness UI Run.
Examples
Verify after SLSA Generation
/enforce-slsa
Add SLSA verification after slsa-generation — keyless verify, policy set slsa_prod_rulesCD before deploy
/enforce-slsa
Verify SLSA in deploy stage before K8s rolling deploy for easy-buggy-app:blogKey-based verify (matches keybased generation)
/enforce-slsa
Verify SLSA with public key account.cosign_public_key — same image as generation stepPerformance Notes
- Only existing pipelines (may append Deploy stage).
- Wizard UX mandatory — one question per turn.
- Reuse generation source — scan for
type: provenanceoridentifier: slsageneration; maprepo→image_path, lowercase → PascalCase types. - Verification
source.typeis PascalCase (Docker) — generation uses lowercase (docker). verify_attestationis snake_case (notverifyAttestation). Prefer flattype: keyless+oidcProvider(same shape as generationattestation).- Policy sets on step
enforce.policySets— notspec.policylike SBOM enforcement. - List
policy_setvia MCP — do not invent identifiers. - CD: containerized step group only; see
skills/generate-slsa/references/cd-containerized-step-group.md. - Do not execute pipelines in this skill — use
/run-pipelineafter configuration (same as/configure-repo-scan). - Pair with
/generate-slsa(generate) and/create-policy(OPA rules).
Troubleshooting
No SLSA Generation Step
- Add
/generate-slsafirst with attestation enabled (type: provenancein YAML). - Verification needs
.attin registry or provenance in SCS Artifacts. - Scan for
provenancesteps — notSlsaGeneration(API usesprovenance).
Attestation Verification Failed
- Verify method must match generation (
keylessvskeybased). - Keybased: use public key secret (generation uses private key).
- Keyless non-harness: configure Connector for Keyless Signing.
Wrong Image / No Provenance
- Use same
image_pathas generationrepofield. - Symptom: verify passes wrong artifact — image mismatch.
Policy Evaluation Failed
- Review policy set Rego rules; check Supply Chain tab for violations.
- Confirm policy set identifier (not display name) in
enforce.policySets.
YAML Validation Errors
source.typemust be PascalCase for verification (Docker, notdocker).- Docker source uses
image_path, notrepo. verify_attestation: use flattype: keyless+spec.oidcProvider: harness— not nestedcosignunless API rejects flat shape.DUPLICATE_IDENTIFIER— renameslsaverification.
CD Step Errors
- Place inside
stepGroupwithstepGroupInfra— not top-levelexecution.steps. - See
skills/generate-slsa/references/cd-containerized-step-group.md.
User Chose CD on CI-Only Pipeline
- Expected — run Phase 3b; do not force CI-only unless user changes direction.
Pipeline Run Failed
- Use
/run-pipelineto execute and/debug-pipelineto diagnose failures - Confirm verify method matches generation attestation; check public key for keybased
- Missing runtime inputs: provide branch/tag or deploy inputs via
/run-pipelineor Harness UI Run
MCP Errors
CONNECTOR_NOT_FOUND— verify connector in Project Settings.ACCESS_DENIED— PAT needs pipeline edit and policy read permissions.
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.

