Continuous Kubernetes vulnerability scanning with Trivy Operator

Trivy Operator scans a cluster continuously and stores vulnerability, config audit, exposed secret and RBAC findings as Kubernetes custom resources. This page covers the configuration choices, setup, offline databases and how results reach ticketing and dashboards.

On this page

When Trivy Operator fits continuous Kubernetes vulnerability scanning

A one-time image scan tells you what was true on the day it ran. In a cluster where images are rebuilt and configuration changes every day, new Pods appear without anyone reviewing them. Trivy Operator fits teams that need a standing, in-cluster record of vulnerabilities and misconfigurations for what is running now, not for what a pipeline scanned last week. It is the right starting point when you want findings that follow the workloads themselves and are visible to the people who operate the cluster.

Trivy Operator is an Apache-2.0 project that runs inside the cluster and scans it continuously, for example when a new Pod is created. It stores its results as Kubernetes custom resources: vulnerability reports, config audit reports, exposed secret reports, RBAC assessment reports and compliance reports. Because the results are API objects, teams can read them with kubectl, select them by namespace or label, and export them to other tooling. Compliance reports cover the NSA/CISA Kubernetes Hardening Guidance v1.1, the CIS Kubernetes Benchmark v1.23 and the Pod Security Standards baseline and restricted profiles, so the same operator can support a hardening review.

Know the limits before you commit. The operator reports what it finds. It does not patch images, change manifests, rotate exposed credentials or decide which findings matter for your environment. Those actions stay with your platform and application teams, and they need an owner, a triage routine and a path into your ticketing system. Confirm in your own environment which scanners you enable and how much cluster load the scans add, and plan how findings will reach people who can act on them.

How scan jobs, reports and downstream tools connect

The flow starts when a Pod or other workload event reaches the Kubernetes API server, which the Trivy Operator watches. The operator starts scan jobs that pull vulnerability databases either from the default source or from an internal mirror inside the trust boundary. Results are written back to the API server as custom resources, and an exporter or script forwards them to a ticketing system or DefectDojo. Check that the mirror is refreshed on a schedule, and that the forwarder's credentials can read reports but not change them.

Scan flow from workload events to reports and downstream tools.

Which report types to enable and what each one answers

Vulnerability reports answer the question of which known CVEs are present in the container images running in your cluster. The operator scans images when workloads appear, so the report follows what is actually deployed rather than what a build pipeline scanned at one point in time. The findings come from the same scanner that powers Trivy's image scanning, which covers OS packages and software dependencies. The owners who act on these reports are usually application teams, who rebuild or update base images, and platform teams, who maintain shared base images and admission rules. Expect the most volume here, because a single base image can repeat the same CVE across dozens of workloads.

  • Question answered: Which installed packages in running images have known vulnerabilities, and which workloads carry them.
  • Who acts: Application owners for their own images, platform engineers for shared base images.
  • Typical noise: Duplicate findings across replicas and namespaces, and CVEs with no available fix yet.
  • Useful filter: Severity and fixed-version availability, so the first queue contains fixable, high-severity items.

Before you set a remediation target, confirm with your security team which severities and fix states count as actionable in your process.

Configuration options and when each one fits

This table compares the main Trivy Operator configuration choices: when scans run, what they cover, where vulnerability data comes from, how offline clusters get their data, what output formats downstream tools can read, and which report kinds to enable. Read each row as a decision with a cost in operations or coverage, and confirm the trade-off against your own cluster before you fix the settings.

