Skip to content

fix: add amazon_linux as alias for Amazon Linux distro#3380

Open
avasis-ai wants to merge 1 commit into
anchore:mainfrom
avasis-ai:fix-add-amazon-linux-alias
Open

fix: add amazon_linux as alias for Amazon Linux distro#3380
avasis-ai wants to merge 1 commit into
anchore:mainfrom
avasis-ai:fix-add-amazon-linux-alias

Conversation

@avasis-ai

Copy link
Copy Markdown

Description

Amazon Linux's CPE uses amazon_linux as the product identifier (e.g., cpe:2.3:o:amazon:amazon_linux:2:*:*:*:*:*:*:*), but grype only mapped the /etc/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 data or PURL ?distro= qualifiers using amazon_linux.

Change

Added "amazon_linux" to the aliasTypes map in grype/distro/type.go, resolving it to AmazonLinux (same as "amzn").

Also added a test case to verify the alias mapping works via TypeFromRelease.

Examples

  • amazon_linux-2 → now treated as amzn-2
  • amazon_linux-2023 → now treated as amzn-2023

Closes #3229

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
@kzantow

kzantow commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Hey @avasis-ai I haven't reviewed this PR but it looks like you need to sign-off your commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add amazon_linux alias for amzn now aliased only by amazonlimux)

3 participants