[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E6EQDJ2HFFCCMZ7R7GFCKJ":3,"skill-same:01M7E6EQDJ2HFFCCMZ7R7GFCKJ":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M7E6EQDJ2HFFCCMZ7R7GFCKJ","scanning-iac-and-images-with-trivy",null,"Scans container images, Infrastructure-as-Code (Terraform, CloudFormation, Kubernetes manifests, Dockerfile, Helm), filesystems, git repos, and SBOMs with Trivy's vuln, misconfig, secret, and license scanners. Use when building a CI\u002FCD security gate that scans images before push, IaC before apply, or SBOMs for supply-chain weaknesses, and fails the build on policy violations.","sanjeevafk\u002Fagent-skills","sanjeevafk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F230678117?v=4","01M7C540EFY46ETG1NNWKS5X3Q","Sanjeev","01M7C540F366J5C1D587BMKH9Q",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: scanning-iac-and-images-with-trivy\ndescription: Scans container images, Infrastructure-as-Code (Terraform, CloudFormation,\n  Kubernetes manifests, Dockerfile, Helm), filesystems, git repos, and SBOMs with Trivy's\n  vuln, misconfig, secret, and license scanners. Use when building a CI\u002FCD security\n  gate that scans images before push, IaC before apply, or SBOMs for supply-chain\n  weaknesses, and fails the build on policy violations.\ndomain: cybersecurity\nsubdomain: devsecops\ntags:\n- devsecops\n- trivy\n- container-security\n- vulnerability-scanning\n- iac-security\n- sbom\n- ci-cd\n- misconfiguration\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- ID.RA-01\nmitre_attack:\n- T1525\n---\n# Scanning IaC and Images with Trivy\n\n## Overview\n\nTrivy (by Aqua Security) is a comprehensive, open-source security scanner that finds vulnerabilities (CVEs), misconfigurations (IaC), secrets, software licenses, and software supply-chain weaknesses across a wide range of targets: container images, filesystems, Git repositories, virtual machine images, Kubernetes clusters, and SBOM documents. It is widely adopted as a \"shift-left\" gate in CI\u002FCD pipelines because it is fast, runs as a single static binary, requires no agent, and supports machine-readable output formats (JSON, SARIF, CycloneDX, SPDX) for integration with code-scanning dashboards.\n\nTrivy bundles four primary scanners that can be toggled with `--scanners`:\n\n- **vuln** — OS package and language-dependency vulnerability detection (CVE matching against the Trivy vulnerability DB).\n- **misconfig** — Infrastructure-as-Code and configuration misconfiguration detection (Terraform, CloudFormation, Kubernetes manifests, Dockerfile, Helm) using built-in and custom Rego policies.\n- **secret** — Hard-coded secret\u002Fcredential detection (API keys, tokens, private keys).\n- **license** — Software license identification and policy enforcement.\n\nThis skill covers building a Trivy-based scanning workflow that gates a CI\u002FCD pipeline: scanning images before push, scanning IaC before apply, generating and re-scanning SBOMs, and failing builds on policy violations. Detecting these weaknesses defends against the MITRE ATT&CK technique **T1525 (Implant Internal Image)**, where adversaries plant malicious or vulnerable images in a registry to be deployed across the environment.\n\n## When to Use\n\n- When integrating vulnerability and misconfiguration scanning into a CI\u002FCD pipeline as a quality\u002Fsecurity gate before images are pushed or infrastructure is applied.\n- When auditing container images in a registry for known CVEs prior to deployment.\n- When validating Terraform, CloudFormation, Kubernetes, Dockerfile, or Helm IaC for security misconfigurations.\n- When generating an SBOM (CycloneDX\u002FSPDX) for supply-chain transparency and later re-scanning that SBOM for newly disclosed CVEs.\n- When scanning a running Kubernetes cluster for vulnerable workloads and misconfigured RBAC\u002Fresources.\n- When enforcing license compliance policy on dependencies.\n\n## Prerequisites\n\n- A Linux\u002FmacOS\u002FWindows host or CI runner with network access to download the Trivy vulnerability database.\n- Docker (optional) if scanning local images by name or using the containerized Trivy.\n- Install Trivy (Aqua Security official methods):\n\n```bash\n# Debian\u002FUbuntu (APT repository)\nsudo apt-get install -y wget gnupg\nwget -qO - https:\u002F\u002Faquasecurity.github.io\u002Ftrivy-repo\u002Fdeb\u002Fpublic.key | gpg --dearmor | sudo tee \u002Fusr\u002Fshare\u002Fkeyrings\u002Ftrivy.gpg > \u002Fdev\u002Fnull\necho \"deb [signed-by=\u002Fusr\u002Fshare\u002Fkeyrings\u002Ftrivy.gpg] https:\u002F\u002Faquasecurity.github.io\u002Ftrivy-repo\u002Fdeb generic main\" | sudo tee \u002Fetc\u002Fapt\u002Fsources.list.d\u002Ftrivy.list\nsudo apt-get update\nsudo apt-get install -y trivy\n\n# RHEL\u002FCentOS (YUM repository), macOS (Homebrew), and install script\nbrew install trivy\ncurl -sfL https:\u002F\u002Fraw.githubusercontent.com\u002Faquasecurity\u002Ftrivy\u002Fmain\u002Fcontrib\u002Finstall.sh | sudo sh -s -- -b \u002Fusr\u002Flocal\u002Fbin\n\n# Containerized usage (no install)\ndocker run --rm -v \u002Fvar\u002Frun\u002Fdocker.sock:\u002Fvar\u002Frun\u002Fdocker.sock aquasec\u002Ftrivy:latest image python:3.10-alpine\n\n# Verify\ntrivy --version\n```\n\n- For air-gapped or rate-limited environments, pre-download the DB with `trivy image --download-db-only` and the Java\u002Fpolicy bundles as needed.\n\n## Objectives\n\n- Scan a container image for OS and language vulnerabilities and fail the build above a severity threshold.\n- Scan IaC (Terraform\u002FKubernetes\u002FDockerfile) for misconfigurations.\n- Detect hard-coded secrets in a repository or filesystem.\n- Generate a CycloneDX or SPDX SBOM and re-scan it for vulnerabilities.\n- Emit SARIF for GitHub code scanning and JSON for programmatic gating.\n- Wire Trivy into a CI\u002FCD pipeline with `--exit-code` to enforce policy.\n\n## MITRE ATT&CK Mapping\n\n| Technique ID | Name | Tactic | Relevance |\n|--------------|------|--------|-----------|\n| T1525 | Implant Internal Image | Persistence | Trivy detects vulnerable or malicious images\u002Flayers and embedded secrets before they are implanted in a registry and propagated to running workloads. |\n\n## Workflow\n\n### 1. Scan a container image for vulnerabilities\n\nRun a vulnerability-only scan of a registry image, restricting to high\u002Fcritical findings and ignoring CVEs with no available fix:\n\n```bash\ntrivy image \\\n  --scanners vuln \\\n  --severity HIGH,CRITICAL \\\n  --ignore-unfixed \\\n  --format table \\\n  python:3.10-alpine\n```\n\nScan an image saved as a tarball (useful when the image is built but not yet pushed):\n\n```bash\ndocker save myorg\u002Fapp:1.4.0 -o app.tar\ntrivy image --input app.tar --severity CRITICAL --format json --output app-vulns.json\n```\n\n### 2. Enable multiple scanners on an image\n\nRun vulnerability, misconfiguration, secret, and license scanners together:\n\n```bash\ntrivy image \\\n  --scanners vuln,misconfig,secret,license \\\n  --severity MEDIUM,HIGH,CRITICAL \\\n  myorg\u002Fapp:1.4.0\n```\n\nScan the image's embedded config (Dockerfile-equivalent build history and history secrets):\n\n```bash\ntrivy image --image-config-scanners misconfig,secret myorg\u002Fapp:1.4.0\n```\n\n### 3. Scan Infrastructure-as-Code (misconfiguration)\n\nScan a directory of Terraform \u002F Kubernetes \u002F Dockerfile \u002F Helm \u002F CloudFormation for misconfigurations using the `config` target:\n\n```bash\n# Scan a Terraform \u002F IaC directory\ntrivy config \\\n  --severity HIGH,CRITICAL \\\n  --format table \\\n  .\u002Finfra\n\n# Scan with custom Rego policies and a specific policy namespace\ntrivy config \\\n  --config-policy .\u002Fpolicies \\\n  --policy-namespaces user \\\n  .\u002Finfra\n```\n\nAlternatively use the `fs` (filesystem) target with the misconfig scanner explicitly:\n\n```bash\ntrivy fs --scanners misconfig,secret --severity HIGH,CRITICAL .\u002Finfra\n```\n\n### 4. Scan a repository and detect secrets\n\nScan a local working tree (or remote repo) for vulnerabilities in lockfiles and hard-coded secrets:\n\n```bash\n# Local filesystem (dependencies + secrets)\ntrivy fs --scanners vuln,secret --severity HIGH,CRITICAL .\n\n# Remote Git repository\ntrivy repository --scanners vuln,secret https:\u002F\u002Fgithub.com\u002Fmyorg\u002Fmyrepo\n```\n\n### 5. Generate and re-scan an SBOM\n\nProduce a CycloneDX SBOM from an image, then scan the SBOM itself for vulnerabilities (so a stored SBOM can be re-evaluated as new CVEs are disclosed):\n\n```bash\n# Generate CycloneDX SBOM\ntrivy image --format cyclonedx --output sbom.cdx.json myorg\u002Fapp:1.4.0\n\n# Generate SPDX SBOM\ntrivy image --format spdx-json --output sbom.spdx.json myorg\u002Fapp:1.4.0\n\n# Re-scan the SBOM for vulnerabilities later\ntrivy sbom --severity HIGH,CRITICAL sbom.cdx.json\n```\n\n### 6. Emit SARIF for code-scanning dashboards\n\nProduce SARIF for GitHub Advanced Security \u002F code scanning ingestion:\n\n```bash\ntrivy image \\\n  --format sarif \\\n  --output trivy-results.sarif \\\n  --severity HIGH,CRITICAL \\\n  myorg\u002Fapp:1.4.0\n```\n\n### 7. Gate the CI\u002FCD pipeline with exit codes\n\nUse `--exit-code 1` so the pipeline step fails when findings at or above the chosen severity are present. Separate the \"report everything\" run (exit 0) from the \"enforce\" run (exit 1):\n\n```bash\n# 1) Informational report (never fails the build)\ntrivy image --severity LOW,MEDIUM,HIGH,CRITICAL --exit-code 0 --format table myorg\u002Fapp:1.4.0\n\n# 2) Enforcement gate (fails build on HIGH\u002FCRITICAL with a fix available)\ntrivy image \\\n  --severity HIGH,CRITICAL \\\n  --ignore-unfixed \\\n  --exit-code 1 \\\n  --format json --output gate.json \\\n  myorg\u002Fapp:1.4.0\n```\n\nExample GitHub Actions step using the official action:\n\n```yaml\n- name: Run Trivy image scan (gate)\n  uses: aquasecurity\u002Ftrivy-action@master\n  with:\n    image-ref: 'myorg\u002Fapp:1.4.0'\n    format: 'sarif'\n    output: 'trivy-results.sarif'\n    severity: 'HIGH,CRITICAL'\n    ignore-unfixed: true\n    exit-code: '1'\n```\n\n### 8. Manage false positives and the DB\n\nSuppress accepted-risk findings with a `.trivyignore` file and keep the DB current:\n\n```bash\n# .trivyignore — one CVE\u002FAVD\u002Fsecret rule ID per line\necho \"CVE-2023-12345\" >> .trivyignore\necho \"AVD-AWS-0089\"   >> .trivyignore\n\n# Refresh DBs explicitly (useful for caching layers in CI)\ntrivy image --download-db-only\ntrivy image --download-java-db-only\n\n# Scan a Kubernetes cluster (summary report)\ntrivy k8s --report summary --severity HIGH,CRITICAL cluster\n```\n\n## Tools and Resources\n\n| Tool \u002F Resource | Purpose | Link |\n|------------------|---------|------|\n| Trivy | Core scanner CLI | https:\u002F\u002Fgithub.com\u002Faquasecurity\u002Ftrivy |\n| Trivy Documentation | Official docs (targets, scanners, flags) | https:\u002F\u002Ftrivy.dev\u002Flatest\u002Fdocs\u002F |\n| trivy-action | GitHub Actions integration | https:\u002F\u002Fgithub.com\u002Faquasecurity\u002Ftrivy-action |\n| Trivy Operator | In-cluster Kubernetes continuous scanning | https:\u002F\u002Fgithub.com\u002Faquasecurity\u002Ftrivy-operator |\n| Trivy vulnerability DB | OSS vulnerability data source | https:\u002F\u002Fgithub.com\u002Faquasecurity\u002Ftrivy-db |\n| CycloneDX | SBOM standard emitted by Trivy | https:\u002F\u002Fcyclonedx.org\u002F |\n\n## Validation Criteria\n\n- [ ] Trivy installed and `trivy --version` reports a valid version.\n- [ ] Container image scanned for vulnerabilities with severity filtering applied.\n- [ ] Image scanned with multiple scanners (vuln, misconfig, secret, license).\n- [ ] IaC directory scanned with `trivy config` and misconfigurations reviewed.\n- [ ] Secret scanning run against the repository.\n- [ ] CycloneDX\u002FSPDX SBOM generated and successfully re-scanned with `trivy sbom`.\n- [ ] SARIF output produced for the code-scanning dashboard.\n- [ ] CI\u002FCD gate fails the build on HIGH\u002FCRITICAL findings via `--exit-code 1`.\n- [ ] `.trivyignore` configured for accepted-risk findings with documented justification.\n","# Scanning IaC and Images with Trivy\n\n## Overview\n\nTrivy (by Aqua Security) is a comprehensive, open-source security scanner that finds vulnerabilities (CVEs), misconfigurations (IaC), secrets, software licenses, and software supply-chain weaknesses across a wide range of targets: container images, filesystems, Git repositories, virtual machine images, Kubernetes clusters, and SBOM documents. It is widely adopted as a \"shift-left\" gate in CI\u002FCD pipelines because it is fast, runs as a single static binary, requires no agent, and supports machine-readable output formats (JSON, SARIF, CycloneDX, SPDX) for integration with code-scanning dashboards.\n\nTrivy bundles four primary scanners that can be toggled with `--scanners`:\n\n- **vuln** — OS package and language-dependency vulnerability detection (CVE matching against the Trivy vulnerability DB).\n- **misconfig** — Infrastructure-as-Code and configuration misconfiguration detection (Terraform, CloudFormation, Kubernetes manifests, Dockerfile, Helm) using built-in and custom Rego policies.\n- **secret** — Hard-coded secret\u002Fcredential detection (API keys, tokens, private keys).\n- **license** — Software license identification and policy enforcement.\n\nThis skill covers building a Trivy-based scanning workflow that gates a CI\u002FCD pipeline: scanning images before push, scanning IaC before apply, generating and re-scanning SBOMs, and failing builds on policy violations. Detecting these weaknesses defends against the MITRE ATT&CK technique **T1525 (Implant Internal Image)**, where adversaries plant malicious or vulnerable images in a registry to be deployed across the environment.\n\n## When to Use\n\n- When integrating vulnerability and misconfiguration scanning into a CI\u002FCD pipeline as a quality\u002Fsecurity gate before images are pushed or infrastructure is applied.\n- When auditing container images in a registry for known CVEs prior to deployment.\n- When validating Terraform, CloudFormation, Kubernetes, Dockerfile, or Helm IaC for security misconfigurations.\n- When generating an SBOM (CycloneDX\u002FSPDX) for supply-chain transparency and later re-scanning that SBOM for newly disclosed CVEs.\n- When scanning a running Kubernetes cluster for vulnerable workloads and misconfigured RBAC\u002Fresources.\n- When enforcing license compliance policy on dependencies.\n\n## Prerequisites\n\n- A Linux\u002FmacOS\u002FWindows host or CI runner with network access to download the Trivy vulnerability database.\n- Docker (optional) if scanning local images by name or using the containerized Trivy.\n- Install Trivy (Aqua Security official methods):\n\n```bash\n# Debian\u002FUbuntu (APT repository)\nsudo apt-get install -y wget gnupg\nwget -qO - https:\u002F\u002Faquasecurity.github.io\u002Ftrivy-repo\u002Fdeb\u002Fpublic.key | gpg --dearmor | sudo tee \u002Fusr\u002Fshare\u002Fkeyrings\u002Ftrivy.gpg > \u002Fdev\u002Fnull\necho \"deb [signed-by=\u002Fusr\u002Fshare\u002Fkeyrings\u002Ftrivy.gpg] https:\u002F\u002Faquasecurity.github.io\u002Ftrivy-repo\u002Fdeb generic main\" | sudo tee \u002Fetc\u002Fapt\u002Fsources.list.d\u002Ftrivy.list\nsudo apt-get update\nsudo apt-get install -y trivy\n\n# RHEL\u002FCentOS (YUM repository), macOS (Homebrew), and install script\nbrew install trivy\ncurl -sfL https:\u002F\u002Fraw.githubusercontent.com\u002Faquasecurity\u002Ftrivy\u002Fmain\u002Fcontrib\u002Finstall.sh | sudo sh -s -- -b \u002Fusr\u002Flocal\u002Fbin\n\n# Containerized usage (no install)\ndocker run --rm -v \u002Fvar\u002Frun\u002Fdocker.sock:\u002Fvar\u002Frun\u002Fdocker.sock aquasec\u002Ftrivy:latest image python:3.10-alpine\n\n# Verify\ntrivy --version\n```\n\n- For air-gapped or rate-limited environments, pre-download the DB with `trivy image --download-db-only` and the Java\u002Fpolicy bundles as needed.\n\n## Objectives\n\n- Scan a container image for OS and language vulnerabilities and fail the build above a severity threshold.\n- Scan IaC (Terraform\u002FKubernetes\u002FDockerfile) for misconfigurations.\n- Detect hard-coded secrets in a repository or filesystem.\n- Generate a CycloneDX or SPDX SBOM and re-scan it for vulnerabilities.\n- Emit SARIF for GitHub code scanning and JSON for programmatic gating.\n- Wire Trivy into a CI\u002FCD pipeline with `--exit-code` to enforce policy.\n\n## MITRE ATT&CK Mapping\n\n| Technique ID | Name | Tactic | Relevance |\n|--------------|------|--------|-----------|\n| T1525 | Implant Internal Image | Persistence | Trivy detects vulnerable or malicious images\u002Flayers and embedded secrets before they are implanted in a registry and propagated to running workloads. |\n\n## Workflow\n\n### 1. Scan a container image for vulnerabilities\n\nRun a vulnerability-only scan of a registry image, restricting to high\u002Fcritical findings and ignoring CVEs with no available fix:\n\n```bash\ntrivy image \\\n  --scanners vuln \\\n  --severity HIGH,CRITICAL \\\n  --ignore-unfixed \\\n  --format table \\\n  python:3.10-alpine\n```\n\nScan an image saved as a tarball (useful when the image is built but not yet pushed):\n\n```bash\ndocker save myorg\u002Fapp:1.4.0 -o app.tar\ntrivy image --input app.tar --severity CRITICAL --format json --output app-vulns.json\n```\n\n### 2. Enable multiple scanners on an image\n\nRun vulnerability, misconfiguration, secret, and license scanners together:\n\n```bash\ntrivy image \\\n  --scanners vuln,misconfig,secret,license \\\n  --severity MEDIUM,HIGH,CRITICAL \\\n  myorg\u002Fapp:1.4.0\n```\n\nScan the image's embedded config (Dockerfile-equivalent build history and history secrets):\n\n```bash\ntrivy image --image-config-scanners misconfig,secret myorg\u002Fapp:1.4.0\n```\n\n### 3. Scan Infrastructure-as-Code (misconfiguration)\n\nScan a directory of Terraform \u002F Kubernetes \u002F Dockerfile \u002F Helm \u002F CloudFormation for misconfigurations using the `config` target:\n\n```bash\n# Scan a Terraform \u002F IaC directory\ntrivy config \\\n  --severity HIGH,CRITICAL \\\n  --format table \\\n  .\u002Finfra\n\n# Scan with custom Rego policies and a specific policy namespace\ntrivy config \\\n  --config-policy .\u002Fpolicies \\\n  --policy-namespaces user \\\n  .\u002Finfra\n```\n\nAlternatively use the `fs` (filesystem) target with the misconfig scanner explicitly:\n\n```bash\ntrivy fs --scanners misconfig,secret --severity HIGH,CRITICAL .\u002Finfra\n```\n\n### 4. Scan a repository and detect secrets\n\nScan a local working tree (or remote repo) for vulnerabilities in lockfiles and hard-coded secrets:\n\n```bash\n# Local filesystem (dependencies + secrets)\ntrivy fs --scanners vuln,secret --severity HIGH,CRITICAL .\n\n# Remote Git repository\ntrivy repository --scanners vuln,secret https:\u002F\u002Fgithub.com\u002Fmyorg\u002Fmyrepo\n```\n\n### 5. Generate and re-scan an SBOM\n\nProduce a CycloneDX SBOM from an image, then scan the SBOM itself for vulnerabilities (so a stored SBOM can be re-evaluated as new CVEs are disclosed):\n\n```bash\n# Generate CycloneDX SBOM\ntrivy image --format cyclonedx --output sbom.cdx.json myorg\u002Fapp:1.4.0\n\n# Generate SPDX SBOM\ntrivy image --format spdx-json --output sbom.spdx.json myorg\u002Fapp:1.4.0\n\n# Re-scan the SBOM for vulnerabilities later\ntrivy sbom --severity HIGH,CRITICAL sbom.cdx.json\n```\n\n### 6. Emit SARIF for code-scanning dashboards\n\nProduce SARIF for GitHub Advanced Security \u002F code scanning ingestion:\n\n```bash\ntrivy image \\\n  --format sarif \\\n  --output trivy-results.sarif \\\n  --severity HIGH,CRITICAL \\\n  myorg\u002Fapp:1.4.0\n```\n\n### 7. Gate the CI\u002FCD pipeline with exit codes\n\nUse `--exit-code 1` so the pipeline step fails when findings at or above the chosen severity are present. Separate the \"report everything\" run (exit 0) from the \"enforce\" run (exit 1):\n\n```bash\n# 1) Informational report (never fails the build)\ntrivy image --severity LOW,MEDIUM,HIGH,CRITICAL --exit-code 0 --format table myorg\u002Fapp:1.4.0\n\n# 2) Enforcement gate (fails build on HIGH\u002FCRITICAL with a fix available)\ntrivy image \\\n  --severity HIGH,CRITICAL \\\n  --ignore-unfixed \\\n  --exit-code 1 \\\n  --format json --output gate.json \\\n  myorg\u002Fapp:1.4.0\n```\n\nExample GitHub Actions step using the official action:\n\n```yaml\n- name: Run Trivy image scan (gate)\n  uses: aquasecurity\u002Ftrivy-action@master\n  with:\n    image-ref: 'myorg\u002Fapp:1.4.0'\n    format: 'sarif'\n    output: 'trivy-results.sarif'\n    severity: 'HIGH,CRITICAL'\n    ignore-unfixed: true\n    exit-code: '1'\n```\n\n### 8. Manage false positives and the DB\n\nSuppress accepted-risk findings with a `.trivyignore` file and keep the DB current:\n\n```bash\n# .trivyignore — one CVE\u002FAVD\u002Fsecret rule ID per line\necho \"CVE-2023-12345\" >> .trivyignore\necho \"AVD-AWS-0089\"   >> .trivyignore\n\n# Refresh DBs explicitly (useful for caching layers in CI)\ntrivy image --download-db-only\ntrivy image --download-java-db-only\n\n# Scan a Kubernetes cluster (summary report)\ntrivy k8s --report summary --severity HIGH,CRITICAL cluster\n```\n\n## Tools and Resources\n\n| Tool \u002F Resource | Purpose | Link |\n|------------------|---------|------|\n| Trivy | Core scanner CLI | https:\u002F\u002Fgithub.com\u002Faquasecurity\u002Ftrivy |\n| Trivy Documentation | Official docs (targets, scanners, flags) | https:\u002F\u002Ftrivy.dev\u002Flatest\u002Fdocs\u002F |\n| trivy-action | GitHub Actions integration | https:\u002F\u002Fgithub.com\u002Faquasecurity\u002Ftrivy-action |\n| Trivy Operator | In-cluster Kubernetes continuous scanning | https:\u002F\u002Fgithub.com\u002Faquasecurity\u002Ftrivy-operator |\n| Trivy vulnerability DB | OSS vulnerability data source | https:\u002F\u002Fgithub.com\u002Faquasecurity\u002Ftrivy-db |\n| CycloneDX | SBOM standard emitted by Trivy | https:\u002F\u002Fcyclonedx.org\u002F |\n\n## Validation Criteria\n\n- [ ] Trivy installed and `trivy --version` reports a valid version.\n- [ ] Container image scanned for vulnerabilities with severity filtering applied.\n- [ ] Image scanned with multiple scanners (vuln, misconfig, secret, license).\n- [ ] IaC directory scanned with `trivy config` and misconfigurations reviewed.\n- [ ] Secret scanning run against the repository.\n- [ ] CycloneDX\u002FSPDX SBOM generated and successfully re-scanned with `trivy sbom`.\n- [ ] SARIF output produced for the code-scanning dashboard.\n- [ ] CI\u002FCD gate fails the build on HIGH\u002FCRITICAL findings via `--exit-code 1`.\n- [ ] `.trivyignore` configured for accepted-risk findings with documented justification.\n",{"name":5,"tags":25,"author":34,"domain":35,"license":15,"version":36,"nist_csf":37,"subdomain":26,"description":7,"mitre_attack":39},[26,27,28,29,30,31,32,33],"devsecops","trivy","container-security","vulnerability-scanning","iac-security","sbom","ci-cd","misconfiguration","mahipal","cybersecurity","1.0",[38],"ID.RA-01",[40],"T1525","main","4e084e84eb42fc53e144c89c0f7f48b39c8a4b0f","collections\u002Fcybersecurity-skills\u002Fskills\u002Fscanning-iac-and-images-with-trivy",1,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002Fsanjeevafk","First make it work. Then make it right. Then make it fast.","2026-11-14 13:36:16",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add sanjeevafk\u002Fagent-skills --skill scanning-iac-and-images-with-trivy",{"tool":55,"command":56},"bunx","bunx skills add sanjeevafk\u002Fagent-skills --skill scanning-iac-and-images-with-trivy",{"tool":58,"command":59},"pnpm","pnpm dlx skills add sanjeevafk\u002Fagent-skills --skill scanning-iac-and-images-with-trivy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002FSKILL.md",true,[63,67,73,77],{"path":64,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fapi-reference.md","REFERENCE","参考文档",2940,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002Freferences\u002Fapi-reference.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fstandards.md",1424,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002Freferences\u002Fstandards.md",{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"scripts\u002Fagent.py","SCRIPT","脚本",6174,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002Fscripts\u002Fagent.py",[84,92,100,108,116,123],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":20},"01M7EFHX67M3KKXT1BXVPA5ADT","zarr-python","Chunked N-D arrays for cloud storage (Zarr-Python 3). Compressed arrays, parallel I\u002FO, S3\u002FGCS via fsspec, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","MIT","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M7EFFQGM51TZBGRENXY50ZYM","whiteboard-diagrams","Create accurate, simple, hand-drawn whiteboard diagrams from a user's process, system, architecture, learning workflow, comparison, or causal explanation. Use when the user asks for a scribbly whiteboard visual, educational workflow graphic, hand-drawn explainer, or diagram like the bundled reference; ask one focused clarification question when the subject or relationships are missing, then generate and visually verify the final image.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":20},"01M7EFF1CSQNTDMHFK4ZGY6NYK","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":112,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":20},"01M7EFE8106X6C28FT8PA74427","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":20},"01M7EFCSNZM9G7ZHS6F127Q71X","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":127,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":20},"01M7EFCE7EZMKPRYDDNKBQ9EEH","vercel-deploy","Deploy applications and websites to Vercel. Use when the user requests deployment actions like \"deploy my app\", \"deploy and give me the link\", \"push this live\", or \"create a preview deployment\".","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FSKILL.md",[],[]]