The module lifecycle stageGeneral Availability
The module has requirements for installation

In a DKP cluster, vulnerability scanning is made with Trivy Operator. It automatically generates Software Bill Of Materials (SBOM) for all workloads and runs the scanner for specified objects without any manual actions required.

Supported object types for scanning

The following object types are supported:

  • Container images stored in a registry.
  • Node host filesystems in the cluster.

Analysis architecture

Regardless of object type, the scanning is made in three stages:

Stage Description
1. Scanning The scanner traverses the target object, runs analyzers to extract installed packages, dependency manifests, and configuration files, and builds an SBOM (Software Bill Of Materials)
2. Filtering Collected data is matched against vulnerability databases and policies. Filters apply by severity, fix status, and dependency type
3. Reporting Results are formatted as a VulnerabilityReport custom resource and published in the cluster in the namespace that contains the target object

Vulnerability scanning mechanism

The vulnerability scanner is Trivy’s core component: it detects known CVEs using vulnerability databases. The operator-trivy module scans OS packages and components (binaries, libraries) and application dependencies (libraries, modules, and other deps).

The operator automatically triggers scans when new or changed workloads appear in namespaces where scanning is enabled.

Operating system packages

The scanner detects the target OS distribution and applies data from the CVE databases officially provided by Deckhouse. This improves detection accuracy and reduces false positives.

Data sources used to build the CVE databases are listed below:

  • FSTEC of Russia threat database (BDU)
  • AlmaLinux Errata
  • Alpine SecDB
  • ALTRepo Errata OVAL
  • Amazon Linux Security Advisories
  • Arch Linux Security Tracker
  • Debian Security Tracker
  • GitHub Security Advisory Database
  • National Vulnerability Database (NVD)
  • Oracle OVAL
  • Photon Security Advisory
  • Red Hat OVAL
  • RED SOFT OVAL
  • Rocky Linux UpdateInfo
  • SUSE Security CVRF
  • Ubuntu CVE Tracker
  • Wolfi SecDB

Application dependencies

The scanner discovers and analyzes package manager manifests and lockfiles across more than twenty ecosystems. Per ecosystem it uses specialized vulnerability databases (primarily based on GitLab Advisory Database and GitHub Advisory Database).

Language / ecosystem Files analyzed
Node.js (npm, Yarn) package.json, package-lock.json, yarn.lock
Python (pip, Poetry, Pipenv) requirements.txt, Pipfile.lock, poetry.lock
Java (Maven, Gradle) pom.xml, build.gradle, *.jar, *.war
Go go.mod, go.sum, Go binaries
.NET (NuGet) *.csproj, packages.lock.json
Ruby (Bundler) Gemfile.lock
PHP (Composer) composer.lock
Rust (Cargo) Cargo.lock
Swift (SwiftPM) Package.resolved
Dart (pub) pubspec.lock

Scan results and the VulnerabilityReport resource

Vulnerability scan results are stored in the cluster as the VulnerabilityReport custom resource in group aquasecurity.github.io. Each report is created in the workload namespace, named <kind>-<workload-name>-<container-name>, and lists discovered CVEs with severity, fix status, affected packages, and references.

The report is tied to the parent resource via ownerReferences: when the image changes or the workload is removed, the stale VulnerabilityReport is garbage-collected and recreated if needed. This implements periodic rescanning of workloads.

SBOM generation and processing

Generated SBOM is stored in the cluster as the SbomReport CRD in group aquasecurity.github.io. Each report is created in the workload namespace and includes:

  • container image metadata (repository, tag, digest);
  • component inventory in CycloneDX format: OS packages and app dependencies with PURLs, licenses, and supplier information;
  • a dependency graph between components;
  • summaries of component and dependency counts.

The operator watches cluster resources. When a workload is created or updated, a scan job runs and produces both SbomReport and VulnerabilityReport. Both follow the <kind>-<workload-name>-<container-name> naming scheme and use ownerReferences — when the workload is deleted, reports are removed by Kubernetes garbage collection.

SbomReport and VulnerabilityReport complement each other: VulnerabilityReport lists CVEs, while SbomReport captures the full software inventory.

