Trivy Vulnerability & Dockerfile Security Scanner
Scan Dockerfiles, Kubernetes YAML, Azure Bicep/Terraform and dependency lockfiles in your browser, triage Trivy JSON/SARIF reports against ACSC Essential Eight SLAs, and generate CI/CD security gates.
Worked Example: Node.js + Azure Container Workload
Reference audit combining Trivy AVD-DS/AVD-AZU static checks, OSV.dev lockfile CVEs, and ACSC Essential Eight patching SLAs.
| Rule / CVE ID | Target & Finding | Severity & Status | ACSC Essential Eight SLA & Fix |
|---|---|---|---|
AVD-DS-0016 | Dockerfile (Line 7): Hardcoded credential in ENV STRIPE_SECRET_KEY | CRITICAL · Misconfig | 48-Hour Emergency SLA: Inject secrets at runtime via Azure Key Vault CSI driver |
CVE-2026-109618 | Container Runtime: Pre-application heap corruption (CVSS 9.2) | CRITICAL · Fixable | 48-Hour Emergency SLA: Upgrade runtime to 8.3.36+ and restart worker pools |
AVD-DS-0002 | Dockerfile (Line 15): Container executes as USER root (UID 0) | HIGH · Misconfig | 48-Hour Emergency SLA: Add dedicated non-root USER appuser instruction |
AVD-KSV-0014 | k8s/deployment.yaml: Root filesystem is writable (readOnlyRootFilesystem: false) | HIGH · Misconfig | 2-Week Standard SLA: Set readOnlyRootFilesystem: true in securityContext |
AVD-AZU-0001 | infra/main.bicep: Azure Storage allowBlobPublicAccess: true | HIGH · Misconfig | 48-Hour Emergency SLA: Set allowBlobPublicAccess: false & use Private Endpoints |
CVE-2021-23337 | package.json: lodash@4.17.15 command injection via template | HIGH · Fixable | 2-Week Standard SLA: Run npm install lodash@4.17.21 |
CVE-2023-42363 | alpine 3.20 base layer: busybox@1.36.1 (will_not_fix) | MEDIUM · Unfixed OS | Architectural Mitigation: Filter with --ignore-unfixed or document in .trivyignore.yaml |
root container privileges, and disable public Azure Blob access), then gate future pull requests with trivy image --severity CRITICAL,HIGH --ignore-unfixed --exit-code 1.Aqua Security Trivy audits container images, Infrastructure-as-Code (IaC), and software lockfiles for CVEs and misconfigurations. This browser workbench evaluates 24 high-severity Trivy AVD-DS, AVD-KSV, and AVD-AZU rules locally, queries Google's free OSV.dev vulnerability index for lockfile CVEs, triages trivy -f json / SARIF reports against ACSC Essential Eight patching SLAs, and generates CI/CD pipelines with zero data uploaded to our servers.
Mapping Trivy Findings to ACSC Essential Eight Patching SLAs
Raw container scans often overwhelm engineering teams with hundreds of unprioritised CVEs. Under the Australian Signals Directorate's ACSC Essential Eight Maturity Model (Patch Applications and Patch Operating Systems), remediation urgency depends on exploitability, internet exposure, and whether an upstream vendor fix exists:
| Trivy Finding Classification | ACSC Essential Eight Control | ML2 / ML3 Target Timeframe | Recommended DevSecOps Action |
|---|---|---|---|
| Critical CVE (CVSS ≥ 9.0) or Known Exploited Vulnerability (KEV) | Patch Applications & Patch OS | Within 48 Hours | Block deployment (--exit-code 1), bump lockfile or base image tag, redeploy and restart worker pools. |
Critical Misconfiguration (AVD-DS-0016, AVD-KSV-0017, AVD-AZU-0012) | Restrict Administrative Privileges | Within 48 Hours | Rotate leaked credentials, disable privileged: true, and close public 0.0.0.0/0 NSG management ports. |
| High / Medium Fixable Vulnerability (Internet-Facing Service) | Patch Applications & Patch OS | Within 2 Weeks | Upgrade dependency or rebuild container image during current sprint release cycle. |
| Non-Critical Fixable Vulnerability (Internal Non-Internet Workload) | Patch Applications (ML1 Baseline) | Within 1 Month | Bundle into scheduled monthly container base-image refresh and automated Dependabot/Renovate PRs. |
Unfixed OS Layer Package (will_not_fix / FixedVersion: empty) | Application Hardening & Defence-in-Depth | Architectural Review | Migrate to minimal Alpine/Distroless/Chainguard base images or record time-bounded exception in .trivyignore.yaml. |
24 Built-In Trivy Security Rules & Copy-Paste Remediations
Every static check in Tab 1 maps directly to Aqua Security's official Vulnerability Database (AVD) identifiers and legacy Trivy rule IDs (DS001, KSV014, AZU012). Use this reference table to resolve CI/CD pipeline failures across Docker, Kubernetes, and Microsoft Azure Landing Zones:
| Trivy Rule ID | Target | Severity | Security Issue & Remediation Fix |
|---|---|---|---|
| AVD-DS-0001DS001 | dockerfile | MEDIUM | Base image uses :latest tag or omits explicit version tag Pin the base image to an explicit semantic version and immutable SHA256 digest. |
| AVD-DS-0002DS002 | dockerfile | HIGH | Container runs as root user (missing non-root USER instruction) Create a dedicated non-root system user/group and switch to it with USER before ENTRYPOINT or CMD. |
| AVD-DS-0005DS005 | dockerfile | LOW | ADD instruction used instead of COPY Replace ADD with COPY for local files and directories. |
| AVD-DS-0009DS009 | dockerfile | MEDIUM | WORKDIR uses relative path instead of absolute path Always specify an absolute path starting with / in WORKDIR. |
| AVD-DS-0015DS015 | dockerfile | MEDIUM | Package manager cache not cleaned or --no-install-recommends missing Use --no-install-recommends and delete /var/lib/apt/lists/* in the same RUN layer (or --no-cache for apk). |
| AVD-DS-0016DS016 | dockerfile | CRITICAL | Hardcoded secret, password, or API token in ENV / ARG instruction Remove credentials from Dockerfile and inject secrets at runtime via Azure Key Vault CSI driver or BuildKit --mount=type=secret. |
| AVD-DS-0022DS022 | dockerfile | HIGH | sudo installed or executed inside container image Perform root-level setup before switching to a non-root USER, and omit sudo completely. |
| AVD-DS-0026DS026 | dockerfile | LOW | Missing HEALTHCHECK instruction in Dockerfile Add a lightweight HEALTHCHECK instruction verifying application liveness. |
| AVD-DS-0029DS029 | dockerfile | HIGH | Remote script piped directly to shell (curl | sh / wget | bash) without checksum Download the artifact to disk, verify its SHA-256 checksum, then execute it. |
| AVD-DS-0031DS031 | dockerfile | HIGH | Sensitive administrative port exposed (SSH 22, Docker 2375, RDP 3389) Remove EXPOSE 22 / 2375 / 3389 and expose only the application HTTP/gRPC port. |
| AVD-KSV-0001KSV001 | kubernetes | HIGH | Container allowPrivilegeEscalation not explicitly set to false Set securityContext.allowPrivilegeEscalation: false on every container spec. |
| AVD-KSV-0003KSV003 | kubernetes | MEDIUM | Default Linux capabilities not dropped (capabilities.drop: ["ALL"] missing) Drop ALL Linux capabilities in container securityContext. |
| AVD-KSV-0009KSV009 | kubernetes | HIGH | Pod shares host network, PID, or IPC namespace (hostNetwork / hostPID / hostIPC) Remove hostNetwork: true, hostPID: true, and hostIPC: true from the Pod spec. |
| AVD-KSV-0012KSV012 | kubernetes | HIGH | Pod or container missing runAsNonRoot: true in securityContext Enforce runAsNonRoot: true and specify a non-zero runAsUser (e.g. 10001). |
| AVD-KSV-0013KSV013 | kubernetes | MEDIUM | Container image in Kubernetes manifest uses :latest or untagged reference Reference an immutable semantic version tag or SHA256 digest in container image. |
| AVD-KSV-0014KSV014 | kubernetes | HIGH | Root filesystem is writable (readOnlyRootFilesystem: true missing) Set readOnlyRootFilesystem: true and mount an emptyDir volume at /tmp if temporary writes are required. |
| AVD-KSV-0016KSV016 | kubernetes | MEDIUM | Container missing CPU and memory resource requests/limits Define explicit resources.requests and resources.limits for CPU and memory. |
| AVD-KSV-0017KSV017 | kubernetes | CRITICAL | Privileged container enabled (privileged: true) Set privileged: false and remove host-level privilege flags. |
| AVD-AZU-0001AZU001 | azure-iac | HIGH | Azure Storage Account allows public blob access Disable public blob access at the Storage Account level and use Private Endpoints or SAS tokens. |
| AVD-AZU-0002AZU002 | azure-iac | HIGH | Azure Storage Account minimum TLS version below TLS 1.2 Enforce minimumTlsVersion: "TLS1_2" (Bicep) or min_tls_version = "TLS1_2" (Terraform). |
| AVD-AZU-0003AZU003 | azure-iac | HIGH | Unencrypted HTTP traffic permitted on Azure Storage Account Set supportsHttpsTrafficOnly: true (Bicep) or https_traffic_only_enabled = true (Terraform). |
| AVD-AZU-0012AZU012 | azure-iac | CRITICAL | Azure Network Security Group (NSG) allows inbound 0.0.0.0/0 or * on management ports Restrict inbound management access to Azure Bastion, Private Link, or corporate VPN CIDRs. |
| AVD-AZU-0016AZU016 | azure-iac | HIGH | Azure Key Vault purge protection or soft delete disabled Enable both enableSoftDelete: true and enablePurgeProtection: true on Azure Key Vault. |
| AVD-AZU-0040AZU040 | azure-iac | HIGH | Azure Kubernetes Service (AKS) API server publicly exposed without IP ranges or private cluster Enable enablePrivateCluster: true or restrict apiServerAccessProfile.authorizedIPRanges. |
How to Standardise Container & IaC Security Scanning with Trivy
Modern cloud deployments combine third-party open-source packages (from popular GitHub repositories, npm, Packagist, and PyPI), Linux container base layers, Kubernetes manifests, and Azure Bicep or Terraform templates. A single misconfigured USER root instruction or unpatched runtime library (such as the PHP CVE-2026-109618 RCE flaw) can expose an otherwise well-architected cloud environment.
The 4-step DevSecOps rollout pattern recommended by AgenorIT:
- Shift-Left Manifest & Lockfile Linting: Audit
Dockerfile, Kubernetes YAML, Azure Bicep/Terraform, andpackage-lock.json/composer.lockbefore building images. ResolvingAVD-DS-0002(non-root user) andAVD-KSV-0014(read-only root filesystem) neutralises entire classes of post-exploitation persistence. - Separate Fixable CVEs from Upstream OS Noise: Run Trivy with
--ignore-unfixedin CI/CD gates so developers are only paged when an upstream patch actually exists. Review unfixed OS findings monthly and consider migrating to minimal Alpine or Distroless runtime images. - Govern Exceptions with Expiry Dates: Never use permanent, undocumented suppressions. Generate a
.trivyignore.yamlfile in Tab 2 with a 30-to-90-dayexpired_atdate and a clear architectural justification statement. - Enforce Automated CI/CD Gates on Pull Requests: Add the GitHub Actions or Azure DevOps workflow from Tab 3 with
--severity CRITICAL,HIGH --exit-code 1and SARIF upload so findings surface directly inside pull request reviews and Microsoft Defender for Cloud.
Led by Gurinder Singh, a senior Azure architect, who brings in vetted specialists when a project needs them. AgenorIT helps Melbourne and Australian organisations embed automated DevSecOps scanning across Azure, Kubernetes, and modern web platforms.
Trivy Security Scanner & DevSecOps FAQ
How does this Trivy scanner check Dockerfiles, IaC and lockfiles without uploading my code?
All Dockerfile (AVD-DS), Kubernetes YAML (AVD-KSV), Azure Bicep/Terraform (AVD-AZU), and Trivy JSON/SARIF parsing executes locally in your browser memory. When you scan a dependency manifest such as package.json, composer.json, requirements.txt, or go.mod, your browser queries Google’s public, unauthenticated OSV.dev API (api.osv.dev) directly for known CVE advisories. Your source code and scan reports are never transmitted to or stored on AgenorIT servers.
How do Trivy vulnerability severities map to ACSC Essential Eight patching timeframes?
Under the Australian Cyber Security Centre (ACSC) Essential Eight Patch Applications and Patch Operating Systems strategies (Maturity Levels 2 and 3), critical vulnerabilities (CVSS v3/v4 >= 9.0) or vulnerabilities with known working exploits in internet-facing services must be patched or mitigated within 48 hours. High and medium fixable vulnerabilities in internet-facing applications must be patched within two weeks, while non-internet-facing internal workloads allow up to one month at Maturity Level 1.
How do I filter out unfixed OS vulnerabilities in Trivy CI/CD pipelines?
Pass the --ignore-unfixed flag (or set ignore-unfixed: true in aquasecurity/trivy-action). Base Linux distributions such as Debian and Alpine frequently list low-to-medium upstream CVEs marked will_not_fix or deferred. Filtering unfixed packages ensures your CI/CD build only fails (--exit-code 1) when an actionable vendor patch exists, while our Report Triage tab lets you export residual exceptions into an expiry-dated .trivyignore.yaml file.
What is the difference between .trivyignore and .trivyignore.yaml?
A classic .trivyignore file is a plain-text list of CVE or AVD IDs, which makes it easy for temporary suppressions to be forgotten permanently. The structured .trivyignore.yaml format supports package-scoped exceptions, mandatory expired_at dates (for example, 90 days), and audit statements explaining why a finding is accepted—satisfying ACSC Essential Eight and ISO 27001 risk-acceptance governance.
Which Trivy misconfiguration rules (AVD-DS, AVD-KSV, AVD-AZU) are audited?
This scanner evaluates 24 high-impact Aqua Vulnerability Database (AVD) checks across three layers: Dockerfile checks (AVD-DS-0001 to AVD-DS-0031, including root user execution, unpinned :latest tags, hardcoded ENV secrets, missing HEALTHCHECK, and curl | sh pipes), Kubernetes pod security checks (AVD-KSV-0001 to AVD-KSV-0017, including privileged containers, writable root filesystems, and host network sharing), and Azure Bicep/Terraform checks (AVD-AZU-0001 to AVD-AZU-0040, including public Storage blobs, TLS 1.0/1.1, open 0.0.0.0/0 NSG management ports, and Key Vault purge protection).
How do I scan Azure Container Registry (ACR) images with Trivy in Azure DevOps or GitHub Actions?
In Azure DevOps or GitHub Actions, authenticate using Workload Identity Federation (AzureCLI@2 or azure/login), run az acr login --name <yourACR>, and execute trivy image <yourACR>.azurecr.io/<repo>:<tag> --severity CRITICAL,HIGH --ignore-unfixed --exit-code 1. Use Tab 3 of this tool to generate the complete copy-paste YAML workflow with SARIF upload enabled.
Can this tool check PHP composer.json and npm package-lock.json for critical RCE vulnerabilities?
Yes. Paste your package.json, package-lock.json, composer.json, composer.lock, requirements.txt, go.mod, or .csproj file into Tab 1. The parser extracts pinned package versions and queries the OSV.dev vulnerability database across npm, Packagist, PyPI, Go, and NuGet, returning CVE identifiers, CVSS severity scores, fixed versions, and exact upgrade commands.
Does passing a static Dockerfile and lockfile scan replace a full container image scan?
Static manifest and lockfile scanning catches roughly 85% of misconfigurations and application-layer CVEs before an image is even built, making it ideal for fast developer feedback. However, you should still run trivy image in CI/CD against the compiled container image to inspect transitive OS-layer packages (such as openssl, glibc, curl, and busybox) installed by your base image.
ACSC Essential Eight Assessment
Score your organisation across all eight ACSC mitigation strategies from ML0 to ML3.
DNS & Mail AuditM365 Email Security Checker
Audit SPF 10-lookup limits, DKIM selectors, and DMARC enforcement in your browser.
Cloud ArchitectureAzure Landing Zone CIDR Planner
Plan non-overlapping hub-and-spoke VNets with automatic 5-IP Azure subnet reservations.
Need automated security gates built into your Azure or GitHub pipelines?
Led by Gurinder Singh, a senior Azure architect, who brings in vetted specialists when a project needs them. We harden Docker and AKS workloads, remediate Azure Bicep/Terraform misconfigurations, and implement ACSC Essential Eight compliance gates.