Dagweave catalog

Scan for vulnerabilities with Trivy

trivy-scanv1.0.3updated 2026-08-184 versions

Scan a container image or a filesystem path for known vulnerabilities with Trivy, optionally failing the step on findings.

Install v1.0.3

Installs the template into your Argo namespace. The URL is pinned to this version.

kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/trivy-scan/1.0.3/template.yaml

Or with the Argo CLI:

argo template create -n argo https://catalog.dagweave.com/api/v1/items/trivy-scan/1.0.3/template.yaml

Facts

Category
CI/CD
Tags
ci-cd trivy
Entrypoint
scan
Template SHA-256
4c791b4cd136dfc7a7c34b1e83460f307a1b0a2191679734028e64a56bdb20be
Source
trivy-scan at catalog commit 67458f7
API
item document, latest template.yaml

Images and provenance

Every image is pinned by digest, so a rebuilt tag can never change what this version runs.

RepositoryTagDigest
aquasec/trivy0.76.1sha256:790fd66d1697395d8693d1acaa1ea702406a20f109b6fc7bac8db623eca6c06c

Parameters

NameDescriptionDefault
target required An image reference or a filesystem path to scan.
Example ghcr.io/org/app:1.2.3
none
exit-on-findings When "true", the step fails if any matching vulnerability is found; when "false", it always reports and succeeds.
One of true, false
true
severity Comma-separated severities to report.
Example CRITICAL,HIGH
CRITICAL,HIGH

WorkflowTemplate

Download template.yaml

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: trivy-scan
  labels:
    dagweave.io/catalog-item: trivy-scan
  annotations:
    # The catalog semver this manifest was authored at. The dagweave app records
    # (catalog-item-id, semver) -> content-hash -> base-vN when it mints the tenant
    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.
    dagweave.io/catalog-version: "1.0.3"
    dagweave.io/catalog-category: "CI/CD"
spec:
  entrypoint: scan
  templates:
    - name: scan
      inputs:
        parameters:
          # What to scan: an image reference (e.g. alpine:3.21) or a filesystem path.
          # If the target exists as a path in the container it is scanned as a
          # filesystem, otherwise it is treated as an image reference.
          - name: target
          # Comma-separated severities to report.
          - name: severity
            default: "CRITICAL,HIGH"
          # When "true", the step fails (exit 1) if any matching vulnerability is
          # found; when "false", it always reports and succeeds.
          - name: exit-on-findings
            default: "true"
      container:
        # Pinned by digest per the catalog convention: an image rebuild can never
        # silently change the behaviour of an already-released item version.
        # aquasec/trivy:0.76.1
        image: aquasec/trivy@sha256:790fd66d1697395d8693d1acaa1ea702406a20f109b6fc7bac8db623eca6c06c
        command: [sh, -c]
        # The target, severity and flag are passed as env vars (below), never
        # interpolated from Argo into the shell, so values with quotes or shell
        # metacharacters are safe. The scan mode (image vs fs) is inferred from whether
        # the target resolves to a path in the container.
        args:
          - |
            set -eu
            EXIT_CODE=0
            if [ "$EXIT_ON_FINDINGS" = "true" ]; then EXIT_CODE=1; fi
            if [ -e "$TARGET" ]; then MODE=fs; else MODE=image; fi
            trivy "$MODE" --severity "$SEVERITY" --exit-code "$EXIT_CODE" "$TARGET"
        env:
          - name: TARGET
            value: "{{inputs.parameters.target}}"
          - name: SEVERITY
            value: "{{inputs.parameters.severity}}"
          - name: EXIT_ON_FINDINGS
            value: "{{inputs.parameters.exit-on-findings}}"

Version history

Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.

  1. 1.0.3 latest 2026-08-18

    Move trivy from 0.73.0 to 0.74.0. The image scans clean, so its exception record is deleted rather than rewritten: the go-git and oras-go advisories it was written for are gone, and so are the eight Go 1.26.6 stdlib ones that had landed on 0.73.0 since. Entrypoint, Cmd, User and WorkingDir are identical on both digests. This is a minor rather than a rebuild, so the CLI surface has not been re-run against a container.

    kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/trivy-scan/1.0.3/template.yaml
    argo template create -n argo https://catalog.dagweave.com/api/v1/items/trivy-scan/1.0.3/template.yaml

    version document, template.yaml

  2. 1.0.2 2026-08-11

    Move trivy from 0.72.0 to 0.73.0. Clears all 9 fixable OS advisories and takes the vendored ones from 6 to 2. The minor changes no CLI surface: image mode, fs mode, --severity and --exit-code all behave identically on both digests, exit code included.

    This release is documented, but its manifest is not vendored here, so it has no install command. Version document

  3. 1.0.1 2026-08-02

    Move trivy from 0.58.1 to 0.72.0. Fixable CRITICAL/HIGH drops from 91 to 11. Worth doing on its own terms too: the scanner this item sells was fourteen minor releases behind.

    This release is documented, but its manifest is not vendored here, so it has no install command. Version document

  4. 1.0.0 2026-07-17

    Initial release.

    This release is documented, but its manifest is not vendored here, so it has no install command. Version document

Run it once

After installing, from the command line.

argo submit -n argo --from workflowtemplate/trivy-scan \
  -p target=ghcr.io/org/app:1.2.3

Workflow that references it

A Workflow with the required parameters filled from the examples.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: trivy-scan-
spec:
  workflowTemplateRef:
    name: trivy-scan
  arguments:
    parameters:
      - name: target
        value: "ghcr.io/org/app:1.2.3"

As a step of a larger workflow

steps:
  - - name: trivy-scan
      templateRef:
        name: trivy-scan
        template: scan