Blocking vulnerable containers

This feature requires the admission-policy-engine module (enabled by default in the module bundles Default and Managed).

The module enforces policy on running containers that use vulnerable images at Kubernetes admission time. It combines OPA Gatekeeper (the admission-policy-engine module) and Trivy: Trivy acts as a data provider for Gatekeeper with up-to-date scan results, and a Rego policy admits or denies the resource based on that data.

The constraint applies when Pod, Deployment, StatefulSet, and DaemonSet resources are created or updated in namespaces labeled security.deckhouse.io/trivy-provider: "".

The policy is evaluated only at admission (create/update). Gatekeeper audit mode does not evaluate this constraint.

Configuration

Blocking is controlled by the denyVulnerableImages module setting:

Parameter Default Description
enabled false Enable blocking of vulnerable images in labeled namespaces.
allowedSeverityLevels Images that contain vulnerabilities only at the listed severities are not blocked. Allowed values: UNKNOWN, LOW, MEDIUM, HIGH, CRITICAL.

Configuration example

denyVulnerableImages:
  enabled: true
  allowedSeverityLevels:
    - UNKNOWN
    - LOW
    - MEDIUM

In this example, images with HIGH or CRITICAL vulnerabilities are blocked. Images with only UNKNOWN, LOW, or MEDIUM findings are allowed.

Compliance reports

The module deploys ClusterComplianceReport resources for selected compliance frameworks. Each report is regenerated every 6 hours and maps controls of a framework to the underlying configuration and workload checks performed by Trivy.

The set of deployed reports is controlled by the complianceReports.enabled parameter.

Framework Default Description
CIS enabled CIS Kubernetes Benchmark v1.12.
PCI-DSS enabled PCI DSS v4.0 — key controls for protecting cardholder data.
NSA enabled NSA-CISA Kubernetes Hardening Guidance v1.0.
GDPR disabled GDPR — security-relevant articles (Art. 5, 25, 32).
HIPAA disabled HIPAA Security Rule — key technical safeguards (§164.308 and §164.312).
FSTEC-21 enabled Order of FSTEC of Russia No. 21 — personal data protection in personal data information systems.
FZ-187 enabled Order of FSTEC of Russia No. 239 — security requirements for significant CII objects (Federal Law 187-FZ).

Configuration example

complianceReports:
  enabled:
    - CIS
    - NSA
    - FSTEC-21
    - FZ-187

In this example only four reports are deployed. To inspect a report, use:

d8 k get clustercompliancereports
d8 k describe clustercompliancereport fstec-21

What compliance reports cover

By default compliance reports focus on your workloads — what the cluster owner can actually fix. The module automatically excludes from compliance:

  • resources owned by Deckhouse and its modules;
  • Kubernetes system components (built-in RBAC, control plane defaults, etc.).

The control plane itself is still checked against the relevant infrastructure controls (for example, CIS Kubernetes Benchmark section 1.x for kube-apiserver, etcd, kube-scheduler settings) — only generic workload-level findings about platform pods are filtered out.

Vulnerability scanning is independent of these filters and keeps reporting CVEs and secrets for every scanned image, including platform ones.

To exclude an additional namespace from compliance — for example, an experimental or short-lived environment — label the namespace:

d8 k label namespace my-namespace security.deckhouse.io/skip-compliance=true

Database management

The module automatically downloads, maintains, and caches the required databases during scans. Data is kept current through periodic automatic updates.

Database container image Purpose
<deckhouse-repo>/security/trivy-db:2 Main vulnerability database — aggregates NVD, Red Hat, Alpine, Ubuntu, Debian, GitLab Advisory DB, GitHub Advisory DB, and other sources.
<deckhouse-repo>/security/trivy-java-db:1 Specialized database for Java artifacts (JAR, WAR, EAR) with file-hash binding.
<deckhouse-repo>/security/trivy-checks:0 Rego policies for IaC misconfiguration checks.
<deckhouse-repo>/security/trivy-bdu:1 Mapping between third-party vulnerability IDs and FSTEC BDU identifiers.

In air-gapped environments you can mirror database images and use them offline with the d8 CLI utility (via the d8 mirror command).