YAML for Security Audit

View as Markdown

Scan Docker images, filesystem or root filesystem for vulnerabilities, secrets, misconfigurations and license issues using Trivy.

YAML parameters for Security Audit

PARAMETERS
scanrequiredScanYaml
Configuration of the scan target, enabled scanners, severities and failure policy.
typerequiredstring

Value: SECURITY_AUDIT

actionrequiredstring
Unique identifier for the action within the pipeline.
ignoreIgnoreYaml
Rules that suppress specific findings from the scan report. Each rule type is keyed by the finding category it applies to.
trigger_timestring enum
Specifies when the action should be executed. ON_SUCCESS actions run after every successful run, also one ended by an EARLY_EXIT action.
Allowed enum:
ON_EVERY_EXECUTION,
ON_SUCCESS,
ON_FAILURE,
ON_BACK_TO_SUCCESS,
ON_WARNING,
ON_WAIT_FOR_APPROVE,
ON_TERMINATE
loopstring[]
Names of the variables to loop over (IMAGES, not $IMAGES and not a value). The action runs once for each item of the value, and once for each combination of items when several variables are listed. The variable value is split into items by new lines, or by commas when it has no new lines (a single-line JSON object or key=value pairs stays one item). An item that is a JSON object or key=value pairs also sets one variable per key, named <VARIABLE>_<key>; an item that starts with EXTRACT: sets them as plain <key>.
run_only_on_first_failureboolean
When true, the action runs only on the first failure instead of on each failure. Used only when trigger_time is ON_FAILURE.
disabledboolean
When set to true the action is disabled. By default it is set to false.
timeoutinteger
The timeout in seconds. It cannot exceed the action time limit of the workspace plan; a higher value is rejected.
ignore_errorsboolean
If set to true the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions.
retry_intervalinteger
Delay time between auto retries in seconds.
retry_countinteger
Number of retries if the action fails.

Constraints: ≤ 10

run_nextstring enum
Defines whether the action should run in parallel with the next one.
Allowed enum:
WAIT_ON_SUCCESS,
IN_SOFT_PARALLEL,
IN_HARD_PARALLEL
trigger_conditionsTriggerConditionYaml[]
The list of trigger conditions to meet so that the action can be triggered.
variablesVariableYaml[]
The list of variables you can use in the action.

Outputs for Security Audit

OUTPUT VARIABLES
BUDDY_ACTION_TRIVY_OUTPUT_FILE
Path to the main result file of this action, relative to the pipeline filesystem root.

Example: .buddy/output/trivy/report_12_a1b2c3d.jsonl

OUTPUT FILES
.buddy/output/trivy/report_$BUDDY_RUN_ID_$BUDDY_ACTION_RUN_HASH.jsonl
Trivy scan results, one JSON document per line.

Last modified on Nov 19, 2026

YAML examples for Security Audit

Scan image produced by the previous action

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      image_location: "ACTION"
      from_action: "Build Docker image"

Scan the image built by the immediately preceding action

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      image_location: "ACTION"

Scan a public image from Docker Hub

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      docker_registry: "DOCKER_HUB"
      name: "alpine"
      tag: "3.18"
    scanners:
      - "VULNERABILITY"
    severities:
      - "CRITICAL"
      - "HIGH"

Scan the pipeline's filesystem with default path

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "FILESYSTEM"
    scanners:
      - "VULNERABILITY"
      - "MISCONFIGURATION"
      - "SECRET"
    severities:
      - "CRITICAL"
      - "HIGH"
      - "MEDIUM"

Scan an unpacked root filesystem

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "ROOTFS"
    path: "/buddy/app"
    scanners:
      - "VULNERABILITY"
      - "SECRET"
    severities:
      - "CRITICAL"
      - "HIGH"

Scan an image from a private Docker Hub repository

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      image_location: "PRIVATE_REGISTRY"
      docker_registry: "DOCKER_HUB"
      integration: "docker-hub"
      name: "my-org/my-app"
      tag: "v1.2.3"
    scanners:
      - "VULNERABILITY"
      - "SECRET"
      - "MISCONFIGURATION"
    severities:
      - "CRITICAL"
      - "HIGH"
      - "MEDIUM"
      - "LOW"
    fail_only_on_fixable: true

Scan an image from a private Docker Hub repository

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      image_location: "PRIVATE_REGISTRY"
      docker_registry: "DOCKER_HUB"
      integration: "docker-hub"
      name: "my-org/my-app"
      tag: "v1.2.3"
    scanners:
      - "VULNERABILITY"
      - "SECRET"
      - "MISCONFIGURATION"
    severities:
      - "CRITICAL"
      - "HIGH"
      - "MEDIUM"
      - "LOW"
    fail_only_on_fixable: true

Scan filesystem with skipped directories

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "FILESYSTEM"
    path: "/buddy/app"
    skip_paths:
      - "vendor/"
      - "node_modules/"
      - "dist/"
    scanners:
      - "VULNERABILITY"
      - "SECRET"
    severities:
      - "CRITICAL"
      - "HIGH"

Scan filesystem with ignore rules for all kinds

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "FILESYSTEM"
    scanners:
      - "VULNERABILITY"
      - "SECRET"
      - "MISCONFIGURATION"
      - "LICENSE"
    severities:
      - "CRITICAL"
      - "HIGH"
  ignore:
    vulnerabilities:
      - id: "CVE-2023-45853"
        paths:
          - "vendor/"
        statement: "No upstream fix available, accepted risk"
        expires_at: "2026-09-21"
    misconfigurations:
      - id: "AVD-DS-0001"
        statement: "Intentional configuration"
    secrets:
      - id: "generic-api-key"
        paths:
          - "tests/fixtures/"
        statement: "Test data, not a real secret"
    licenses:
      - id: "0BSD"
        statement: "Approved by legal"

Scan image and report every finding regardless of fix availability

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      image_location: "ACTION"
      from_action: "Build Docker image"
    scanners:
      - "VULNERABILITY"
      - "SECRET"
      - "MISCONFIGURATION"
    severities:
      - "CRITICAL"
      - "HIGH"
      - "MEDIUM"
    fail_only_on_fixable: false

Scan a public image from a custom registry

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      image_location: "PUBLIC_REGISTRY"
      docker_registry: "OTHER"
      registry: "myregistry.example.com"
      name: "my-app"
      tag: "v1.2.3"
    scanners:
      - "VULNERABILITY"
    severities:
      - "CRITICAL"
      - "HIGH"

Scan a private image from a custom registry using basic authentication

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      image_location: "PRIVATE_REGISTRY"
      docker_registry: "OTHER"
      registry: "myregistry.example.com"
      login: "registry-user"
      password: "registry-password"
      name: "my-app"
      tag: "v1.2.3"
    scanners:
      - "VULNERABILITY"
    severities:
      - "CRITICAL"
      - "HIGH"

Scan a private image from Amazon ECR

yaml
- action: "Security audit"
  type: "SECURITY_AUDIT"
  scan:
    type: "IMAGE"
    image:
      image_location: "PRIVATE_REGISTRY"
      docker_registry: "AMAZON_ECR"
      region: "us-east-1"
      integration: "my-ecr"
      name: "my-app"
      tag: "v1.2.3"
    scanners:
      - "VULNERABILITY"
    severities:
      - "CRITICAL"
      - "HIGH"