-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.scan/licenseIssues relating to license scanningIssues relating to license scanning
Description
Description
Trivy currently ignores licenses only by full compliance.
e.g. for LGPLv2+ and MIT
you need to use LGPLv2+ and MIT
(MIT and LGPLv2+
will not work).
Feature
Using license IDs to ignore SPDX expressions.
This means that if the ignore list contains all license identifiers from an SPDX expression, Trivy should ignore that license.
e.g. for LGPLv2+ and MIT
you can add LGPLv2+
+ MIT
.
Required changes:
Changes can be add in this function:
Lines 180 to 182 in 4cfb2a9
func (c *IgnoreConfig) MatchLicense(licenseID, filePath string) *IgnoreFinding { | |
return c.Licenses.Match(licenseID, filePath, nil) | |
} |
Needed:
- check that license is valid SPDX expression
- split SPDX expression to SPDX IDs
- use
c.Licenses.Match
for each SPDX IDs and for SDPX expression
Discussed in #9027
Metadata
Metadata
Assignees
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.scan/licenseIssues relating to license scanningIssues relating to license scanning