Announcing Beacon: Self-improving memory for coding agents
← All skills
Skill

scanning-docker-images-with-trivy

skill:mukul975/anthropic-cybersecurity-skills#scanning-docker-images-with-trivy

Scans a Docker image with Trivy for vulnerabilities in OS packages and language dependencies, misconfiguration, exposed secrets, and licence violations, emitting SARIF, CycloneDX, or SPDX output. Use when scanning or gating a specific image, wiring an image scan into CI/CD, or checking an image during an incident investigation. Keywords: Trivy, image scan, --severity, --exit-code, SARIF, ignore file, .trivyignore. Do not use for cluster-wide scanning or non-image targets - use performing-container-security-scanning-with-trivy; when the toolchain is Grype use scanning-container-images-with-grype.

Verdict
Suspicious

Risky behavior the analysis could not rule out.

Analyzed Oct 27, 2026, 22:49 UTC at 54a7988

Dispute security verdict

If you believe this verdict is incorrect, submit a dispute and we'll review it.

5
findings
high
highest severity
3
threat classes
4,532
files scanned
166/171
checks satisfied
0
package advisories

Why this verdict

  • suspicious: finding skill:skills/scanning-docker-images-with-trivy:skills/scanning-docker-images-with-trivy/SKILL.md:157:RECON
  • suspicious: finding skill:skills/scanning-docker-images-with-trivy:skills/scanning-docker-images-with-trivy/SKILL.md:183:SUPPLY
  • suspicious: finding skill:skills/scanning-docker-images-with-trivy:skills/scanning-docker-images-with-trivy/references/workflows.md:110:EXEC
  • suspicious: finding skill:skills/scanning-docker-images-with-trivy:skills/scanning-docker-images-with-trivy/references/workflows.md:96:RECON
  • suspicious: finding skill:skills/scanning-docker-images-with-trivy:skills/scanning-docker-images-with-trivy/references/workflows.md:97:RECON

Security findings 5

Code execution

highContextual riskmedium confidence

Workflow 5 in references/workflows.md instructs running 'python3 aggregate_trivy_results.py scan_*.json', a script the artifact does not ship, so following the workflow executes whatever exists at that path at runtime, whose content is unreviewable.

python3 aggregate_trivy_results.py scan_*.json > fleet_report.json
vector:instruction
Counter-argument considered

The workflow concretely instructs executing aggregate_trivy_results.py from the runtime working directory; that script is not shown anywhere in the artifact, and an instruction to run content the artifact does not ship makes the agent execute whatever sits at that path, so the finding stands and is not refutable.

Supply chain

mediumContextual risklow confidence

The CI/CD integration example wires scanning through the GitHub Action at the mutable, unpinned ref aquasecurity/trivy-action@master, which executes whatever code that branch points to at pipeline run time.

uses: aquasecurity/trivy-action@master
vector:instruction
Counter-argument considered

The skill body concretely instructs CI wiring through the mutable ref aquasecurity/trivy-action@master; the pinned-official carve-out requires pinning, which is absent here, no declaration covers instructing a mutable ref, and the source-to-pipeline-execution chain holds, so the low-severity supply finding survives.

Reconnaissance

lowContextual riskmedium confidence

Workflow 5 instructs enumerating every pod across all Kubernetes namespaces with kubectl to build a fleet-wide image list, which is cluster-wide discovery the skill's own frontmatter description declares out of scope for this skill.

IMAGES=$(kubectl get pods --all-namespaces
vector:instruction
Counter-argument considered

Workflow 5 concretely instructs cluster-wide pod enumeration across all namespaces to build the image list, which the declared description explicitly excludes, so the contradiction and instruction chain hold and nothing in the shown evidence neutralizes them.

Reconnaissance

lowContextual riskmedium confidence

Workflow 5 instructs enumerating every container image across all Kubernetes namespaces via a read-only kubectl query, exceeding the skill's declared scope that excludes cluster-wide scanning.

kubectl get pods --all-namespaces
vector:instruction
Counter-argument considered

This is the same concrete cluster-wide kubectl enumeration as the line-96 finding; the declared scope explicitly excludes it, and its read-only nature lowers severity but is not a carve-out or a declaration, so the finding survives.

Reconnaissance

lowContextual risklow confidence

Undeclared scope: Step 4 instructs trivy config scans of Kubernetes manifests, Helm charts, and Terraform, which are non-image targets the declared description explicitly routes to a different skill, so this capability is not covered by the declared purpose.

trivy config k8s-deployment.yaml
vector:instruction
Counter-argument considered

The claim is accurate: Step 4 of the skill body concretely instructs trivy config scans of manifests, Helm charts and Terraform, while the frontmatter explicitly routes non-image targets to a different skill, so the undeclared-scope contradiction holds and no carve-out or mitigation neutralizes it.

Open questions 1

What the analysis could not settle from the code alone.

[file request skills/scanning-docker-images-with-trivy/aggregate_trivy_results.py] Does the artifact ship aggregate_trivy_results.py, and if served, what does the script do beyond summarizing the trivy JSON outputs it reads?
Code execution
Refuted findings 1

Candidates the review stage examined and rejected, kept for transparency.

Credential access

criticalRefutedlow confidence

The private-registry section directs use of the Docker credential store ~/.docker/config.json and an AWS ECR login password piped into docker login so that registry credentials are handled during authenticated image scans.

# Docker Hub (uses ~/.docker/config.json)
Why it was refuted

Refuted: the flagged credential handling is the canonical authentication path for the declared image-scanning capability - the ECR token is piped only to its own registry via docker login --password-stdin and TRIVY_USERNAME/TRIVY_PASSWORD are env credentials for the wrapped scanner, with no exfiltration sink - so the harm and undeclared gates fail and the CRED flag is a false positive.

Coverage gaps 9

Parts of the artifact the static analysis could not fully examine.

ledger_finding_without_valid_finding run 1: instruction-surface.0 SRC:b8ccbb23ce2c8dce
ledger_finding_without_valid_finding run 1: declared-vs-actual.0 SRC:b8ccbb23ce2c8dce
ledger_finding_without_valid_finding run 1: behavior-chains.0 SRC:fab4f1d75b88f0e9
ledger_finding_without_valid_finding run 1: behavior-chains.0 SRC:b8ccbb23ce2c8dce
ledger_finding_without_valid_finding run 1: behavior-chains.0 SRC:f13b1dc9321868e6
invalid_judge_finding instruction-surface.0
invalid_judge_finding declared-vs-actual.0
invalid_judge_finding behavior-chains.0
invalid_judge_finding request.1