Install
$ agentstack add skill-harness-harness-skills-enforce-slsa ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
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-pipeline to execute. Do not call harness_execute, poll executions, or run harness_diagnose in 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-policy before 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: 15m
Key-based verify (generation used keybased + private key):
verify_attestation:
type: keybased
spec:
publicKey: account.cosign_public_key
If 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_rules
No attestation verify (policy-only): omit verify_attestation.
CD Deploy — same step type inside containerized stepGroup; use ` 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:
org_id:
project_id:
body: { yamlPipeline: "" }
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:**
**Step:** SLSA Verification (SlsaVerification)
**Location:** Stage "",
**Source:** Docker — —
**Verify attestation:** Keyless (Harness OIDC) — or as configured
**Policy sets:**
**Pipeline URL:** https://app.harness.io/ng/account//module/ci/orgs//projects//pipelines//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_rules
CD before deploy
/enforce-slsa
Verify SLSA in deploy stage before K8s rolling deploy for easy-buggy-app:blog
Key-based verify (matches keybased generation)
/enforce-slsa
Verify SLSA with public key account.cosign_public_key — same image as generation step
Performance 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.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: harness
- Source: harness/harness-skills
- License: Apache-2.0
- Homepage: https://developer.harness.io/docs/platform/harness-ai/harness-skills/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.