OptionWhat it controlsFits whenTrade-off to confirm
Scan on Pod creationScans run when a new Pod or workload appears, so new images are checked soon after deploymentTeams deploy often and want fresh results for each rolloutImages already running may not be rescanned until something changes, so confirm the behavior for long-running Pods
Scheduled rescansRe-evaluates existing workloads on a timer so newly published CVEs reach the reportsLong-lived workloads that change rarely but face new advisoriesScan frequency adds load on the cluster and the database mirror, so set the interval against your change and triage cadence
Namespace and workload inclusionLimits which namespaces and workloads produce reportsPlatform namespaces need coverage while sandboxes or test tenants may create noiseExcluding namespaces removes them from reports, so record exclusions and review them during audits
Default online vulnerability databasePulls the Trivy vulnerability and check data from public sources at scan timeClusters with outbound access that accept the default data pathRequires network egress from the cluster and depends on the upstream publishing schedule
Internal OCI mirror via --db-repository, --java-db-repository and --checks-bundle-repositoryPoints scanners at databases published as OCI images in your internal registryConnected clusters with a policy that scan data must come from an internal sourceSomeone must keep the mirror current, since Trivy's docs warn that mirrors must be kept updated
Offline archive import for air-gapped clustersLoads the trivy-db or trivy-java-db archive into the cache db directory on the offline systemClusters with no path to external registriesArchives go stale quickly, so confirm the refresh process, transfer approval and who signs off on each import
JSON outputStructured report data for pipelines, ticketing scripts and custom dashboardsTeams that parse findings and create tickets or metrics automaticallySchemas and field names need versioned handling in your own parsers
SARIF outputStandard results format that code scanning and review tools can ingestTeams that already review SARIF findings in source control or CI toolingConfirm whether the receiving tool keeps cluster context such as namespace and workload
Template outputCustom rendering of findings using a template for specific reports or ticketsTeams that need a fixed layout for a dashboard, email digest or audit extractTemplates need maintenance when the output changes, so test them after each upgrade
Report kinds to enableWhich custom resources are created: vulnerability, config audit, exposed secret, RBAC and complianceEarly rollout can start with vulnerability reports, then add others once triage capacity existsMore report kinds increase stored objects and findings to triage, so confirm volume before enabling all of them

Setup sequence for Trivy Operator in a cluster you control

This sequence takes a cluster from access checks to a working pipeline where Trivy Operator scans workloads continuously, stores results as Kubernetes custom resources and passes findings to a ticket queue or dashboard. Each step ends with a check so the next step starts from verified state.

  1. Confirm cluster and registry access

    The platform team confirms that it can reach the target cluster with an administrator context, that nodes can pull images from the internal registry, and that the registry holds the images the operator needs. Record the cluster version, the namespace the operator will live in and the registry hostname and project path. The step is done when a test pod pulls an image from the internal registry and the team can list custom resource definitions with kubectl, which confirms the cluster accepts the API calls the operator will make.

  2. Mirror the Trivy databases to an internal registry

    Copy the trivy-db, trivy-java-db and trivy-checks artifacts from their published OCI locations into a registry your cluster can reach, using a connected workstation and an account allowed to push. Keep a dated record of each mirror run, because Trivy's self-hosting documentation warns that mirrors must be kept updated. On networks with no path to the registry, download the trivy-db or trivy-java-db archive on a connected machine and stage it for the cache directory instead. The step is done when the mirrored tags can be pulled from a node and their timestamps match the run log.

  3. Install the operator at a pinned version

    Install Trivy Operator from its published Helm chart or manifests into a dedicated namespace, pinning the chart and image versions in your deployment repository rather than taking the latest release. Use the image registry you mirrored to in the previous step if the cluster has no internet egress. Confirm the operator pod reaches the Running state and that its logs show no errors on startup. The step is done when the operator deployment reports ready and the version recorded in Git matches the running image.

  4. Point the operator at the mirrored databases

    Set the database repository options in the operator configuration so vulnerability, Java and check data come from your internal mirror, and disable any update path that would reach the public internet. Because the operator runs scans as jobs, verify the setting in the configuration map and in a scan job's arguments. Document who owns the mirror refresh schedule. The step is done when a scan job log shows it downloaded the database from the internal address and did not contact an external host.

  5. Set scan scope and operator RBAC

    Decide which namespaces the operator watches, and exclude system namespaces or areas that another team owns if your policy requires it. Bind the operator service account only to the permissions it needs to read workloads and write its own report resources, and review whether it needs access to Secrets, since exposed secret reports require reading them. Restrict who can read the vulnerability report resources, because the reports reveal your attack surface. The step is done when an access review of the operator's cluster roles matches the approved scope and a test service account cannot read reports outside its namespace.

  6. Run a first scan on a test namespace

    Deploy a small, known workload into a test namespace that is in scope, such as an image with a known older package version, so that the expected findings are predictable. The operator scans new Pods as they are created, so the workload alone should trigger reports. Watch the scan jobs complete and note how long each one took on your cluster for future capacity planning. The step is done when scan jobs for the test Pod finish without failure and reports appear for that workload.

  7. Verify custom resources and check report contents

    List the vulnerability, configuration audit, exposed secret and RBAC report resources in the test namespace and open one of each. Check that the report names the image, the installed package, the fixed version where one exists and the severity, and that the database version recorded in the report matches your mirror. Compare two or three findings against a second scanner or a manual lookup to confirm the data is right before anyone relies on it. The step is done when the expected findings appear with correct metadata and the team has written down the fields it will use for triage.

  8. Route report output to tickets or dashboards

    Export the report data through a path your team already runs, such as a scheduled job that reads the report resources through the Kubernetes API and posts new high-severity findings to a ticket queue, or a metrics exporter that feeds a dashboard. Where a vulnerability management tool such as DefectDojo is in use, import the JSON output and confirm that deduplication groups repeat findings correctly. Set up deduplication of tickets so a finding that persists across scans does not open a new ticket each time. The step is done when a test finding creates one ticket or dashboard entry, and a second scan of the same finding does not create a duplicate.

