enforce-sbom
Add an SBOM Policy Enforcement (SscaEnforcement / CdSscaEnforcement) step to an existing Harness pipeline to verify SBOM attestations and apply OPA SBOM policy sets. Supports CI, Security, and CD (Deployment) including CI-only pipelines — if no Deploy stage exists, add one via Phase 3b (service, environment, infra, containerized step group) then place CdSscaEnforcement before deploy. Supports container images and repositories from Artifact Registry, Third-Party registries (docker, ECR, GCR, GAR, ACR), and Git. Matches Pipeline Studio SBOM Policy Enforcement UI. Only works with existing pipelines (may append a Deploy stage). Use when asked to enforce SBOM policies, add SBOM policy enforcement, verify SBOM attestation in pipeline, or block non-compliant components. Trigger phrases: enforce SBOM, SBOM policy enforcement, SBOM policy step, verify SBOM policy, SscaEnforcement, add policy enforcement after SBOM.
Harness · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add harness/harness-skills --skill enforce-sbomAbout this skill
name: enforce-sbom description: >- Add an SBOM Policy Enforcement (SscaEnforcement / CdSscaEnforcement) step to an existing Harness pipeline to verify SBOM attestations and apply OPA SBOM policy sets. Supports CI, Security, and CD (Deployment) including CI-only pipelines — if no Deploy stage exists, add one via Phase 3b (service, environment, infra, containerized step group) then place CdSscaEnforcement before deploy. Supports container images and repositories from Artifact Registry, Third-Party registries (docker, ECR, GCR, GAR, ACR), and Git. Matches Pipeline Studio SBOM Policy Enforcement UI. Only works with existing pipelines (may append a Deploy stage). Use when asked to enforce SBOM policies, add SBOM policy enforcement, verify SBOM attestation in pipeline, or block non-compliant components. Trigger phrases: enforce SBOM, SBOM policy enforcement, SBOM policy step, verify SBOM policy, SscaEnforcement, add policy enforcement after SBOM. metadata: author: Harness version: 1.0.0 mcp-server: harness-mcp-v2 license: Apache-2.0 compatibility: Requires Harness MCP v2 server (harness-mcp-v2)
Enforce SBOM
Add an SBOM Policy Enforcement (SscaEnforcement / CdSscaEnforcement) step to an existing
Harness pipeline. The step verifies SBOM attestations (when enabled) and evaluates SBOM OPA policy
sets against the artifact's bill of materials.
This skill only works with existing pipelines — do not create standalone enforcement-only pipelines.
Prerequisites: An SBOM must already exist for the artifact (typically from SscaOrchestration via
/create-sbom or SBOM ingestion). SBOM policy sets must exist (/create-policy).
Supported stages: CI, CD (Deployment), and Security — same as SBOM Orchestration. CD requires a
containerized step group with container-based execution.
Guide the user through a step-by-step interactive wizard (same UX as /create-sbom):
- Wizard:
references/interactive-wizard-flow.md - UI ↔ YAML:
references/sbom-enforcement-step.md - CD containerized step groups (new or existing Deploy stage):
skills/create-sbom/references/cd-containerized-step-group.md
Interaction model (mandatory)
- One question per turn — use
AskQuestionwhen available; otherwise numbered options with(Recommended). - Opening message — add SBOM Policy Enforcement to an existing pipeline; mention SBOM + policy set 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 — list stages/steps; highlight
SscaOrchestrationand connectors. - Infer source from orchestration — when one SBOM generation step exists, reuse its
sourceand image. - Never guess image tags — default to orchestration step image; 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 placement without an existing Deploy stage — if the user chooses CD enforcement (
cd_before_deploy,add_cd_stage, or similar) on a CI-only pipeline, do not reject or force CI-only. Run Phase 3b to add aDeploymentstage with a containerized step group andCdSscaEnforcementbefore deploy (same prerequisites as/create-sbom). - Never block CD on “no Deployment stage” — warn in Phase 2, then proceed via Phase 3b when the user wants CD.
Full phase prompts: references/interactive-wizard-flow.md.
Instructions
Wizard phases (user-facing)
| Phase | Breadcrumb | Action |
|---|---|---|
| 0 | Pipeline | AskQuestion: pipeline URL ready? |
| 1 | Pipeline | Collect URL or org/project/id → harness_get |
| 2 | Pipeline | Display structure; note missing SscaOrchestration |
| 3 | Placement | AskQuestion: after SBOM step, CD before deploy, add CD stage, etc. |
| 3b | Placement (CD only) | If no Deployment stage: service, environment, infra, stepGroupInfra — then add stage + CdSscaEnforcement |
| 4 | Source | AskQuestion: infer from pipeline or pick tile |
| 5 | Source | AskQuestion: registry provider (Third-Party only) |
| 6 | Details | Connector (skip if obvious) |
| 7 | Details | Image / repo (free text; default from orchestration) |
| 8 | Verify | AskQuestion: verify attestation method |
| 9 | Policy | AskQuestion: policy set(s) — harness_list policy_set |
| 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 (YAML) | Step type | Placement notes |
|---|---|---|
CI | SscaEnforcement | After SscaOrchestration in the same stage |
Deployment | CdSscaEnforcement | Containerized step group; before deploy |
Security | SscaEnforcement | After SBOM generation when artifact is known |
CD edge case (mandatory workflow)
Use when Placement targets CD (cd_before_deploy, add_cd_stage, or an existing Deployment stage).
Phase 2 — CI-only pipeline
If there is no type: Deployment stage, note it in the structure table and add:
This pipeline has no CD Deploy stage yet. You can still enforce SBOM in CD — we will add a Deployment stage with a containerized step group and place SBOM Policy Enforcement before the deploy step.
Do not tell the user CD is invalid for this pipeline. If they chose CD in Phase 3, continue to Phase 3b.