Skip to content

Commit 3868f9a

Browse files
authored
Merge branch 'main' into add-generic-purl-type
2 parents bbf01f6 + 2ca6745 commit 3868f9a

26 files changed

Lines changed: 8238 additions & 527 deletions

docs/cpe.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Identifying Red Hat components using CPEs
2+
Common Platform Enumeration (CPE) is a standardized method of describing and identifying classes of applications,
3+
operating systems, and hardware devices present among an enterprise's computing assets.
4+
5+
Red Hat uses CPEs to uniquely identify each product and version, following the CPE 2.2 schema.
6+
7+
## RHEL 10 CPEs
8+
Starting with RHEL 10, we will change the way CPEs are assigned to RHEL:
9+
10+
* Minor versions will be used in CPEs for mainstream RHEL versions
11+
* The `cpe:/o` prefix will be used instead of mixed usage of `cpe:/o` and `cpe:/a` for all RHEL variants
12+
* The channel specifiers are being dropped
13+
14+
15+
### Minor Version CPEs
16+
Previously, for RHEL 9 and earlier we assigned generic CPEs like `cpe:/o:redhat:enterprise_linux:9` for the entire
17+
lifetime of a major release. Minor versions were only reflected in xUS CPEs (e.g., `cpe:/a:redhat:rhel_eus:9.2::appstream`).
18+
19+
Starting with RHEL 10 and all following versions of RHEL, we will use minor versions in mainstream CPEs,
20+
e.g., `cpe:/o:redhat:enterprise_linux:10.0`, incrementing with each subsequent minor release. This will apply to the
21+
MAIN, GA, and MAIN.EUS variants. This makes it easier to determine which version of RHEL an advisory was released for
22+
without consulting ET product configuration. This also improves our way of tracking releases and which sets of
23+
advisories they shipped. More granular minor versions also allow for the use of version ranges later on, which can be
24+
used to sets of versions (without having to enumerate them all) where the security status such as "fixed" is applicable.
25+
26+
### CPE Type Standardization
27+
Previously, we used a mix of `cpe:/o` (operating system) and `cpe:/a` (application) for different variants of RHEL
28+
(for example, base OS used o and Appstream used a). It is unclear why we decided on this different usage and we've
29+
encountered various issues in our security data files where consumers have to account for both prefixes even though
30+
they identify the same products.
31+
32+
Starting with RHEL 10 and all following versions of RHEL, we will standardize on `cpe:/o` for all RHEL-related components
33+
(those shipped under the RHEL product in Errata Tool). EUS CPEs will also transition from `cpe:/a` to `cpe:/o`, for example:
34+
Base OS: `cpe:/o:redhat:enterprise_linux_eus:10.2`
35+
AppStream: `cpe:/o:redhat:enterprise_linux_eus:10.2`
36+
37+
### Removal of channel specifiers and consistent naming of EUS CPEs
38+
CPEs for RHEL 9 and earlier used channel specifiers such as `::appstream` and `::baseos` to differentiate between different
39+
Errata Tool Variants and pin a specific CPE to a set of RPM repositories. These specifiers were never used externally
40+
by any vendor or any of our external documents for any reason other than arbitrary differentiation between groups of
41+
content. Starting with RHEL 10, we will drop the use of channel specifiers for RHEL. We will continue using them for
42+
layered products to distinguish their base RHEL version if known.
43+
44+
Extended streams such as EUS, AUS or TUS always used the name rhel instead of enterprise_linux in the CPE name.
45+
Starting with RHEL 10, we will use enterprise_linux only for increased consistency.
46+
47+
48+
49+

mkdocs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ theme:
3636

3737
nav:
3838
- Home: "index.md"
39-
- SBOM: "sbom.md"
40-
- purl: "purl.md"
39+
- CPE: "cpe.md"
4140
- CSAF/VEX: "csaf-vex.md"
42-
41+
- purl: "purl.md"
42+
- SBOM: "sbom.md"
43+
4344
plugins:
4445
- social
4546
- search

