Skip to content

fix(amazon): scan Amazon Corretto packages built for Amazon Linux - #11774

Open
luiacuaniello wants to merge 1 commit into
aquasecurity:mainfrom
luiacuaniello:fix/rpm-amazon-corretto-vendor
Open

luiacuaniello wants to merge 1 commit into
aquasecurity:mainfrom
luiacuaniello:fix/rpm-amazon-corretto-vendor

Conversation

@luiacuaniello

Copy link
Copy Markdown
Contributor

Description

Fixes the problem reported in #11773: the Corretto RPMs built for Amazon Linux have Vendor: Amazon, which doesn't match Amazon Linux or Amazon.com in osVendors. Trivy classified them as third-party and dropped them before detection, so none of their ALAS advisories were reported.

packageProvidedByVendor already treats a package with no vendor and amzn in the release as official (#5887). I extended the same check to the Amazon vendor. The discussion suggests not relying on the amzn release alone, and this change doesn't: a package needs both the Amazon vendor and amzn in the release. Corretto's generic RPMs don't have amzn in the release (amazoncorretto:21-al2 has 21.0.12.12-1), so they're still third-party.

I also bumped the rpm analyzer version to 5. Without that, layers already in the cache keep the old third-party class.

Before, on amazoncorretto:21.0.12-al2023:

DEBUG	[amazon] Skipping third-party packages	packages=[java-21-amazon-corretto java-21-amazon-corretto-devel java-21-amazon-corretto-headless java-21-amazon-corretto-jmods]
INFO	[amazon] Detecting vulnerabilities...	os_version="2023" pkg_num=139
│ amazoncorretto:21.0.12-al2023 (amazon 2023.12.20261021 (Amazon Linux)) │ amazon │       70        │

After:

INFO	[amazon] Detecting vulnerabilities...	os_version="2023" pkg_num=143
│ amazoncorretto:21.0.12-al2023 (amazon 2023.12.20261021 (Amazon Linux)) │ amazon │       294       │

The 224 new findings are in the four Corretto packages, 56 CVEs in total, including CVE-2026-114938, which ALAS fixes in 1:21.0.13.1.2-1.amzn2023.1. amazoncorretto:21.0.13-al2023, which has the fix, still reports nothing, and amazoncorretto:21.0.12-al2 stays at 32. I scanned each image with both builds, the same DB and an empty cache directory.

In Test_rpmPkgAnalyzer_listPkgs, the new case for a Corretto package built for Amazon Linux fails without the change, and a second case checks that the generic RPM stays third-party. golangci-lint v2.14.0 reports no issues.

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

Corretto RPMs built for Amazon Linux have the vendor "Amazon", which
doesn't match osVendors, so they were classified as third-party and
skipped even though ALAS covers them.

Treat packages with "amzn" in the release and an empty or "Amazon"
vendor as official, and bump the rpm analyzer version so that cached
layers are analyzed again.
@luiacuaniello
luiacuaniello force-pushed the fix/rpm-amazon-corretto-vendor branch from 1efab62 to 26cc507 Compare November 27, 2026 14:46

This branch has not been deployed

No deployments
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.

1 participant