[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ES5EZ361DBW3BAPWPSWQXD":3,"skill-same:01M7ES5EZ361DBW3BAPWPSWQXD":72},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M7ES5EZ361DBW3BAPWPSWQXD","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.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\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":24,"author":33,"domain":34,"license":15,"version":35,"nist_csf":36,"subdomain":25,"description":7,"mitre_attack":38},[25,26,27,28,29,30,31,32],"devsecops","trivy","container-security","vulnerability-scanning","iac-security","sbom","ci-cd","misconfiguration","mahipal","cybersecurity","1.0",[37],"ID.RA-01",[39],"T1525","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fscanning-iac-and-images-with-trivy",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill scanning-iac-and-images-with-trivy",{"tool":54,"command":55},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill scanning-iac-and-images-with-trivy",{"tool":57,"command":58},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill scanning-iac-and-images-with-trivy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fscanning-iac-and-images-with-trivy\u002FSKILL.md",true,[62,68],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fapi-reference.md","REFERENCE","参考文档",2940,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fscanning-iac-and-images-with-trivy\u002Freferences\u002Fapi-reference.md",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fstandards.md",1424,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fscanning-iac-and-images-with-trivy\u002Freferences\u002Fstandards.md",[73,82,87,94,101,108],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":81},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":83,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":81},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":81},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":81},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":81},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\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":77,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":81},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]