sbom/examples/product/rhel-9.2-eus.cdx.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"serialNumber": "urn:uuid:337d9115-4e7c-4e76-b389-51f7aed6eba8",
66
"metadata": {
77
"component": {
8-
"bom-ref": "cpe:/a:redhat:rhel_eus:9.2::baseos",
98
"type": "operating-system",
109
"name": "Red Hat Enterprise Linux",
1110
"version": "9.2 EUS",

sbom/examples/product/rhel-9.2-main+eus.cdx.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"serialNumber": "urn:uuid:337d9115-4e7c-4e76-b389-51f7aed6eba8",
66
"metadata": {
77
"component": {
8-
"bom-ref": "cpe:/a:redhat:rhel_eus:9.2::baseos",
98
"type": "operating-system",
109
"name": "Red Hat Enterprise Linux",
1110
"version": "9.2 MAIN+EUS",

sbom/examples/product/rhel-9.4-main+eus.cdx.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"serialNumber": "urn:uuid:337d9115-4e7c-4e76-b389-51f7aed6eba8",
66
"metadata": {
77
"component": {
8-
"bom-ref": "cpe:/o:redhat:enterprise_linux:9::baseos",
98
"type": "operating-system",
109
"name": "Red Hat Enterprise Linux",
1110
"version": "9.4 MAIN+EUS",

sbom/examples/rpm/build/delve-1.7.2-1.module+el8.6.0+12972+ebab5911.cdx.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"serialNumber": "urn:uuid:223234df-bb5b-49af-a896-143736f7d806",
66
"metadata": {
77
"component": {
8-
"bom-ref": "pkg:rpm/redhat/delve@1.7.2-1.module+el8.6.0+12972+ebab5911?arch=src&rpmmod=go-toolset:rhel8:8060020250609110611:97d7f71f",
98
"type": "library",
109
"name": "delve",
1110
"version": "1.7.2-1.module+el8.6.0+12972+ebab5911",

sbom/examples/rpm/build/from-koji.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,13 @@ def process_build(self, build_id, rpmmod):
423423
cdx_root_component = None
424424
cdx_pedigrees = []
425425
for rpm in rpms:
426-
(name, version, release, nvr, arch) = (
426+
(name, version, release, nvr, arch, epoch) = (
427427
rpm["name"],
428428
rpm["version"],
429429
rpm["release"],
430430
rpm["nvr"],
431431
rpm["arch"],
432+
rpm["epoch"],
432433
)
433434
filename = f"{downloaddir}/{name}-{version}-{release}.{arch}.rpm"
434435
if arch == "src":
@@ -441,6 +442,8 @@ def process_build(self, build_id, rpmmod):
441442
sha256header = self.get_rpm_sha256header(filename)
442443
sigmd5 = self.get_rpm_sigmd5(filename)
443444
purl = f"pkg:rpm/redhat/{name}@{version}-{release}?arch={arch}"
445+
if epoch:
446+
purl = f"{purl}&epoch={epoch}"
444447
if rpmmod:
445448
purl = f"{purl}&rpmmod={rpmmod}"
446449
package = {
@@ -526,6 +529,8 @@ def process_build(self, build_id, rpmmod):
526529
"relationships": self.spdx_relationships,
527530
}
528531

532+
copy_of_cdx_root = deepcopy(cdx_root_component)
533+
cdx_root_component.pop("bom-ref")
529534
cdx = {
530535
"bomFormat": "CycloneDX",
531536
"specVersion": "1.6",
@@ -546,19 +551,18 @@ def process_build(self, build_id, rpmmod):
546551
},
547552
}
548553

549-
copy_of_cdx_root = deepcopy(cdx_root_component)
550554
copy_of_cdx_root["pedigree"] = {"ancestors": cdx_pedigrees}
551555
self.cdx_components.append(copy_of_cdx_root)
552556
cdx["components"] = sorted(self.cdx_components, key=lambda c: c["purl"])
553557

554558
binary_rpm_purls = set()
555559
for cdx_component in self.cdx_components:
556-
if cdx_component["bom-ref"] == cdx_root_component["bom-ref"]:
560+
if cdx_component["bom-ref"] == copy_of_cdx_root["bom-ref"]:
557561
continue
558562
binary_rpm_purls.add(cdx_component["purl"])
559563

560564
cdx["dependencies"] = [
561-
{"ref": cdx_root_component["bom-ref"], "provides": sorted(list(binary_rpm_purls))}
565+
{"ref": copy_of_cdx_root["bom-ref"], "provides": sorted(list(binary_rpm_purls))}
562566
]
563567

564568
with open(f"{build_id}.spdx.json", "w") as fp:
@@ -624,7 +628,7 @@ def create_cdx_from_spdx(spdx_data):
624628
build_ids = []
625629
rpmmod = ""
626630
if is_module:
627-
module_tag, module_nsvc= get_modulemd_data()
631+
module_tag, module_nsvc = get_modulemd_data()
628632
rpmmod = module_nsvc
629633
module_builds = SESSION.listTagged(module_tag)
630634
for module_build in module_builds:

sbom/examples/rpm/build/go-toolset-1.17.13-2.module+el8.6.0+22782+bd95fb4c.cdx.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"serialNumber": "urn:uuid:223234df-bb5b-49af-a896-143736f7d806",
66
"metadata": {
77
"component": {
8-
"bom-ref": "pkg:rpm/redhat/go-toolset@1.17.13-2.module+el8.6.0+22782+bd95fb4c?arch=src&rpmmod=go-toolset:rhel8:8060020250609110611:97d7f71f",
98
"type": "library",
109
"name": "go-toolset",
1110
"version": "1.17.13-2.module+el8.6.0+22782+bd95fb4c",

sbom/examples/rpm/build/golang-1.17.13-9.module+el8.6.0+23245+b36ba85c.cdx.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"serialNumber": "urn:uuid:223234df-bb5b-49af-a896-143736f7d806",
66
"metadata": {
77
"component": {
8-
"bom-ref": "pkg:rpm/redhat/golang@1.17.13-9.module+el8.6.0+23245+b36ba85c?arch=src&rpmmod=go-toolset:rhel8:8060020250609110611:97d7f71f",
98
"type": "library",
109
"name": "golang",
1110
"version": "1.17.13-9.module+el8.6.0+23245+b36ba85c",

sbom/examples/rpm/build/openshift-pipelines-client-1.14.3-11352.el8.cdx.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"serialNumber": "urn:uuid:223234df-bb5b-49af-a896-143736f7d806",
66
"metadata": {
77
"component": {
8-
"bom-ref": "pkg:rpm/redhat/openshift-pipelines-client@1.14.3-11352.el8?arch=src",
98
"type": "library",
109
"name": "openshift-pipelines-client",
1110
"version": "1.14.3-11352.el8",
@@ -61527,7 +61526,7 @@
6152761526
]
6152861527
},
6152961528
{
61530-
"bom-ref": "pkg:golang/go.opentelemetry.io/contrib/instrumentation@v0.46.1?package-id=5bd72523ff97f024#googlegolangorg/grpc/otelgrpc",
61529+
"bom-ref": "pkg:golang/go.opentelemetry.io/contrib/instrumentation@v0.46.1?package-id=5bd72523ff97f024#google.golang.org/grpc/otelgrpc",
6153161530
"type": "library",
6153261531
"name": "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc",
6153361532
"version": "v0.46.1",
@@ -61561,7 +61560,7 @@
6156161560
]
6156261561
},
6156361562
{
61564-
"bom-ref": "pkg:golang/go.opentelemetry.io/contrib/instrumentation@v0.46.1?package-id=32dc6765d524c372#googlegolangorg/grpc/otelgrpc",
61563+
"bom-ref": "pkg:golang/go.opentelemetry.io/contrib/instrumentation@v0.46.1?package-id=32dc6765d524c372#google.golang.org/grpc/otelgrpc",
6156561564
"type": "library",
6156661565
"name": "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc",
6156761566
"version": "v0.46.1",
@@ -61595,7 +61594,7 @@
6159561594
]
6159661595
},
6159761596
{
61598-
"bom-ref": "pkg:golang/go.opentelemetry.io/contrib/instrumentation@v0.46.1?package-id=5d57e43f394fdd30#googlegolangorg/grpc/otelgrpc",
61597+
"bom-ref": "pkg:golang/go.opentelemetry.io/contrib/instrumentation@v0.46.1?package-id=5d57e43f394fdd30#google.golang.org/grpc/otelgrpc",
6159961598
"type": "library",
6160061599
"name": "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc",
6160161600
"version": "v0.46.1",
@@ -61629,7 +61628,7 @@
6162961628
]
6163061629
},
6163161630
{
61632-
"bom-ref": "pkg:golang/go.opentelemetry.io/contrib/instrumentation@v0.46.1?package-id=ffc736852a1ceb9e#googlegolangorg/grpc/otelgrpc",
61631+
"bom-ref": "pkg:golang/go.opentelemetry.io/contrib/instrumentation@v0.46.1?package-id=ffc736852a1ceb9e#google.golang.org/grpc/otelgrpc",
6163361632
"type": "library",
6163461633
"name": "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc",
6163561634
"version": "v0.46.1",

0 commit comments

Comments
 (0)