Skip to content

Conversation

jacobcalvert
Copy link

Description

Several tools are generating purls for packages in various Linux distributions. This change adds clarifications for the expected namespace for the most popular distributions using each package type.

@meljw
Copy link

meljw commented Jan 10, 2025

Hi, wondering if this is relevant for you. I have seen different namespaces for Oracle Linux (mysql docker)

  • Syft gives ol
  • cdxgen gives oracle
  • Docker Scout gives oraclelinux

@jacobcalvert
Copy link
Author

Hi, wondering if this is relevant for you. I have seen different namespaces for Oracle Linux (mysql docker)

  • Syft gives ol
  • cdxgen gives oracle
  • Docker Scout gives oraclelinux

Thanks!
I paused on adding these since I didn't find consensus among the different tools, but I think oracle or oraclelinux makes most sense; ol is a bit too short and ambiguous. If the spec maintainers agree, I'll update my PR to include one of those two as well in the definition list.

@giterlizzi
Copy link
Contributor

If it can be useful for PR in my SecDB project (https://secdb.nttzen.cloud/pkg) support this several PURL namespaces for deb and rpm:

Type Namespace
deb debian
deb ubuntu
rpm almalinux
rpm amazonlinux
rpm azurelinux
rpm cbl-mariner
rpm centos
rpm fedora
rpm opensuse
rpm oraclelinux
rpm redhat
rpm rockylinux
rpm suse

@gernot-h
Copy link
Contributor

Yes, such a clarification would be great and help avoid ambiguities like anchore/syft#2914.

@johnmhoran johnmhoran added this to the 1.1 milestone Apr 4, 2025
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

If it can be useful for PR in my SecDB project (https://secdb.nttzen.cloud/pkg) support this several PURL namespaces for deb and rpm:
Type Namespace
deb debian
deb ubuntu
rpm almalinux
rpm amazonlinux
rpm azurelinux
rpm cbl-mariner
rpm centos
rpm fedora
rpm opensuse
rpm oraclelinux
rpm redhat
rpm rockylinux
rpm suse

@giterlizzi do you mind to suggest this as an update?
Or shall I add this directly?
or @ jacobcalvert do you want to add these?

@jacobcalvert
Copy link
Author

If it can be useful for PR in my SecDB project (https://secdb.nttzen.cloud/pkg) support this several PURL namespaces for deb and rpm:
Type Namespace
deb debian
deb ubuntu
rpm almalinux
rpm amazonlinux
rpm azurelinux
rpm cbl-mariner
rpm centos
rpm fedora
rpm opensuse
rpm oraclelinux
rpm redhat
rpm rockylinux
rpm suse

@giterlizzi do you mind to suggest this as an update? Or shall I add this directly? or @ jacobcalvert do you want to add these?

I'm happy to add these to this PR. Will do that shortly, thanks for taking a look.

@jacobcalvert jacobcalvert requested a review from pombredanne June 28, 2025 21:35
@giterlizzi
Copy link
Contributor

If it can be useful for PR in my SecDB project (https://secdb.nttzen.cloud/pkg) support this several PURL namespaces for deb and rpm:
Type Namespace
deb debian
deb ubuntu
rpm almalinux
rpm amazonlinux
rpm azurelinux
rpm cbl-mariner
rpm centos
rpm fedora
rpm opensuse
rpm oraclelinux
rpm redhat
rpm rockylinux
rpm suse

@giterlizzi do you mind to suggest this as an update? Or shall I add this directly? or @ jacobcalvert do you want to add these?

I listed them only as a suggestion because they are the most common ones I have found in tools, SBOM files, etc.
The alternative is to use the ID field from the "os-release" file, but it does not always report the full name (e.g. for Oracle Linux it reports ol).

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Thanks! See some nits for your consideration.
Also can you beat the bushes to get some input from folks involved with some of the distros to provide a quick ack or comment?

PURL-TYPES.rst Outdated
@@ -545,8 +563,9 @@ rpm
- Examples::

pkg:rpm/fedora/[email protected]?arch=i386&distro=fedora-25
pkg:rpm/[email protected]?arch=i686&epoch=1&distro=fedora-25

pkg:rpm/rocky/[email protected]?arch=x86_64&distro=rocky-8.6&upstream=acl-2.2.53-1.el8.1.src.rpm
Copy link
Member

Choose a reason for hiding this comment

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

you mentioned rocklinux above but use rocky here.

Suggested change
pkg:rpm/rocky/[email protected]?arch=x86_64&distro=rocky-8.6&upstream=acl-2.2.53-1.el8.1.src.rpm
pkg:rpm/rockylinux/[email protected]?arch=x86_64&distro=rocky-8.6&upstream=acl-2.2.53-1.el8.1.src.rpm

PURL-TYPES.rst Outdated

pkg:rpm/rocky/[email protected]?arch=x86_64&distro=rocky-8.6&upstream=acl-2.2.53-1.el8.1.src.rpm
pkg:rpm/almalinux/[email protected]?arch=x86_64&distro=almalinux-8.4&upstream=acl-2.2.53-1.el8.src.rpm
pkg:rpm/redhat/[email protected]?arch=x86_64&distro=rhel-8.7&upstream=acl-2.2.53-1.el8.src.rpm
Copy link
Member

Choose a reason for hiding this comment

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

Please keep an empty line there

PURL-TYPES.rst Outdated
pkg:rpm/[email protected]?arch=i686&epoch=1&distro=fedora-25

pkg:rpm/rocky/[email protected]?arch=x86_64&distro=rocky-8.6&upstream=acl-2.2.53-1.el8.1.src.rpm
pkg:rpm/almalinux/[email protected]?arch=x86_64&distro=almalinux-8.4&upstream=acl-2.2.53-1.el8.src.rpm
Copy link
Member

Choose a reason for hiding this comment

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

Why do you introduce a new upstream qualifier? I get the intent but I am not sure this is not already entirely determined from the RPM tags.
In all cases, can you leave this out for another PR?

@pombredanne pombredanne requested a review from mprpic July 2, 2025 15:14
Copy link
Contributor

@mprpic mprpic left a comment

Choose a reason for hiding this comment

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

LGTM!

PURL-TYPES.rst Outdated
- CBL-Mariner uses ``cbl-mariner``
- Fedora uses ``fedora``
- CentOS uses ``centos``
- Rocky Linux uses ``rockylinux``
Copy link

Choose a reason for hiding this comment

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

osv.dev says rocky-linux google/osv.dev#2939

@gernot-h
Copy link
Contributor

gernot-h commented Jul 24, 2025

If it can be useful for PR in my SecDB project (https://secdb.nttzen.cloud/pkg) support this several PURL namespaces for deb and rpm:
Type Namespace
[...]
rpm amazonlinux

@giterlizzi, do you have a reference for using amazonlinux? Just wanted to mention, yesterday, I got a trivy-generated SBOM which uses just rpm/amazon/glibc. If other common tools use amazonlinux, I'm fine with keeping it, didn't do a market survey. ;-)

@giterlizzi
Copy link
Contributor

If it can be useful for PR in my SecDB project (https://secdb.nttzen.cloud/pkg) support this several PURL namespaces for deb and rpm:
Type Namespace
[...]
rpm amazonlinux

@giterlizzi, do you have a reference for using amazonlinux? Just wanted to mention, yesterday, I got a trivy-generated SBOM which uses just rpm/amazon/glibc. If other common tools use amazonlinux, I'm fine with keeping it, didn't do a market survey. ;-)

I confirm that there are several PURL variants for AmazonLinux:

Docker Scout SBOM command output:

docker scout sbom amazonlinux:latest

    {
      "type": "rpm",
      "namespace": "amazonlinux",
      "name": "zstd",
      "version": "1.5.5-1.amzn2023.0.1",
      "purl": "pkg:rpm/amazonlinux/[email protected]?os_name=amazonlinux&os_version=2023",
      "size": 799606,
      "locations": [...],
      [...]
    }
immagine

@pombredanne
Copy link
Member

We now have a more structured definition of types in JSON after the merge of PR #514 😇 - See #514

With the new approach... this PR would need to be updated. Could you look into this? Thanks for your understanding !

@jacobcalvert jacobcalvert force-pushed the jacobcalvert/add-rpm-and-deb-clarification branch from 80c1121 to ea4bc0c Compare July 28, 2025 14:38
@jacobcalvert
Copy link
Author

jacobcalvert commented Jul 28, 2025

@pombredanne I'm looking at the purl-type-definition.schema.json and don't see a way to provide an enumeration of valid values in the namespace_definition field. Did you intend for my PR to add this enumeration ability to the base meta schema and then add it to the RPM schema or something else?

@jacobcalvert
Copy link
Author

@pombredanne any thoughts on this? I don't want this set of clarifications to get lost as we need the clarity about proper PURL formats for various Linux distros.

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

Successfully merging this pull request may close these issues.

8 participants