[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75JF7C485PYJ56ZXPCW7GXY":3,"skill-same:01M75JF7C485PYJ56ZXPCW7GXY":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":13,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M75JF7C485PYJ56ZXPCW7GXY","configure-container-scan",null,"Add container image scanning steps to existing Harness pipelines using Harness STO scanners. Supports Harness SCA (default), Aqua Trivy, Grype, Snyk, Prisma Cloud, Anchore, Black Duck, and Wiz. Supports Docker Hub, ECR, GCR, and other Third-Party registries as well as Harness and Local registries. Can insert the scan step into an existing CI stage or create a dedicated SecurityTests stage. Use when asked to add container scanning, configure image scanning, set up SCA for Docker images, scan container images for vulnerabilities, or add container security checks to a pipeline. Trigger phrases: add container scan, scan docker image, configure image scanning, set up SCA, add vulnerability scan for container, scan container before deploy, add Trivy scan, add Grype scan, add Snyk container scan.","AdmiralGallade\u002Fharness-repository","AdmiralGallade","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F59243621?v=4","01M759AG0891RDPWNGJBX1Y2TG","01M759AG10MS924J53ZWJ60AEC",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository\u002Fblob\u002Fmain\u002Fharnesses\u002Fharness-skills\u002Fskills\u002Fconfigure-container-scan\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: configure-container-scan\ndescription: >-\n  Add container image scanning steps to existing Harness pipelines using Harness STO scanners.\n  Supports Harness SCA (default), Aqua Trivy, Grype, Snyk, Prisma Cloud, Anchore, Black Duck, and Wiz.\n  Supports Docker Hub, ECR, GCR, and other Third-Party registries as well as Harness and Local registries.\n  Can insert the scan step into an existing CI stage or create a dedicated SecurityTests stage.\n  Use when asked to add container scanning, configure image scanning, set up SCA for Docker images, scan container\n  images for vulnerabilities, or add container security checks to a pipeline.\n  Trigger phrases: add container scan, scan docker image, configure image scanning, set up SCA, add vulnerability scan\n  for container, scan container before deploy, add Trivy scan, add Grype scan, add Snyk container scan.\nmetadata:\n  author: Harness\n  version: 1.0.0\n  mcp-server: harness-mcp-v2\nlicense: Apache-2.0\ncompatibility: Requires Harness MCP v2 server (harness-mcp-v2)\n---\n\n# Configure Container Scan\n\nAdd a container image scanning step to an existing Harness pipeline using the native `HarnessSCA` STO scanner.\n\n## Instructions\n\n### Step 1: Establish Scope and Pipeline Context\n\nAsk for org, project, and pipeline identifier if not already known. This skill only works with existing pipelines.\n\n```\nCall MCP tool: harness_get\nParameters:\n  resource_type: \"pipeline\"\n  resource_id: \"\u003Cpipeline_identifier>\"\n  org_id: \"\u003Corganization>\"\n  project_id: \"\u003Cproject>\"\n```\n\n### Step 2: Analyze Pipeline Structure\n\nParse the pipeline YAML to identify:\n- All stages and their types (`CI`, `SecurityTests`, `Deployment`, `Approval`)\n- Whether a `SecurityTests` stage already exists\n- Existing steps in each stage\n\nPresent the structure to the user:\n\n```\nPipeline: \u003Cname>\n\nStage 1: \u003Cstage_name> (type: \u003Cstage_type>)\n  - Step 1: \u003Cstep_name> (type: \u003Cstep_type>)\n  ...\n```\n\n**Ask the user where they want the scanner step added:**\n\nPresent the available insertion points:\n- Any existing `CI` stage (scanner step is added directly into that stage's `execution.steps`)\n- Any existing `SecurityTests` stage (scanner step is added into that stage's `execution.steps`)\n- A new `SecurityTests` stage (appended to the pipeline if no suitable stage exists or user prefers isolation)\n\n**Recommendation guidance:**\n- Adding into an existing `CI` stage — simpler, no extra infrastructure needed, scan runs as part of the build\n- Adding a new `SecurityTests` stage — isolated, runs independently, useful when scanning images built elsewhere or from a registry\n\nIf the user doesn't specify, default to adding inside the existing `CI` stage if one exists.\n\n### Step 3: Recommend Scanner Type\n\nPresent the available container image scanners supported in Harness STO:\n\n**Available Container Scanners:**\n- **Harness SCA** (default — native Harness container scanner, zero config)\n- **Aqua Trivy** (open-source, broad OS and library coverage)\n- **Grype** (open-source by Anchore, fast and accurate)\n- **Snyk** (commercial, developer-friendly with fix advice)\n- **Prisma Cloud** (commercial, enterprise runtime + image scanning)\n- **Anchore Enterprise** (commercial, policy-based enforcement)\n- **Black Duck** (commercial, license compliance + vulnerabilities)\n- **Wiz** (commercial, cloud-native security)\n\n**Default recommendation:** Use **Harness SCA** — native, no additional credentials required, and integrates directly with Harness STO results.\n\nAsk the user which scanner they prefer. If they don't specify, use Harness SCA as the default.\n\n**Step type mapping and scanner product auth requirements:**\n\n| Scanner | `type` field | Product auth needed? | Auth fields |\n|---------|-------------|----------------------|-------------|\n| Harness SCA | `HarnessSCA` | No | — |\n| Aqua Trivy | `AquaTrivy` | No | — |\n| Grype | `Grype` | No | — |\n| Snyk | `Snyk` | Yes | `access_token` (Snyk API token) |\n| Prisma Cloud | `PrismaCloud` | Yes | `access_id` (Access Key), `access_token` (Secret Key) |\n| Anchore Enterprise | `AnchoreEnterprise` | Yes | `access_id` (username), `access_token` (password\u002FAPI key) |\n| Black Duck | `BlackDuck` | Yes | `access_token` (Hub API token) |\n| Wiz | `Wiz` | Yes | `access_id` (Client ID), `access_token` (Client Secret) |\n\n**If the user picks a commercial scanner (Snyk, Prisma Cloud, Anchore Enterprise, Black Duck, Wiz):**\n\n1. Inform the user that this scanner requires product-level authentication credentials\n2. Ask for the required secret references from the table above — these must already exist as Harness secrets\n3. Format them as `\u003C+secrets.getValue(\"project.\u003Csecret_identifier>\")>`\n4. These go into the `auth` block of the step spec — separate from the registry image credentials\n\nExample prompt to user:\n> \"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 `\u003C+secrets.getValue(\"project.snyk_api_token\")>`.\"\n\nIf the secret doesn't exist yet, suggest creating it first via `\u002Fcreate-secret` before proceeding.\n\n### Step 4: Collect Container Image Details (skip for Prisma Cloud \u002F Wiz — they pull from registry via connector)\n\nAsk the user which registry type their image is in, then collect the fields for that type:\n\n---\n\n**Option A — Harness Registry**\n\nThe image is stored in the Harness internal container registry.\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Registry | Yes | Harness registry connector ref (e.g., `account.account-level-test`) |\n| Image Path | Yes | e.g., `harness\u002Ftodolist-sample` — maps to `image_path` in YAML |\n\nYAML:\n```yaml\n      image:\n        type: harness\n        registry: \u003Charness_registry_connector_ref>\n        image_path: \u003Cimage_path>\n```\n\n---\n\n**Option B — Third-Party Registry** (Docker Hub, ECR, GCR, ACR, JFrog, etc.)\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Type | Yes | Registry protocol — almost always `docker_v2` |\n| Domain | No | Defaults to `docker.io`. For ECR: `123456789.dkr.ecr.us-east-1.amazonaws.com`, for GCR: `gcr.io` |\n| Name | Yes | Image name, e.g., `harness\u002Ftodolist-sample` or `myorg\u002Fmyapp` |\n| Tag \u002F Digest | Yes | e.g., `latest`, `123`, or `sha256:1234567890abcdef...` |\n| Access Id | No | Secret ref for private registry username\u002Faccess key, e.g., `\u003C+secrets.getValue(\"project.access_id\")>` |\n| Access Token | No | Secret ref for private registry password\u002Ftoken, e.g., `\u003C+secrets.getValue(\"project.access_token\")>` |\n\nYAML:\n```yaml\n      image:\n        type: docker_v2\n        domain: \u003Cdomain>              # omit if Docker Hub (docker.io)\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n        access_id: \u003C+secrets.getValue(\"project.access_id\")>     # omit if public image\n        access_token: \u003C+secrets.getValue(\"project.access_token\")>  # omit if public image\n```\n\n---\n\n**Option C — Local (image built in this stage)**\n\nThe image was built earlier in the same pipeline stage and is available locally on the build node.\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Name | Yes | Image name, e.g., `harness\u002Ftodolist-sample` |\n| Tag \u002F Digest | Yes | e.g., `latest`, `123`, or `sha256:1234567890abcdef...` |\n| Domain | No | Defaults to `docker.io` |\n\nYAML:\n```yaml\n      image:\n        type: local_image\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n        domain: \u003Cdomain>   # omit if not needed\n```\n\n---\n\n**Default:** Third-Party → Docker Hub (`docker_v2`, domain `docker.io`) with `latest` tag if the user doesn't specify.\n\n### Step 4: Collect Infrastructure Details (if needed)\n\n**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.\n\nIf a new `SecurityTests` stage is being created and infrastructure is not yet defined, ask for:\n- **Delegate connector** (e.g., `account.stoqadelegate`)\n- **Namespace** (e.g., `harness-delegate`)\n\n### Step 5: Generate the Scanner Step YAML\n\nUse the step `type` from the scanner mapping in Step 3. Examples below.\n\n**For Harness SCA (default scanner):**\n\n```yaml\n- step:\n    type: HarnessSCA\n    name: Container_Scan\n    identifier: Container_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      advanced:\n        log:\n          level: info\n      resources:\n        limits:\n          memory: 2G\n          cpu: 1000m\n      privileged: true\n      image:\n        \u003Cuse the image block from Step 4 based on registry type>\n```\n\nUse the `image` block generated in Step 4 (Harness \u002F Third-Party \u002F Local). The rest of the step spec is identical regardless of registry type.\n\n**For Aqua Trivy (open-source):**\n\n```yaml\n- step:\n    type: AquaTrivy\n    name: Aqua_Trivy_Scan\n    identifier: Aqua_Trivy_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      advanced:\n        log:\n          level: info\n      privileged: true\n      image:\n        type: docker_v2\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n```\n\n**For Grype (open-source):**\n\n```yaml\n- step:\n    type: Grype\n    name: Grype_Scan\n    identifier: Grype_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      advanced:\n        log:\n          level: info\n      privileged: true\n      image:\n        type: docker_v2\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n```\n\n**For commercial scanners — add an `auth` block with scanner product credentials:**\n\n```yaml\n- step:\n    type: Snyk                       # or PrismaCloud, AnchoreEnterprise, BlackDuck, Wiz\n    name: Snyk_Container_Scan\n    identifier: Snyk_Container_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      auth:\n        access_id: \u003C+secrets.getValue(\"project.snyk_access_id\")>     # omit if scanner only needs token\n        access_token: \u003C+secrets.getValue(\"project.snyk_api_token\")>\n      advanced:\n        log:\n          level: info\n      privileged: true\n      image:\n        type: docker_v2\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n```\n\nUse 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).\n\n### Step 6: Build the Updated Pipeline YAML\n\n**Scenario A — Adding to an existing `CI` stage:**\n\nInsert 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:\n\n```yaml\n- step:\n    type: HarnessSCA\n    name: Container_Scan\n    identifier: Container_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      advanced:\n        log:\n          level: info\n      resources:\n        limits:\n          memory: 2G\n          cpu: 1000m\n      privileged: true\n      image:\n        type: docker_v2\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n```\n\n**Scenario B — Adding to an existing `SecurityTests` stage:**\n\nInsert the step into `spec.execution.steps` of the existing stage. Ensure the stage has:\n- `cloneCodebase: false`\n- `privileged: true` on the step\n\n**Scenario C — No suitable stage exists, creating a new `SecurityTests` stage:**\n\nAppend a new stage to the pipeline:\n\n```yaml\n- stage:\n    name: Container Scan\n    identifier: Container_Scan_Stage\n    type: SecurityTests\n    spec:\n      cloneCodebase: false\n      infrastructure:\n        type: KubernetesDirect\n        spec:\n          connectorRef: \u003Cdelegate_connector>\n          namespace: \u003Cnamespace>\n          automountServiceAccountToken: true\n          nodeSelector: {}\n          os: Linux\n      execution:\n        steps:\n          - step:\n              type: HarnessSCA\n              name: Container_Scan\n              identifier: Container_Scan\n              spec:\n                mode: orchestration\n                config: default\n                target:\n                  type: container\n                  detection: auto\n                advanced:\n                  log:\n                    level: info\n                resources:\n                  limits:\n                    memory: 2G\n                    cpu: 1000m\n                privileged: true\n                image:\n                  type: docker_v2\n                  name: \u003Cimage_name>\n                  tag: \u003Ctag>\n```\n\n### Step 7: Update Pipeline via MCP\n\n```\nCall MCP tool: harness_update\nParameters:\n  resource_type: \"pipeline\"\n  resource_id: \"\u003Cpipeline_identifier>\"\n  org_id: \"\u003Corganization>\"\n  project_id: \"\u003Cproject>\"\n  body: { yamlPipeline: \"\u003Cupdated pipeline YAML string>\" }\n```\n\n### Step 8: Provide Summary and Next Steps\n\n```\n## Container Scan Configured\n\n**Pipeline:** \u003Cpipeline_name>\n**Scanner:** \u003Cscanner_name> (\u003Cscanner_type>)\n**Stage:** \u003Cstage_name> (SecurityTests)\n**Image:** \u003Cimage_name>:\u003Ctag>\n**Registry:** \u003Cregistry_type>\n\n**Pipeline URL:** https:\u002F\u002Fapp.harness.io\u002Fng\u002Faccount\u002F\u003Caccount_id>\u002Fmodule\u002Fsto\u002Forgs\u002F\u003Corg_id>\u002Fprojects\u002F\u003Cproject_id>\u002Fpipelines\u002F\u003Cpipeline_id>\u002Fpipeline-studio\u002F\n\n### Next Steps\n1. Run the pipeline to verify the scan step executes successfully\n2. View scan results in the Security Tests tab of the execution\n3. Set failure thresholds using `failOnSeverity` (CRITICAL, HIGH, MEDIUM, LOW) in the step's Advanced tab\n4. Configure exemptions for false positives via `\u002Fsecurity-report` skill\n5. Enforce pipeline gates on severity via `\u002Fcreate-policy` skill\n```\n\n## Examples\n\n### Scan a public Docker Hub image\n\n```\n\u002Fcreate-container-scan\nAdd a container scan to my pipeline for the image johnkday\u002Fnodegoat:latest\n```\n\n### Scan a private ECR image\n\n```\n\u002Fcreate-container-scan\nAdd container scanning to my deploy pipeline. The image is in ECR:\n123456789.dkr.ecr.us-east-1.amazonaws.com\u002Fmy-service:v2.1.0\nUse our ECR credentials stored in secrets.\n```\n\n### Add scan before deployment\n\n```\n\u002Fcreate-container-scan\nI want to scan my Docker image myorg\u002Fapi-server:latest before it gets deployed.\nAdd it to the existing SecurityTests stage in my backend-deploy pipeline.\n```\n\n## Performance Notes\n\n- Only works with **existing pipelines** — do not offer to create a new standalone pipeline\n- Always ask the user which scanner they want — present the full list; default to **Harness SCA** if not specified\n- `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 exists\n- For commercial scanners (Snyk, Prisma Cloud, Anchore, Black Duck, Wiz), always ask for scanner product credentials (`auth.access_id` \u002F `auth.access_token`) before generating YAML — these are different from registry credentials\n- If required secrets don't exist yet, prompt the user to create them via `\u002Fcreate-secret` before proceeding\n- `auth` block sits at the step `spec` level, separate from `image` credentials\n- Always set `privileged: true` on the `HarnessSCA` step — it is required for container scanning\n- Only ask for delegate infrastructure when creating a **new** `SecurityTests` stage — existing stages already have infrastructure\n- Only set `cloneCodebase: false` on `SecurityTests` stages — CI stages already manage their own codebase setting\n- Default to `mode: orchestration` and `config: default` unless the user specifies otherwise\n- Set resource limits of `memory: 2G` and `cpu: 1000m` to avoid OOM failures during scan\n- For ECR images, domain must include the full registry URL, not just the region\n\n## Troubleshooting\n\n### Pipeline Not Found\n- Verify `org_id` and `project_id` are correct\n- Confirm the pipeline exists with `harness_list` (resource_type: \"pipeline\")\n\n### Scan Step Fails with Permission Error\n- Ensure `privileged: true` is set on the step spec\n- Verify the delegate has Docker socket access in the namespace\n\n### Image Pull Failure\n- For private registries, ensure `image.access_id` and `image.access_token` reference valid secrets\n- For ECR, confirm the delegate has the correct IAM role to pull images\n- For Docker Hub, check rate limits; supply credentials to avoid anonymous pull limits\n\n### Scanner Authentication Failure (commercial scanners)\n- Verify `auth.access_token` (and `auth.access_id` where required) reference valid Harness secrets\n- Confirm the secret identifiers match exactly — check with `harness_get(resource_type=\"secret\")`\n- For Snyk: only `access_token` is needed (API token), not `access_id`\n- For Prisma Cloud \u002F Wiz \u002F Anchore: both `access_id` and `access_token` are required\n- If secrets don't exist, create them first via `\u002Fcreate-secret` then re-run the skill\n\n### No Results in Security Tests Tab\n- Confirm STO module is enabled for the account\n- Check the execution logs for scanner errors\n- Verify the image name and tag are correct and the image exists in the registry\n\n### Pipeline Update Validation Errors\n- Verify YAML indentation (2 spaces throughout)\n- Ensure step `identifier` matches pattern `^[a-zA-Z_][0-9a-zA-Z_]{0,127}$`\n- Confirm the `SecurityTests` stage has a valid `infrastructure` block with a working delegate connector\n","# Configure Container Scan\n\nAdd a container image scanning step to an existing Harness pipeline using the native `HarnessSCA` STO scanner.\n\n## Instructions\n\n### Step 1: Establish Scope and Pipeline Context\n\nAsk for org, project, and pipeline identifier if not already known. This skill only works with existing pipelines.\n\n```\nCall MCP tool: harness_get\nParameters:\n  resource_type: \"pipeline\"\n  resource_id: \"\u003Cpipeline_identifier>\"\n  org_id: \"\u003Corganization>\"\n  project_id: \"\u003Cproject>\"\n```\n\n### Step 2: Analyze Pipeline Structure\n\nParse the pipeline YAML to identify:\n- All stages and their types (`CI`, `SecurityTests`, `Deployment`, `Approval`)\n- Whether a `SecurityTests` stage already exists\n- Existing steps in each stage\n\nPresent the structure to the user:\n\n```\nPipeline: \u003Cname>\n\nStage 1: \u003Cstage_name> (type: \u003Cstage_type>)\n  - Step 1: \u003Cstep_name> (type: \u003Cstep_type>)\n  ...\n```\n\n**Ask the user where they want the scanner step added:**\n\nPresent the available insertion points:\n- Any existing `CI` stage (scanner step is added directly into that stage's `execution.steps`)\n- Any existing `SecurityTests` stage (scanner step is added into that stage's `execution.steps`)\n- A new `SecurityTests` stage (appended to the pipeline if no suitable stage exists or user prefers isolation)\n\n**Recommendation guidance:**\n- Adding into an existing `CI` stage — simpler, no extra infrastructure needed, scan runs as part of the build\n- Adding a new `SecurityTests` stage — isolated, runs independently, useful when scanning images built elsewhere or from a registry\n\nIf the user doesn't specify, default to adding inside the existing `CI` stage if one exists.\n\n### Step 3: Recommend Scanner Type\n\nPresent the available container image scanners supported in Harness STO:\n\n**Available Container Scanners:**\n- **Harness SCA** (default — native Harness container scanner, zero config)\n- **Aqua Trivy** (open-source, broad OS and library coverage)\n- **Grype** (open-source by Anchore, fast and accurate)\n- **Snyk** (commercial, developer-friendly with fix advice)\n- **Prisma Cloud** (commercial, enterprise runtime + image scanning)\n- **Anchore Enterprise** (commercial, policy-based enforcement)\n- **Black Duck** (commercial, license compliance + vulnerabilities)\n- **Wiz** (commercial, cloud-native security)\n\n**Default recommendation:** Use **Harness SCA** — native, no additional credentials required, and integrates directly with Harness STO results.\n\nAsk the user which scanner they prefer. If they don't specify, use Harness SCA as the default.\n\n**Step type mapping and scanner product auth requirements:**\n\n| Scanner | `type` field | Product auth needed? | Auth fields |\n|---------|-------------|----------------------|-------------|\n| Harness SCA | `HarnessSCA` | No | — |\n| Aqua Trivy | `AquaTrivy` | No | — |\n| Grype | `Grype` | No | — |\n| Snyk | `Snyk` | Yes | `access_token` (Snyk API token) |\n| Prisma Cloud | `PrismaCloud` | Yes | `access_id` (Access Key), `access_token` (Secret Key) |\n| Anchore Enterprise | `AnchoreEnterprise` | Yes | `access_id` (username), `access_token` (password\u002FAPI key) |\n| Black Duck | `BlackDuck` | Yes | `access_token` (Hub API token) |\n| Wiz | `Wiz` | Yes | `access_id` (Client ID), `access_token` (Client Secret) |\n\n**If the user picks a commercial scanner (Snyk, Prisma Cloud, Anchore Enterprise, Black Duck, Wiz):**\n\n1. Inform the user that this scanner requires product-level authentication credentials\n2. Ask for the required secret references from the table above — these must already exist as Harness secrets\n3. Format them as `\u003C+secrets.getValue(\"project.\u003Csecret_identifier>\")>`\n4. These go into the `auth` block of the step spec — separate from the registry image credentials\n\nExample prompt to user:\n> \"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 `\u003C+secrets.getValue(\"project.snyk_api_token\")>`.\"\n\nIf the secret doesn't exist yet, suggest creating it first via `\u002Fcreate-secret` before proceeding.\n\n### Step 4: Collect Container Image Details (skip for Prisma Cloud \u002F Wiz — they pull from registry via connector)\n\nAsk the user which registry type their image is in, then collect the fields for that type:\n\n---\n\n**Option A — Harness Registry**\n\nThe image is stored in the Harness internal container registry.\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Registry | Yes | Harness registry connector ref (e.g., `account.account-level-test`) |\n| Image Path | Yes | e.g., `harness\u002Ftodolist-sample` — maps to `image_path` in YAML |\n\nYAML:\n```yaml\n      image:\n        type: harness\n        registry: \u003Charness_registry_connector_ref>\n        image_path: \u003Cimage_path>\n```\n\n---\n\n**Option B — Third-Party Registry** (Docker Hub, ECR, GCR, ACR, JFrog, etc.)\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Type | Yes | Registry protocol — almost always `docker_v2` |\n| Domain | No | Defaults to `docker.io`. For ECR: `123456789.dkr.ecr.us-east-1.amazonaws.com`, for GCR: `gcr.io` |\n| Name | Yes | Image name, e.g., `harness\u002Ftodolist-sample` or `myorg\u002Fmyapp` |\n| Tag \u002F Digest | Yes | e.g., `latest`, `123`, or `sha256:1234567890abcdef...` |\n| Access Id | No | Secret ref for private registry username\u002Faccess key, e.g., `\u003C+secrets.getValue(\"project.access_id\")>` |\n| Access Token | No | Secret ref for private registry password\u002Ftoken, e.g., `\u003C+secrets.getValue(\"project.access_token\")>` |\n\nYAML:\n```yaml\n      image:\n        type: docker_v2\n        domain: \u003Cdomain>              # omit if Docker Hub (docker.io)\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n        access_id: \u003C+secrets.getValue(\"project.access_id\")>     # omit if public image\n        access_token: \u003C+secrets.getValue(\"project.access_token\")>  # omit if public image\n```\n\n---\n\n**Option C — Local (image built in this stage)**\n\nThe image was built earlier in the same pipeline stage and is available locally on the build node.\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Name | Yes | Image name, e.g., `harness\u002Ftodolist-sample` |\n| Tag \u002F Digest | Yes | e.g., `latest`, `123`, or `sha256:1234567890abcdef...` |\n| Domain | No | Defaults to `docker.io` |\n\nYAML:\n```yaml\n      image:\n        type: local_image\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n        domain: \u003Cdomain>   # omit if not needed\n```\n\n---\n\n**Default:** Third-Party → Docker Hub (`docker_v2`, domain `docker.io`) with `latest` tag if the user doesn't specify.\n\n### Step 4: Collect Infrastructure Details (if needed)\n\n**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.\n\nIf a new `SecurityTests` stage is being created and infrastructure is not yet defined, ask for:\n- **Delegate connector** (e.g., `account.stoqadelegate`)\n- **Namespace** (e.g., `harness-delegate`)\n\n### Step 5: Generate the Scanner Step YAML\n\nUse the step `type` from the scanner mapping in Step 3. Examples below.\n\n**For Harness SCA (default scanner):**\n\n```yaml\n- step:\n    type: HarnessSCA\n    name: Container_Scan\n    identifier: Container_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      advanced:\n        log:\n          level: info\n      resources:\n        limits:\n          memory: 2G\n          cpu: 1000m\n      privileged: true\n      image:\n        \u003Cuse the image block from Step 4 based on registry type>\n```\n\nUse the `image` block generated in Step 4 (Harness \u002F Third-Party \u002F Local). The rest of the step spec is identical regardless of registry type.\n\n**For Aqua Trivy (open-source):**\n\n```yaml\n- step:\n    type: AquaTrivy\n    name: Aqua_Trivy_Scan\n    identifier: Aqua_Trivy_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      advanced:\n        log:\n          level: info\n      privileged: true\n      image:\n        type: docker_v2\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n```\n\n**For Grype (open-source):**\n\n```yaml\n- step:\n    type: Grype\n    name: Grype_Scan\n    identifier: Grype_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      advanced:\n        log:\n          level: info\n      privileged: true\n      image:\n        type: docker_v2\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n```\n\n**For commercial scanners — add an `auth` block with scanner product credentials:**\n\n```yaml\n- step:\n    type: Snyk                       # or PrismaCloud, AnchoreEnterprise, BlackDuck, Wiz\n    name: Snyk_Container_Scan\n    identifier: Snyk_Container_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      auth:\n        access_id: \u003C+secrets.getValue(\"project.snyk_access_id\")>     # omit if scanner only needs token\n        access_token: \u003C+secrets.getValue(\"project.snyk_api_token\")>\n      advanced:\n        log:\n          level: info\n      privileged: true\n      image:\n        type: docker_v2\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n```\n\nUse 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).\n\n### Step 6: Build the Updated Pipeline YAML\n\n**Scenario A — Adding to an existing `CI` stage:**\n\nInsert 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:\n\n```yaml\n- step:\n    type: HarnessSCA\n    name: Container_Scan\n    identifier: Container_Scan\n    spec:\n      mode: orchestration\n      config: default\n      target:\n        type: container\n        detection: auto\n      advanced:\n        log:\n          level: info\n      resources:\n        limits:\n          memory: 2G\n          cpu: 1000m\n      privileged: true\n      image:\n        type: docker_v2\n        name: \u003Cimage_name>\n        tag: \u003Ctag>\n```\n\n**Scenario B — Adding to an existing `SecurityTests` stage:**\n\nInsert the step into `spec.execution.steps` of the existing stage. Ensure the stage has:\n- `cloneCodebase: false`\n- `privileged: true` on the step\n\n**Scenario C — No suitable stage exists, creating a new `SecurityTests` stage:**\n\nAppend a new stage to the pipeline:\n\n```yaml\n- stage:\n    name: Container Scan\n    identifier: Container_Scan_Stage\n    type: SecurityTests\n    spec:\n      cloneCodebase: false\n      infrastructure:\n        type: KubernetesDirect\n        spec:\n          connectorRef: \u003Cdelegate_connector>\n          namespace: \u003Cnamespace>\n          automountServiceAccountToken: true\n          nodeSelector: {}\n          os: Linux\n      execution:\n        steps:\n          - step:\n              type: HarnessSCA\n              name: Container_Scan\n              identifier: Container_Scan\n              spec:\n                mode: orchestration\n                config: default\n                target:\n                  type: container\n                  detection: auto\n                advanced:\n                  log:\n                    level: info\n                resources:\n                  limits:\n                    memory: 2G\n                    cpu: 1000m\n                privileged: true\n                image:\n                  type: docker_v2\n                  name: \u003Cimage_name>\n                  tag: \u003Ctag>\n```\n\n### Step 7: Update Pipeline via MCP\n\n```\nCall MCP tool: harness_update\nParameters:\n  resource_type: \"pipeline\"\n  resource_id: \"\u003Cpipeline_identifier>\"\n  org_id: \"\u003Corganization>\"\n  project_id: \"\u003Cproject>\"\n  body: { yamlPipeline: \"\u003Cupdated pipeline YAML string>\" }\n```\n\n### Step 8: Provide Summary and Next Steps\n\n```\n## Container Scan Configured\n\n**Pipeline:** \u003Cpipeline_name>\n**Scanner:** \u003Cscanner_name> (\u003Cscanner_type>)\n**Stage:** \u003Cstage_name> (SecurityTests)\n**Image:** \u003Cimage_name>:\u003Ctag>\n**Registry:** \u003Cregistry_type>\n\n**Pipeline URL:** https:\u002F\u002Fapp.harness.io\u002Fng\u002Faccount\u002F\u003Caccount_id>\u002Fmodule\u002Fsto\u002Forgs\u002F\u003Corg_id>\u002Fprojects\u002F\u003Cproject_id>\u002Fpipelines\u002F\u003Cpipeline_id>\u002Fpipeline-studio\u002F\n\n### Next Steps\n1. Run the pipeline to verify the scan step executes successfully\n2. View scan results in the Security Tests tab of the execution\n3. Set failure thresholds using `failOnSeverity` (CRITICAL, HIGH, MEDIUM, LOW) in the step's Advanced tab\n4. Configure exemptions for false positives via `\u002Fsecurity-report` skill\n5. Enforce pipeline gates on severity via `\u002Fcreate-policy` skill\n```\n\n## Examples\n\n### Scan a public Docker Hub image\n\n```\n\u002Fcreate-container-scan\nAdd a container scan to my pipeline for the image johnkday\u002Fnodegoat:latest\n```\n\n### Scan a private ECR image\n\n```\n\u002Fcreate-container-scan\nAdd container scanning to my deploy pipeline. The image is in ECR:\n123456789.dkr.ecr.us-east-1.amazonaws.com\u002Fmy-service:v2.1.0\nUse our ECR credentials stored in secrets.\n```\n\n### Add scan before deployment\n\n```\n\u002Fcreate-container-scan\nI want to scan my Docker image myorg\u002Fapi-server:latest before it gets deployed.\nAdd it to the existing SecurityTests stage in my backend-deploy pipeline.\n```\n\n## Performance Notes\n\n- Only works with **existing pipelines** — do not offer to create a new standalone pipeline\n- Always ask the user which scanner they want — present the full list; default to **Harness SCA** if not specified\n- `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 exists\n- For commercial scanners (Snyk, Prisma Cloud, Anchore, Black Duck, Wiz), always ask for scanner product credentials (`auth.access_id` \u002F `auth.access_token`) before generating YAML — these are different from registry credentials\n- If required secrets don't exist yet, prompt the user to create them via `\u002Fcreate-secret` before proceeding\n- `auth` block sits at the step `spec` level, separate from `image` credentials\n- Always set `privileged: true` on the `HarnessSCA` step — it is required for container scanning\n- Only ask for delegate infrastructure when creating a **new** `SecurityTests` stage — existing stages already have infrastructure\n- Only set `cloneCodebase: false` on `SecurityTests` stages — CI stages already manage their own codebase setting\n- Default to `mode: orchestration` and `config: default` unless the user specifies otherwise\n- Set resource limits of `memory: 2G` and `cpu: 1000m` to avoid OOM failures during scan\n- For ECR images, domain must include the full registry URL, not just the region\n\n## Troubleshooting\n\n### Pipeline Not Found\n- Verify `org_id` and `project_id` are correct\n- Confirm the pipeline exists with `harness_list` (resource_type: \"pipeline\")\n\n### Scan Step Fails with Permission Error\n- Ensure `privileged: true` is set on the step spec\n- Verify the delegate has Docker socket access in the namespace\n\n### Image Pull Failure\n- For private registries, ensure `image.access_id` and `image.access_token` reference valid secrets\n- For ECR, confirm the delegate has the correct IAM role to pull images\n- For Docker Hub, check rate limits; supply credentials to avoid anonymous pull limits\n\n### Scanner Authentication Failure (commercial scanners)\n- Verify `auth.access_token` (and `auth.access_id` where required) reference valid Harness secrets\n- Confirm the secret identifiers match exactly — check with `harness_get(resource_type=\"secret\")`\n- For Snyk: only `access_token` is needed (API token), not `access_id`\n- For Prisma Cloud \u002F Wiz \u002F Anchore: both `access_id` and `access_token` are required\n- If secrets don't exist, create them first via `\u002Fcreate-secret` then re-run the skill\n\n### No Results in Security Tests Tab\n- Confirm STO module is enabled for the account\n- Check the execution logs for scanner errors\n- Verify the image name and tag are correct and the image exists in the registry\n\n### Pipeline Update Validation Errors\n- Verify YAML indentation (2 spaces throughout)\n- Ensure step `identifier` matches pattern `^[a-zA-Z_][0-9a-zA-Z_]{0,127}$`\n- Confirm the `SecurityTests` stage has a valid `infrastructure` block with a working delegate connector\n",{"name":5,"license":14,"metadata":23,"description":7,"compatibility":27},{"author":24,"version":25,"mcp-server":26},"Harness","1.0.0","harness-mcp-v2","Requires Harness MCP v2 server (harness-mcp-v2)","main","f3af6b6781621109871cca9e2989364afc509f3d","harnesses\u002Fharness-skills\u002Fskills\u002Fconfigure-container-scan","https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository","https:\u002F\u002Fgithub.com\u002FAdmiralGallade","Eager to learn!\r\nI'll do anything for more knowledge anywhere.","2026-06-06 07:34:31",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add AdmiralGallade\u002Fharness-repository --skill configure-container-scan",{"tool":41,"command":42},"bunx","bunx skills add AdmiralGallade\u002Fharness-repository --skill configure-container-scan",{"tool":44,"command":45},"pnpm","pnpm dlx skills add AdmiralGallade\u002Fharness-repository --skill configure-container-scan","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository\u002Fblob\u002Fmain\u002Fharnesses\u002Fharness-skills\u002Fskills\u002Fconfigure-container-scan\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":18},"01M75JSM6WGJ71BTHM6VC8CJ1X","verify-sign","Add an Artifact Verification (SscaArtifactVerification) step to an existing Harness pipeline to verify Cosign signatures on container or local-stage artifacts. Supports CI, Security, and CD Deploy (containerized step group). Supports Third-Party registries (Docker, ECR, GCR, GAR, ACR), Harness Artifact Registry (HAR), and Harness Local Stage artifacts. Only works with existing pipelines. Use when asked to verify signed artifacts, verify artifact signature, verify-sign, validate Cosign signature, or configure SscaArtifactVerification. Trigger phrases: verify sign, verify artifact, artifact verification, verify signature, verify-sign, SscaArtifactVerification, verify signed image, verify Cosign, HAR verification.","https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository\u002Fblob\u002Fmain\u002Fharnesses\u002Fharness-skills\u002Fskills\u002Fverify-sign\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M75JSDSTP77TFM3JFGBB8QKP","template-usage","Track Harness template dependencies, usage, and adoption via MCP v2 tools. Find which pipelines or other templates reference a given template, analyze update impact, identify unused templates, and compare version adoption. Use when asked about template usage, template references, template dependencies, impact analysis before updating a template, finding unused templates, or tracking template adoption across projects. Trigger phrases: template usage, who uses template, template references, template dependencies, template impact, unused templates, template adoption. Do NOT use for creating or updating templates (use create-template instead).","https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository\u002Fblob\u002Fmain\u002Fharnesses\u002Fharness-skills\u002Fskills\u002Ftemplate-usage\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M75JS76Q2KC8PD598H2DZZRA","sign-artifact","Add an Artifact Signing (SscaArtifactSigning) step to an existing Harness pipeline to Cosign-sign container or local-stage artifacts with keyless, key-based, or Vault signing. Supports Third-Party registries (Docker, ECR, GCR, GAR, ACR), Harness Artifact Registry (HAR), and Harness Local Stage artifacts. Place after image build\u002Fpush; optionally upload .sig to the registry. Only works with existing pipelines. Use when asked to sign artifacts, add artifact signing, Cosign sign image, attach signature to registry, or configure SscaArtifactSigning. Trigger phrases: sign artifact, artifact signing, sign image, Cosign sign, add signing step, SscaArtifactSigning, attach signature, sign container image, HAR signing.","https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository\u002Fblob\u002Fmain\u002Fharnesses\u002Fharness-skills\u002Fskills\u002Fsign-artifact\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M75JS16EEFFHA44EBNE8KWNT","sei-analytics","Advanced engineering analytics via Harness Software Engineering Insights (SEI) MCP. Configure sprint velocity and estimation accuracy tracking, engineering investment allocation breakdowns, sprint planning with capacity forecasts, and release readiness assessments. Use when asked about sprint analytics, investment allocation, sprint planning, capacity forecasting, or release readiness. Do NOT use for DORA metrics (use dora-metrics instead). Trigger phrases: sprint velocity, sprint analytics, investment allocation, capacity planning, sprint forecast, release readiness, engineering productivity, estimation accuracy, sprint planning, scope creep, code quality trends.","https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository\u002Fblob\u002Fmain\u002Fharnesses\u002Fharness-skills\u002Fskills\u002Fsei-analytics\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M75JRWE3X3E7V9JFQ4ENZYZM","security-report","Generate security compliance reports using Harness SCS and STO via MCP. Analyze vulnerabilities, SBOMs, and manage exemptions. Use when user says \"security report\", \"vulnerabilities\", \"SBOM\", \"security scan\", \"compliance check\", or asks about application security.","https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository\u002Fblob\u002Fmain\u002Fharnesses\u002Fharness-skills\u002Fskills\u002Fsecurity-report\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M75JRSFJSNZFZRFKX8MSPCS2","scorecard-review","Review service maturity scorecards and compliance using Harness IDP via MCP. Check production readiness, security, and documentation scores. Use when user says \"scorecard\", \"service maturity\", \"production readiness\", \"compliance score\", or asks about service health scores.","https:\u002F\u002Fgithub.com\u002FAdmiralGallade\u002Fharness-repository\u002Fblob\u002Fmain\u002Fharnesses\u002Fharness-skills\u002Fskills\u002Fscorecard-review\u002FSKILL.md",[],[]]