fix: add amazon_linux as alias for Amazon Linux distro#3380
Open
avasis-ai wants to merge 1 commit into
Open
Conversation
Amazon Linux CPE uses amazon_linux as the product identifier, but grype only mapped the os-release ID "amzn" to the AmazonLinux type. This caused unknown distro warnings and missed OS vulnerability matching when users supply distro info derived from CPE (e.g. amazon_linux-2). Closes anchore#3229
Contributor
|
Hey @avasis-ai I haven't reviewed this PR but it looks like you need to sign-off your commits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Amazon Linux's CPE uses
amazon_linuxas the product identifier (e.g.,cpe:2.3:o:amazon:amazon_linux:2:*:*:*:*:*:*:*), but grype only mapped the/etc/os-releaseIDamznto theAmazonLinuxtype. This caused "unknown distro" warnings and missed OS vulnerability matching when users supply distro info derived from CPE data or PURL?distro=qualifiers usingamazon_linux.Change
Added
"amazon_linux"to thealiasTypesmap ingrype/distro/type.go, resolving it toAmazonLinux(same as"amzn").Also added a test case to verify the alias mapping works via
TypeFromRelease.Examples
amazon_linux-2→ now treated asamzn-2amazon_linux-2023→ now treated asamzn-2023Closes #3229