-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add suggested fixed version #2271
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Tomer Seinfeld <[email protected]>
Signed-off-by: tomersein <[email protected]>
Signed-off-by: Tomer Seinfeld <[email protected]>
Signed-off-by: tomersein <[email protected]>
The discussion at #2264 (comment) should be wrapped up before we merge this. |
Signed-off-by: tomersein <[email protected]>
Signed-off-by: tomersein <[email protected]>
hi @willmurphyscode , |
Signed-off-by: tomersein <[email protected]>
Signed-off-by: tomersein <[email protected]>
Signed-off-by: tomersein <[email protected]>
Signed-off-by: tomersein <[email protected]>
Signed-off-by: tomersein <[email protected]>
Signed-off-by: tomersein <[email protected]>
Signed-off-by: tomersein <[email protected]>
Signed-off-by: tomersein <[email protected]>
hi @willmurphyscode |
Taking a look today. I am using the following as a manual test case:
This image includes
produces the expected output: {
"type": "cpe-match",
"matcher": "stock-matcher",
"searchedBy": {
"namespace": "nvd:cpe",
"cpes": [
"cpe:2.3:a:oracle:openjdk:17.0.13:*:*:*:*:*:*:*"
],
"package": {
"name": "openjdk",
"version": "17.0.13+11"
}
},
"found": {
"vulnerabilityID": "CVE-2025-21502",
"versionConstraint": "< 1.8.0_441 || >= 1.9-ea, < 8.0.441 || >= 9-ea, < 11.0.26 || >= 12-ea, < 17.0.14 || >= 18-ea, < 21.0.6 || >= 22-ea, < 23.0.2 (jvm)",
"cpes": [
"cpe:2.3:a:oracle:openjdk:*:*:*:*:*:*:*:*"
]
},
"suggestedFixedVersion": "17.0.14"
} I think there are two changes left to make:
@anchore/tools what do we think of the name |
I'm generally ok with this field name, but if there could be more fix information in the future then saving a object for that could be nice:
We do have some spots in the v6 schema where other fix information could be plumbed through one day (such as date released, git commit, etc). Or we don't even need to say that it's "suggested":
|
Hi @tomersein! We talked about the naming a bit, and we'd like 2 changes to this PR before we can merge it:
{
"type": "cpe-match",
"matcher": "stock-matcher",
...
"fix": {
"suggestedVersion": "17.0.14"
}
} That gives us a place to add more deta about the fix later, and keeps us from having a single field with a long name. Thanks! |
grype/presenter/models/match.go
Outdated
Matcher: string(d.Matcher), | ||
SearchedBy: d.SearchedBy, | ||
Found: d.Found, | ||
SuggestedFixedVersion: suggestedFixedVersion, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this was discussed before, so apologies for suggesting it again... but what about having this be a slice, populated with all known upgrades, sorted from "smallest" to "largest". I might even call this field "Upgrades": iterate over all known fix versions, omit any fix versions less than the current software version. So fix[0] would be "the easiest" fix, but there would be potentially other upgrades you could do, like upgrading to a OpenJDK 21 from OpenJDK 11, for example. If you were on OpenJDK 11, suggesting OpenJDK 11.x rather than 21 seems less than ideal for something that seems to be a recommendation, even if it's probably the easiest fix. Using this same logic for the table view "fixed-in" would seem to be good to do, also
Signed-off-by: tomersein <[email protected]>
hi @kzantow @willmurphyscode @wagoodman |
closes - #2264
this PR aims to add a new field to match details which specifies the suggested fixed version