How findings reach tickets and dashboards without manual exports

The Trivy Operator writes its results as Kubernetes custom resources, so the first place findings land is the cluster itself. Vulnerability reports, config audit reports, exposed secret reports and RBAC assessment reports can each be listed and read with kubectl get and filtered by namespace or label, and any tool that reads the Kubernetes API can consume them. That covers quick triage and some dashboards, but it does not create tickets, deduplicate findings across scans or give security teams a place to track remediation over time. Most teams therefore need a forwarder, a scheduled export job or a vulnerability management platform between the cluster and their ticketing system. Decide early which of these owns the record of truth, because the answer determines where you deduplicate and where you close findings.

DefectDojo is one open-source option for that layer. Its open-source edition is licensed under BSD-3-Clause, exposes a REST API (API v2) that a job can use to import results, and deduplicates findings using per-parser hashcode fields, so repeated scans do not multiply the same issue. Local accounts are included in the open-source edition, while SSO with SAML, OIDC or OAuth, LDAP and MFA are DefectDojo Pro features. If your identity policy requires SSO or MFA for every tool that holds vulnerability data, that requirement alone may push the decision toward Pro or toward a different platform. Confirm with the DefectDojo documentation which edition and parser your team needs before you design the pipeline.

Security and operational risks of running Trivy Operator

Trivy Operator gives the cluster continuous visibility into vulnerabilities, misconfigurations and exposed secrets, so the operator and its reports become sensitive assets themselves. The cards below cover the access, data, supply chain and workload risks a team should plan for before turning the operator on in a production cluster.

Operator service account scope

The operator runs as its own service account and needs cluster-wide read access to inspect the workloads it scans, and it creates report objects in its namespace. Review the ClusterRole and bindings the Helm chart or manifests install, and confirm the operator cannot change workloads it only needs to read. Record the scope as part of your cluster access review so it is approved like any other privileged component.

Trivy Operator README

Report objects reveal exposure

Vulnerability and exposed-secret reports list affected images, packages, file paths and sometimes partial secret matches, so anyone who can read them learns where your weak points are. Restrict get, list and watch on these custom resources with RBAC, keep them out of broad developer roles, and confirm that audit logging captures reads of them. Treat report access as sensitive data access, not as a dashboard permission.

Stale offline vulnerability databases

In air-gapped or restricted networks, the vulnerability database is only as current as the last copy you loaded. A mirror that stops updating produces clean-looking reports for vulnerabilities published since then. Assign an owner for the mirror refresh, set a schedule, and check the database timestamp on each cluster before trusting an empty result. The Trivy documentation warns that mirrors must be kept updated.

Trivy self-hosting docs

Registry credentials for private images

