{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "aquasecurity-trivy--scan-a-container-image-for-cves",
 "repo": "aquasecurity/trivy",
 "repo_url": "https://github.com/aquasecurity/trivy",
 "repo_slug": "aquasecurity-trivy",
 "title": "Scan a container image for known vulnerabilities",
 "page_title": "How to scan a container image for known vulnerabilities with Trivy",
 "summary": "Run Trivy image on any image to list CVEs in its OS packages and dependencies.",
 "who": "A developer about to deploy a Docker image who wants to know what known vulnerabilities it carries.",
 "problem": "Base images and dependencies quietly accumulate CVEs, and you rarely know which ones until something breaks.",
 "outcome": "A list of vulnerabilities in the image with severities, so you can upgrade or swap the base image.",
 "steps": [
  "Install with `brew install trivy`, or use `docker run aquasec/trivy`",
  "Scan an image, for example `trivy image python:3.4-alpine`",
  "Read the results by severity and focus on the packages with fixes available",
  "Rebuild on a newer base image and scan again to confirm the count went down",
  "Add the Trivy GitHub Action to scan images on every build"
 ],
 "agent_prompt": "Install aquasecurity/trivy and scan my image <image:tag>. Summarize the critical and high vulnerabilities, which ones have fixed versions, and whether switching to <alternative base image> would remove most of them.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Beginner",
 "time": "10 minutes",
 "basis": "readme",
 "caveat": "A CVE list shows known issues only; it does not prove an image is safe or that each finding is exploitable in your setup.",
 "category": "Security and science",
 "tags": [
  "Security and science"
 ],
 "lang": "go",
 "requirements": [
  "Trivy via `brew install trivy`, the aquasec/trivy Docker image, or a release binary",
  "Access to the image, folder, repo or Kubernetes cluster you want to scan"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/aquasecurity-trivy/scan-a-container-image-for-cves/",
 "md": "https://dedupedai.com/use-cases/aquasecurity-trivy/scan-a-container-image-for-cves/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/aquasecurity-trivy--scan-a-container-image-for-cves.json",
 "api_version": "v1"
}
