/harness:configure-container-scanfrom Harness DevOps
Adds container image scanning steps to existing Harness pipelines using Harness STO scanners. Supports Harness SCA, Trivy, Grype, Snyk, Prisma Cloud, Anchore, Black Duck, and Wiz with Docker Hub, ECR, GCR, and other registries.
Ships in Harness DevOps. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Add a container image scanning step to an existing Harness pipeline using the native HarnessSCA STO scanner.
Ask for org, project, and pipeline identifier if not already known. This skill only works with existing pipelines.
Call MCP tool: harness_get
Parameters:
resource_type: "pipeline"
resource_id: "<pipeline_identifier>"
org_id: "<organization>"
project_id: "<project>"
Parse the pipeline YAML to identify:
CI, SecurityTests, Deployment, Approval)SecurityTests stage already existsPresent the structure to the user:
Pipeline: <name>
Stage 1: <stage_name> (type: <stage_type>)
- Step 1: <step_name> (type: <step_type>)
...
Ask the user where they want the scanner step added:
Present the available insertion points:
CI stage (scanner step is added directly into that stage's execution.steps)SecurityTests stage (scanner step is added into that stage's execution.steps)SecurityTests stage (appended to the pipeline if no suitable stage exists or user prefers isolation)Recommendation guidance:
CI stage — simpler, no extra infrastructure needed, scan runs as part of the buildSecurityTests stage — isolated, runs independently, useful when scanning images built elsewhere or from a registryIf the user doesn't specify, default to adding inside the existing CI stage if one exists.
Present the available container image scanners supported in Harness STO:
Available Container Scanners:
Default recommendation: Use Harness SCA — native, no additional credentials required, and integrates directly with Harness STO results.
Ask the user which scanner they prefer. If they don't specify, use Harness SCA as the default.
Step type mapping and scanner product auth requirements:
| Scanner | type field | Product auth needed? | Auth fields |
|---|---|---|---|
| Harness SCA | HarnessSCA | No | — |
| Aqua Trivy | AquaTrivy | No | — |
| Grype | Grype | No | — |
| Snyk | Snyk | Yes | access_token (Snyk API token) |
| Prisma Cloud | PrismaCloud | Yes | access_id (Access Key), access_token (Secret Key) |
| Anchore Enterprise | AnchoreEnterprise | Yes | access_id (username), access_token (password/API key) |
| Black Duck | BlackDuck | Yes | access_token (Hub API token) |
| Wiz | Wiz | Yes | access_id (Client ID), access_token (Client Secret) |
If the user picks a commercial scanner (Snyk, Prisma Cloud, Anchore Enterprise, Black Duck, Wiz):
<+secrets.getValue("project.<secret_identifier>")>auth block of the step spec — separate from the registry image credentialsExample prompt to user:
"Snyk requires an API token. Please provide the Harness secret identifier for your Snyk API token (e.g.,
snyk_api_token). I'll reference it as<+secrets.getValue("project.snyk_api_token")>."
If the secret doesn't exist yet, suggest creating it first via /create-secret before proceeding.
Ask the user which registry type their image is in, then collect the fields for that type:
Option A — Harness Registry
The image is stored in the Harness internal container registry.
| Field | Required | Description |
|---|---|---|
| Registry | Yes | Harness registry connector ref (e.g., account.account-level-test) |
| Image Path | Yes | e.g., harness/todolist-sample — maps to image_path in YAML |
YAML:
image:
type: harness
registry: <harness_registry_connector_ref>
image_path: <image_path>
Option B — Third-Party Registry (Docker Hub, ECR, GCR, ACR, JFrog, etc.)
| Field | Required | Description |
|---|---|---|
| Type | Yes | Registry protocol — almost always docker_v2 |
| Domain | No | Defaults to docker.io. For ECR: 123456789.dkr.ecr.us-east-1.amazonaws.com, for GCR: gcr.io |
| Name | Yes | Image name, e.g., harness/todolist-sample or myorg/myapp |
| Tag / Digest | Yes | e.g., latest, 123, or sha256:1234567890abcdef... |
| Access Id | No | Secret ref for private registry username/access key, e.g., <+secrets.getValue("project.access_id")> |
| Access Token | No | Secret ref for private registry password/token, e.g., <+secrets.getValue("project.access_token")> |
YAML:
image:
type: docker_v2
domain: <domain> # omit if Docker Hub (docker.io)
name: <image_name>
tag: <tag>
access_id: <+secrets.getValue("project.access_id")> # omit if public image
access_token: <+secrets.getValue("project.access_token")> # omit if public image
Option C — Local (image built in this stage)
The image was built earlier in the same pipeline stage and is available locally on the build node.
| Field | Required | Description |
|---|---|---|
| Name | Yes | Image name, e.g., harness/todolist-sample |
| Tag / Digest | Yes | e.g., latest, 123, or sha256:1234567890abcdef... |
| Domain | No | Defaults to docker.io |
YAML:
image:
type: local_image
name: <image_name>
tag: <tag>
domain: <domain> # omit if not needed
Default: Third-Party → Docker Hub (docker_v2, domain docker.io) with latest tag if the user doesn't specify.
Only required when adding a new SecurityTests stage. If inserting into an existing CI or SecurityTests stage, skip this step — the stage already has infrastructure.
If a new SecurityTests stage is being created and infrastructure is not yet defined, ask for:
account.stoqadelegate)harness-delegate)Use the step type from the scanner mapping in Step 3. Examples below.
For Harness SCA (default scanner):
- step:
type: HarnessSCA
name: Container_Scan
identifier: Container_Scan
spec:
mode: orchestration
config: default
target:
type: container
detection: auto
advanced:
log:
level: info
resources:
limits:
memory: 2G
cpu: 1000m
privileged: true
image:
<use the image block from Step 4 based on registry type>
Use the image block generated in Step 4 (Harness / Third-Party / Local). The rest of the step spec is identical regardless of registry type.
For Aqua Trivy (open-source):
- step:
type: AquaTrivy
name: Aqua_Trivy_Scan
identifier: Aqua_Trivy_Scan
spec:
mode: orchestration
config: default
target:
type: container
detection: auto
advanced:
log:
level: info
privileged: true
image:
type: docker_v2
name: <image_name>
tag: <tag>
For Grype (open-source):
- step:
type: Grype
name: Grype_Scan
identifier: Grype_Scan
spec:
mode: orchestration
config: default
target:
type: container
detection: auto
advanced:
log:
level: info
privileged: true
image:
type: docker_v2
name: <image_name>
tag: <tag>
For commercial scanners — add an auth block with scanner product credentials:
- step:
type: Snyk # or PrismaCloud, AnchoreEnterprise, BlackDuck, Wiz
name: Snyk_Container_Scan
identifier: Snyk_Container_Scan
spec:
mode: orchestration
config: default
target:
type: container
detection: auto
auth:
access_id: <+secrets.getValue("project.snyk_access_id")> # omit if scanner only needs token
access_token: <+secrets.getValue("project.snyk_api_token")>
advanced:
log:
level: info
privileged: true
image:
type: docker_v2
name: <image_name>
tag: <tag>
Use the auth field names from the scanner product auth table in Step 3. Only include access_id if the scanner requires it (Snyk only needs access_token; Prisma Cloud, Anchore, and Wiz need both).
Scenario A — Adding to an existing CI stage:
Insert the step into spec.execution.steps of the chosen CI stage. The stage already has its own infrastructure and cloneCodebase: true. No changes needed to the stage itself — just append the step:
- step:
type: HarnessSCA
name: Container_Scan
identifier: Container_Scan
spec:
mode: orchestration
config: default
target:
type: container
detection: auto
advanced:
log:
level: info
resources:
limits:
memory: 2G
cpu: 1000m
privileged: true
image:
type: docker_v2
name: <image_name>
tag: <tag>
Scenario B — Adding to an existing SecurityTests stage:
Insert the step into spec.execution.steps of the existing stage. Ensure the stage has:
cloneCodebase: falseprivileged: true on the stepScenario C — No suitable stage exists, creating a new SecurityTests stage:
Append a new stage to the pipeline:
- stage:
name: Container Scan
identifier: Container_Scan_Stage
type: SecurityTests
spec:
cloneCodebase: false
infrastructure:
type: KubernetesDirect
spec:
connectorRef: <delegate_connector>
namespace: <namespace>
automountServiceAccountToken: true
nodeSelector: {}
os: Linux
execution:
steps:
- step:
type: HarnessSCA
name: Container_Scan
identifier: Container_Scan
spec:
mode: orchestration
config: default
target:
type: container
detection: auto
advanced:
log:
level: info
resources:
limits:
memory: 2G
cpu: 1000m
privileged: true
image:
type: docker_v2
name: <image_name>
tag: <tag>
Call MCP tool: harness_update
Parameters:
resource_type: "pipeline"
resource_id: "<pipeline_identifier>"
org_id: "<organization>"
project_id: "<project>"
body: { yamlPipeline: "<updated pipeline YAML string>" }
## Container Scan Configured
**Pipeline:** <pipeline_name>
**Scanner:** <scanner_name> (<scanner_type>)
**Stage:** <stage_name> (SecurityTests)
**Image:** <image_name>:<tag>
**Registry:** <registry_type>
**Pipeline URL:** https://app.harness.io/ng/account/<account_id>/module/sto/orgs/<org_id>/projects/<project_id>/pipelines/<pipeline_id>/pipeline-studio/
### Next Steps
1. Run the pipeline to verify the scan step executes successfully
2. View scan results in the Security Tests tab of the execution
3. Set failure thresholds using `failOnSeverity` (CRITICAL, HIGH, MEDIUM, LOW) in the step's Advanced tab
4. Configure exemptions for false positives via `/security-report` skill
5. Enforce pipeline gates on severity via `/create-policy` skill
/create-container-scan
Add a container scan to my pipeline for the image johnkday/nodegoat:latest
/create-container-scan
Add container scanning to my deploy pipeline. The image is in ECR:
123456789.dkr.ecr.us-east-1.amazonaws.com/my-service:v2.1.0
Use our ECR credentials stored in secrets.
/create-container-scan
I want to scan my Docker image myorg/api-server:latest before it gets deployed.
Add it to the existing SecurityTests stage in my backend-deploy pipeline.
HarnessSCA (and all other scanners) can be added to CI stages (inline with build) or SecurityTests stages (isolated) — ask the user, default to CI stage if one existsauth.access_id / auth.access_token) before generating YAML — these are different from registry credentials/create-secret before proceedingauth block sits at the step spec level, separate from image credentialsprivileged: true on the HarnessSCA step — it is required for container scanningSecurityTests stage — existing stages already have infrastructurecloneCodebase: false on SecurityTests stages — CI stages already manage their own codebase settingmode: orchestration and config: default unless the user specifies otherwisememory: 2G and cpu: 1000m to avoid OOM failures during scanorg_id and project_id are correctharness_list (resource_type: "pipeline")privileged: true is set on the step specimage.access_id and image.access_token reference valid secretsauth.access_token (and auth.access_id where required) reference valid Harness secretsharness_get(resource_type="secret")access_token is needed (API token), not access_idaccess_id and access_token are required/create-secret then re-run the skillidentifier matches pattern ^[a-zA-Z_][0-9a-zA-Z_]{0,127}$SecurityTests stage has a valid infrastructure block with a working delegate connectorWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub harness/harness-ai --plugin harness73 skills in this plugin
/ai-operationsConfigure Harness AI-powered operations (AIDA) via MCP. Set up predictive failure analysis with ML models for memory leaks, disk exhaustion, connection pool saturation, and latency degradation. Configure intelligent alert correlation and noise reduction to reduce alert volume. Use when asked to set up predictive failure analysis, configure AI-powered alerting, reduce alert noise, or enable ML-based anomaly detection. Do NOT use for pipeline debugging (use debug-pipeline instead) or SLO management (use manage-slos instead). Trigger phrases: AIDA, predictive failure, alert correlation, noise reduction, anomaly detection, AI ops, predictive analysis, alert fatigue, ML alerting, intelligent alerting./analyze-costsAnalyze cloud costs, find optimization opportunities, and track anomalies using Harness CCM via MCP. Use when user says "cloud costs", "analyze costs", "cost optimization", "reduce spending", "cost report", or asks about cloud bills./approve-exemptApprove pending Harness STO security exemptions (waivers) at their current scope or elevate them to Project, Org, or Account scope. Users say "approve" for both in-scope approval and higher-scope elevation — do not require the word "promote". Supports approving one exemption or a mixed list where each row has a different approval scope. Default workflow lists pending exemptions in chat (paginated preview) so the user picks by row number — no copying from the Harness UI. Use when a user wants to approve, sign off on, or clear pending exemptions, waive approvals, org-wide approval, or account-wide approval. Trigger phrases: approve exempt, approve exemption, approve waiver, sign off exemption, clear pending exemption, approve for org, approve for account, org-wide approval, account-wide approval, pending exemptions./audit-reportGenerate audit reports and compliance trails using Harness audit trail data via MCP v2 tools. Track user actions, resource changes, authentication events, and access patterns across accounts, organizations, and projects. Use when asked to audit activity, generate compliance reports, investigate security incidents, review user actions, check change logs, or produce SOC2/GDPR/HIPAA audit evidence. Trigger phrases: audit report, audit trail, compliance audit, user activity log, change log, access audit, security investigation, who changed what, audit events./chaos-code-risk-scanScan a source code repository for resilience risks that a Harness chaos experiment can prove (outbound calls without timeouts, retries without backoff, missing graceful shutdown, health checks that mask dependency state, unbounded queues and pools, local state), map each one to a generic SourceCode risk rule, and report them to Harness as a CodeRepository risk scan. Use when the user asks to scan a repo or service code for resilience or chaos risks, or wants code findings they can verify with chaos experiments. Do not use for manifest or pipeline risk scans (those run in Harness), to create or run chaos experiments (use chaos-experiment), or for security or code quality review. Trigger phrases: scan this repo for resilience risks, chaos code scan, find chaos-provable risks, code risk scan, resilience review of this service./chaos-dr-testUse when working with Chaos Engineering steps inside a Harness pipeline. Covers ChaosFault, ChaosProbe, ChaosAction steps (DRTest stages), the Chaos step (DRTest stages), and DRTest stage/pipeline structure. Use when the user asks to add, modify, or create chaos steps, fault injection, probes, or disaster recovery test pipelines. Do not use for standalone Chaos Experiment create or edit; use chaos-experiment for those. Trigger phrases: DR test, DRTest pipeline, disaster recovery test, chaos step, ChaosFault step, ChaosProbe step, ChaosAction step.Other plugins' skills for the same job