Scanning private images means the operator must pull them, so it needs pull credentials through image pull secrets or a service account configured for your registry. Those credentials are another secret the operator can read. Use a dedicated read-only registry account, scope it to the repositories being scanned, rotate it on your normal schedule, and confirm the secret is not mounted into workloads that do not need it.

Upgrade cadence for operator and databases

The operator, the Trivy scanner image and the vulnerability database images each change on their own schedule, and a scanner that falls behind misses newer detections. Decide who tracks Trivy Operator releases, how quickly you test and roll out new versions, and how database mirror updates are verified before they reach production clusters. Include these components in the same patch process you use for the rest of the platform.

Report volume and alert fatigue

Continuous scanning creates a report for each image and workload, and a large cluster can produce thousands of findings, many of them duplicates or low-severity items with no fix available. Without filtering, teams stop reading alerts. Decide which severities and namespaces open tickets, deduplicate findings before they reach a queue, and review the thresholds each quarter with the owners who must act on them.

Questions teams ask before running Trivy Operator

Can our own platform team run Trivy Operator without outside help?

Yes, many platform teams install and operate Trivy Operator themselves, because it is Apache-2.0 licensed and runs inside the cluster as a controller that writes reports as custom resources. The harder part is usually not the installation but the surrounding work: deciding which namespaces and workloads are scanned, keeping vulnerability databases current in an offline environment, routing findings into tickets and agreeing who triages them. Ask your team whether it has time for those four areas. An outside partner typically adds value where the environment is air-gapped, spans several clusters or must satisfy an audit trail.

What makes the effort for Trivy Operator grow or shrink?

Effort scales with a few factors you can count before any quote:

  • Number of clusters and whether they share a scanning design or differ in version and purpose.
  • Whether the clusters can reach public vulnerability sources, or whether an internal registry must mirror the trivy-db, trivy-java-db and trivy-checks images and an offline update process must be designed.
  • Ticketing and dashboard integration, such as how findings become tickets in your tracker or rows in a DefectDojo-style tool.
  • Triage ownership, including severity thresholds, exception handling and retest rules.

Each factor adds design and testing work, and a quote should break effort down along these lines.

How long does a Trivy Operator setup usually take?

No duration can be stated responsibly without the scope, so treat any single number with caution. The setup length depends on the cluster count, whether an air-gapped database mirror is needed, how many integrations are required and how quickly your security team can review the first reports and agree on severity handling. A small, connected, single-cluster setup with reports reviewed in place is a much smaller job than a multi-cluster offline deployment feeding a ticketing system. Ask any provider for a written schedule tied to named milestones, including the point where the first scheduled scan results are reviewed with your owners.

What do we need to provide for a Trivy Operator engagement?

Expect to provide cluster administrator access for installation, RBAC rights to create the operator's service accounts and custom resource definitions, and read access to the reports for the review team. You will also need an internal container registry if images are pulled from a private source, and the database mirror if your clusters cannot reach the internet. Most important is a named triage owner who can accept or reject findings, set severity rules and sign off exceptions. Without that person, reports accumulate and the scanning produces no decisions. Confirm these items in writing at the start of scoping.

How does Trivy Operator relate to Kyverno, Gatekeeper and Falco?

Trivy Operator answers a different question from policy engines and runtime tools. It scans what is already present in the cluster, such as image vulnerabilities, configuration audit results, exposed secrets and RBAC findings, and records them as reports. Kyverno or OPA Gatekeeper decide what may be admitted, so they block or mutate resources at creation time. Falco watches runtime behavior on nodes and raises alerts when something suspicious happens. Many teams use all three: policies stop known-bad configurations, Trivy Operator reports the residual risk, and Falco detects activity after deployment. Plan which tool owns each decision so findings are not duplicated or ignored.

What should a quote for Trivy Operator work include?

A useful quote lists the scope in writing before any work starts. Ask for:

  • The clusters, namespaces and report types in scope, including vulnerability, config audit, exposed secret, RBAC and compliance reports.
  • Installation and configuration steps, offline database handling if needed, and the scan trigger approach.
  • Integration deliverables, such as the ticket or dashboard connection, the fields mapped and how duplicates are handled.
  • Documentation, handover sessions and the operating runbook for database updates.
  • Whether support or retesting is recurring or one time, and what it covers.

