diff --git a/go/osv/ecosystem/ecosystem.go b/go/osv/ecosystem/ecosystem.go index 19c680340b9..a1b9ab488f9 100644 --- a/go/osv/ecosystem/ecosystem.go +++ b/go/osv/ecosystem/ecosystem.go @@ -56,6 +56,7 @@ func statelessFactory[E Ecosystem](_ string) Ecosystem { var ecosystems = map[osvconstants.Ecosystem]ecosystemFactory{ osvconstants.EcosystemAlmaLinux: statelessFactory[rpmEcosystem], + osvconstants.EcosystemAzureLinux: statelessFactory[rpmEcosystem], osvconstants.EcosystemAlpaquita: statelessFactory[apkEcosystem], osvconstants.EcosystemAlpine: statelessFactory[apkEcosystem], osvconstants.EcosystemBellSoftHardenedContainers: statelessFactory[apkEcosystem], diff --git a/go/osv/ecosystem/wrapper_test.go b/go/osv/ecosystem/wrapper_test.go index 11b34a8a278..cdfddb8108d 100644 --- a/go/osv/ecosystem/wrapper_test.go +++ b/go/osv/ecosystem/wrapper_test.go @@ -17,6 +17,7 @@ func TestZeroVersion(t *testing.T) { {"Maven", "alpha-alpha-alpha"}, {"npm", "0-pre"}, {"AlmaLinux:8", "B.02.19.2-6.el8"}, // ALBA-2021:4442 + {"Azure Linux:2", "5.15.55.1-1"}, // AZL-10003 {"Debian:11", "0~20200923.3-2+deb11u1"}, // DLA-4116-1 {"Go", "0.0.0-20250619215741-6356e984b82a"}, // GHSA-24ch-w38v-xmh8 {"Mageia:9", "gtk+2.0-2.24.33-5.1.mga9"}, // MGASA-2024-0312 diff --git a/osv/ecosystems/_ecosystems.py b/osv/ecosystems/_ecosystems.py index 2861a5bca12..e754180ba04 100644 --- a/osv/ecosystems/_ecosystems.py +++ b/osv/ecosystems/_ecosystems.py @@ -37,6 +37,7 @@ _ecosystems = { 'AlmaLinux': RPM, 'Alpaquita': APK, + 'Azure Linux': RPM, 'Alpine': Alpine, 'BellSoft Hardened Containers': APK, 'Bioconductor': Bioconductor, diff --git a/osv/ecosystems/redhat_test.py b/osv/ecosystems/redhat_test.py index 0f785d27b11..022d788816e 100644 --- a/osv/ecosystems/redhat_test.py +++ b/osv/ecosystems/redhat_test.py @@ -126,6 +126,7 @@ def test_rpm_ecosystems(self): ecos = [ 'Red Hat', 'AlmaLinux', + 'Azure Linux', 'Mageia', 'openEuler', 'openSUSE', diff --git a/osv/purl_helpers.py b/osv/purl_helpers.py index d9fc5690df2..3c7beb64ca4 100644 --- a/osv/purl_helpers.py +++ b/osv/purl_helpers.py @@ -26,6 +26,8 @@ ECOSYSTEM_PURL_DATA = { 'AlmaLinux': EcosystemPURL('rpm', 'almalinux'), + 'Azure Linux': + EcosystemPURL('rpm', 'azure-linux'), 'Alpaquita': EcosystemPURL('apk', 'alpaquita'), 'Alpine': diff --git a/osv/purl_helpers_test.py b/osv/purl_helpers_test.py index f0abe5c681e..139ed41704d 100644 --- a/osv/purl_helpers_test.py +++ b/osv/purl_helpers_test.py @@ -26,6 +26,10 @@ def tests_package_to_purl(self): self.assertEqual('pkg:rpm/almalinux/libvpx', purl_helpers.package_to_purl('AlmaLinux', 'libvpx')) + self.assertEqual( + 'pkg:rpm/azure-linux/test-package', + purl_helpers.package_to_purl('Azure Linux', 'test-package')) + self.assertEqual('pkg:apk/alpaquita/xz?arch=source', purl_helpers.package_to_purl('Alpaquita', 'xz')) @@ -184,6 +188,10 @@ def test_parse_purl(self): self.assertEqual(('AlmaLinux', 'libvpx', None), purl_helpers.parse_purl('pkg:rpm/almalinux/libvpx')) + self.assertEqual( + ('Azure Linux', 'test-package', '1.2.3'), + purl_helpers.parse_purl('pkg:rpm/azure-linux/test-package@1.2.3')) + self.assertEqual(('Alpaquita', 'xz', None), purl_helpers.parse_purl( 'pkg:apk/alpaquita/xz?arch=source&distro=stream'))