Skip to content
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 explicit version information to emitted records #763

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

wagoodman
Copy link
Contributor

Today we have the namespace field which conveys "ID:VERSION" for distro information. This field is a hold over from how anchore enterprise used to function. The downside is that the current version resolution for some operating systems does not consider the minor or patch version, which is conveyed in some OS fix information (such as redhat and oracle linux). This PR nudges the existing OS schema forward by adding a specific OS field with OS ID (aligning with /etc/os-release ID) and Version properties (which should be as specific as possible relative to the fix information). All providers have been updated to use this new field (ideally we'll remove the Namespace fields as a breaking change in the future).

I've additionally added architecture qualifiers to the fix information as well, but have not updated any provider to use this new field.

Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Copy link
Contributor Author

@wagoodman wagoodman Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff schema/vulnerability/os/schema-1.0.2.json schema/vulnerability/os/schema-1.0.3.json
72a73,89
>                 "OS": {
>                   "type": "object",
>                   "properties": {
>                     "ID": {
>                       "type": "string"
>                     },
>                     "Version": {
>                       "type": "string"
>                     }
>                   }
>                 },
>                 "Architectures": {
>                   "type": "array",
>                   "items": {
>                     "type": "string"
>                   }
>                 },

@wagoodman wagoodman added the run-pr-quality-gate Triggers running of quality gate on PRs label Jan 13, 2025
Signed-off-by: Alex Goodman <[email protected]>
@wagoodman wagoodman force-pushed the add-distro-version-info branch from 5dcaa54 to 840d63c Compare January 13, 2025 21:08
@westonsteimel
Copy link
Contributor

westonsteimel commented Jan 16, 2025

Hmm, what about prior minor versions of the same release line though? For instance, if there is a fix available in the rhel 8.7 appstream but the prior 8.x appstreams should still be considered vulnerable because there won't be a fix released to them?

If the release info is just captured in the RPM version information like today then the < comparison will work, but if it is instead part of the namespace then I'm not sure it will unless we have special logic that also adds a namespace for just the major version to fall back on (though that may be the responsibility of grype-db rather than vunnel)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-pr-quality-gate Triggers running of quality gate on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants