mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
feat: Add TrivyConfig.VulnSeveritySources (Trivy's --vuln-severity-source) (#3943)
And default it to ["auto"] when unset, with an info log from applyDefaultValues. Refactor CVE NewScanner to take *CVEConfig instead of separate DB repository strings so the full Trivy block is available to the scanner. Extend CLI and search tests for the new field and logged config; document CVE/Trivy in examples/README and add examples/config-cve-trivy.json. Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
This commit is contained in:
@@ -891,6 +891,14 @@ func applyDefaultValues(config *config.Config, viperInstance *viper.Viper, logge
|
||||
|
||||
config.Extensions.Search.CVE.Trivy.JavaDBRepository = defaultJavaDBDownloadURL
|
||||
}
|
||||
|
||||
if len(config.Extensions.Search.CVE.Trivy.VulnSeveritySources) == 0 {
|
||||
defaultVulnSeveritySources := []string{"auto"}
|
||||
logger.Info().Strs("vulnSeveritySources", defaultVulnSeveritySources).Str("component", "config").
|
||||
Msg("using default trivy vulnerability severity sources.")
|
||||
|
||||
config.Extensions.Search.CVE.Trivy.VulnSeveritySources = defaultVulnSeveritySources
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user