[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AB770D1PZBE8A5CS608QQJ":3,"skill-same:01M7AB770D1PZBE8A5CS608QQJ":82},{"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":14,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M7AB770D1PZBE8A5CS608QQJ","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.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\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","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fscanning-iac-and-images-with-trivy","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add NeelakshSaxena\u002FVayu --skill scanning-iac-and-images-with-trivy",{"tool":54,"command":55},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill scanning-iac-and-images-with-trivy",{"tool":57,"command":58},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill scanning-iac-and-images-with-trivy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002FSKILL.md",true,[62,66,72,76],{"path":63,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fapi-reference.md","REFERENCE","参考文档",2940,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002Freferences\u002Fapi-reference.md",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fstandards.md",1424,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002Freferences\u002Fstandards.md",{"path":77,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":80,"sourceHtmlUrl":81},"scripts\u002Fagent.py","SCRIPT","脚本",6174,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fscanning-iac-and-images-with-trivy\u002Fscripts\u002Fagent.py",[83,90,97,104,111,118],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":20},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]