mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-05 20:40:16 -08:00
fix(license): disable jar analyzer for licence scan only (#3780)
This commit is contained in:
@@ -494,6 +494,15 @@ func disabledAnalyzers(opts flag.Options) []analyzer.Type {
|
||||
analyzers = append(analyzers, analyzer.TypeLicenseFile)
|
||||
}
|
||||
|
||||
// Parsing jar files requires Java-db client
|
||||
// But we don't create client if vulnerability analysis is disabled and SBOM format is not used
|
||||
// We need to disable jar analyzer to avoid errors
|
||||
// TODO disable all languages that don't contain license information for this case
|
||||
if opts.Scanners.Enabled(types.LicenseScanner) && !opts.Scanners.Enabled(types.VulnerabilityScanner) &&
|
||||
!slices.Contains(report.SupportedSBOMFormats, opts.Format) {
|
||||
analyzers = append(analyzers, analyzer.TypeJar)
|
||||
}
|
||||
|
||||
// Do not perform misconfiguration scanning on container image config
|
||||
// when it is not specified.
|
||||
if !opts.ImageConfigScanners.Enabled(types.MisconfigScanner) {
|
||||
|
||||
Reference in New Issue
Block a user