DeployOpen works from a written scope, so a quote should follow from that document, not from a generic template.

Do we pay ongoing costs after Trivy Operator is installed?

Yes, some costs recur even though the operator itself is open source under Apache-2.0. Recurring work includes keeping the vulnerability and checks databases current, reviewing new findings, maintaining the operator as Kubernetes versions change and keeping ticket integrations working. Compute and storage for report resources also grow with the number of workloads scanned. The one-time costs are design, initial installation, integration build and handover. Ask a provider to separate these categories in the quote so you can budget the operating work your own team will absorb after go-live.

Who owns the findings after the scan reports appear?

Your organization owns the findings and every decision made about them. The scanner produces reports, but accepting a risk, fixing an image, changing a configuration or excluding a workload needs a named owner with the authority to decide. Define the severity levels that trigger tickets, the expected response for each level, the process for documented exceptions and the retest condition that closes a finding. DeployOpen can prepare the process and integration, but it does not take over triage decisions unless that is written into a retainer scope.

Where the official documentation answers the detailed questions

For current configuration keys, start with the trivy-operator README and the Trivy reporting and self-hosting documentation rather than with any summary, including this page. The operator's Helm values, the report formats it writes, and the way scan jobs and cache settings are named change between releases, so the exact keys you deploy should be copied from the version you intend to run. Before you write a single values file, confirm which release your change window targets and read the matching README section for that release. Treat the README as the source for operator settings, and treat the Trivy documentation as the source for scanner behavior, output formats and database selection.

The Trivy reporting documentation is the place to confirm which output formats the scanner supports, such as table, JSON, SARIF, template, SBOM and GitHub dependency snapshot, and how a template is supplied. Use it when you decide how findings leave the cluster and whom they reach, because a ticketing or dashboard import usually depends on one of those formats and on the fields it carries. Check the format against your downstream consumer in a test namespace before you commit to a pipeline, since a format that looks compatible on paper can drop fields your deduplication logic needs.

The self-hosting documentation covers the settings an air-gapped or restricted-egress cluster needs: pointing the vulnerability, Java and check databases at an internal OCI registry, and loading an archive into the cache directory on a machine with no internet access. Read it before you schedule any mirror job, because the documentation warns that mirrors must be kept updated, and an outdated mirror silently produces reports that look clean. Ask your platform team who owns the mirror refresh, how often it runs, and how an operator is alerted when it stops, and confirm each of those points against the documentation for your version.

How DeployOpen works on this

DeployOpen plans and deploys Trivy Operator inside your own clusters, so scan reports stay in your environment and feed the tools your teams already use. Each engagement starts with a written scope that names the clusters, namespaces, report types and downstream systems involved.

How we scope

  • Inventory clusters, namespaces and workloads that need continuous scanning, and confirm which Kubernetes versions run them.
  • Decide which report types to enable, such as vulnerability, config audit, exposed secret and RBAC reports, and which compliance profiles apply.
  • Confirm whether scanning runs in air-gapped networks, which requires a mirrored vulnerability database and a planned update process.

How we build

  • Install the operator with Helm or manifests, set scan triggers and resource limits, and test scans in a non-production cluster first.
  • Configure private registry mirrors for the trivy-db, trivy-java-db and trivy-checks repositories when the cluster has no internet access.
  • Connect report output to ticketing, DefectDojo or dashboards, and test deduplication and ownership mapping with sample findings.

How we hand over

  • Deliver the written configuration, RBAC for report readers, and a runbook covering scan triggers, database refresh and failure handling.
  • Document how each report custom resource maps to a remediation owner, severity threshold and ticket workflow your team agreed to.
  • Walk through the rollout with your platform and security teams, and record open risks and accepted exceptions in the handover pack.

How we support

  • Ongoing support, operator upgrades, database mirror maintenance and continuous testing are available as retainers.
  • Ask for the support scope in writing, including who updates the vulnerability mirror and how often, before the engagement starts.
  • Quotes follow from the written scope, so confirm cluster count, report integrations and air-gap requirements with DeployOpen first.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.