Repository navigation
Cyclone dx java - matching - #2057
Conversation
8be49b9 to
ee6f9ff
Compare
1237ce6 to
f677e0d
Compare
91b5dc7 to
3d92286
Compare
RepositoryKey is the key for a Red Hat product CPE attributed to a Java component. Signed-off-by: crozzy <joseph.crosland@gmail.com>
pkg:maven rows are now accepted. The package name is namespace:name, ignoring repository_url and type. FixedInVersion is the PURL version for a fixed row. Maven known_not_affected rows are skipped, and a versioned known_affected Maven PURL is not ingested. TODO: resolve what a version on a known_affected Maven PURL means. TODO: move the feed URL back to the production vex-feed once Maven data is published there. Signed-off-by: crozzy <joseph.crosland@gmail.com>
3d92286 to
01e8d32
Compare
BradLugo
left a comment
There was a problem hiding this comment.
I have some other discussion points, but won't block on them for the sake of time
| slog.WarnContext(ctx, "unable to unbind repo CPE", "reason", err, "vulnerability name", vuln.Name) | ||
| return false, nil | ||
| } | ||
| if !cpe.Compare(vuln.Repo.CPE, record.Repository.CPE).IsSuperset() && !rhel.IsCPESubstringMatch(record.Repository.CPE, vuln.Repo.CPE) { |
There was a problem hiding this comment.
I suspect substring matching will produce unexpected results (e.g., 1 > 10)
There was a problem hiding this comment.
hmmm, yeah, that seems like an original bug in the CPE subset matching. Honestly I feel like this could deserve its own PR but it makes backporting more annoying. I will include a fix in a commit here and we can discuss it
The matcher selects redhat-java-cpe-repository records. It applies the RHEL CPE check, then compares Maven versions: an installed package is vulnerable when it is strictly older than FixedInVersion, and an empty FixedInVersion matches any installed version. Signed-off-by: crozzy <joseph.crosland@gmail.com>
9e7e92b to
c2f47ea
Compare
| if vuln.FixedInVersion == "" { | ||
| return true, nil | ||
| } | ||
| installed, err := maven.ParseVersion(record.Package.Version) |
There was a problem hiding this comment.
I think it may be possible to have an empty ("") record.Package.Version
There was a problem hiding this comment.
Will check and return not vulnerable if the record.Package.Version is empty
There was a problem hiding this comment.
A whole-string prefix matched version 1 to version 10 and treated a dot in any attribute as a boundary. Extend the pattern version when the indexed version continues with a dot, then compare the CPEs once with the normal superset rules. Version 4 still matches 4.13. Signed-off-by: crozzy <joseph.crosland@gmail.com>
c2f47ea to
868672d
Compare
|
/fast-forward |
No description provided.