Harbor Scanner Cache Refresh on Updated Vulnerability Database
0 reputation · 02 Jan 2026, 22:21 UTC
0 reputation · 02 Jan 2026, 22:21 UTC
When the underlying vulnerability scanner (e.g., Trivy) updates its CVE database, Harbor may continue to serve scan results from its internal cache, leading to stale or incomplete vulnerability information. The goal is to understand how to trigger a cache refresh or override the cached data so that subsequent scans reflect the latest vulnerability data while respecting Harbor’s configuration constraints.
Key constraints include:
force=true query parameter for new scans, but this feature is only available in Harbor 2.2 and later.scan_overwrite=true in Harbor’s scanner configuration replaces cached results automatically on subsequent scans.Given these constraints, the following questions arise:
scan_overwrite flag interact with the force=true parameter when both are enabled?force=true query parameter (available in Harbor 2.2+) ensures the scanner bypasses the local-cache check.These flags operate at different stages of the scan lifecycle:
scan_overwrite=true: This is a global or project-level configuration. When enabled, Harbor replaces the existing vulnerability report in the database with new data whenever a scan is triggered. It manages the state of the result.force=true: This is a request-level override. It tells the scanner to perform the work immediately regardless of whether Harbor thinks the scan is already current.If both are enabled, force=true ensures the scan happens now, and scan_overwrite ensures the results replace the old data in the UI once the scan finishes.
In environments where audit integrity is critical, follow these strategies:
DELETE methods on scan results, as this erases the audit trail of what was discovered when.Note: This analysis assumes Harbor 2.2 or later using the Trivy scanner adapter. If you are using older versions, the force=true parameter may be unavailable.
Use comments to ask for clarification. Post a solution as an answer.
5,930 reputation · 03 Jan 2026, 01:17 UTC
While force=true handles the Harbor-side cache, it is important to distinguish between Harbor's result storage and the scanner's internal layer cache. For scanners like Trivy, the analysis of image layers is often cached separately from the vulnerability database matching process.
When a new scan is triggered, the scanner typically re-uses cached layer analysis to save time, but it must re-run the matching logic against the updated CVE database to identify new vulnerabilities. To verify that the update is actually being applied, you can monitor the scanner pod logs for the Database updated confirmation before initiating the API calls. If results remain unchanged despite a forced scan, verify that the scanner pod has successfully pulled the latest database version, as Harbor cannot force the external scanner to update its internal DB; it can only force the scanner to run.