@@ -149,7 +149,7 @@ composing multiple SBOMs into a larger set (to describe a product, for example).
149
149
150
150
_ Complete_ SBOMs provide a full, in-depth representation of all levels of the build process in a single file. A
151
151
Complete SBOM includes all component layers and their dependencies, offering a complete view of a product's composition.
152
- These types of SBOMs are mostly used for procurement and audit purposes .
152
+ These types of SBOMs are mostly used for procurement and audit.
153
153
154
154
Red Hat aims to publish Complete SBOMs at
155
155
[ https://security.access.redhat.com/data/sbom/ ] ( https://security.access.redhat.com/data/sbom/ ) while Shallow SBOMs
@@ -466,7 +466,21 @@ To associate a set of remote sources with the repository referencing them, use:
466
466
467
467
#### RPM
468
468
469
- An architecture-specific RPM built by Red Hat can be represented by a package object using the following data:
469
+ Before defining what RPM package objects look like, let's also define the specific types of sources that can be involved
470
+ in the RPM build process:
471
+
472
+ - An _ upstream source_ is the original source code as released by the software's primary developers or maintainers.
473
+
474
+ - A _ midstream source_ is a copy of the upstream code, which may be modified or simply mirrored for distribution
475
+ purposes. Midstream sources are optional.
476
+
477
+ - A _ downstream source_ is a set of sources used to create a source RPM. These are the real build inputs that get
478
+ packaged into an SRPM, regardless of whether they originated directly from upstream or came through a midstream
479
+ archive. Downstream sources may include distribution-specific patches, build configuration changes, spec files,
480
+ and any other files needed to build the final RPM package.
481
+
482
+ An architecture-specific (downstream) RPM built by Red Hat can be represented by a package object using
483
+ the following data:
470
484
471
485
=== "SPDX 2.3"
472
486
@@ -525,7 +539,7 @@ purl identifiers
525
539
526
540
[ ` checksums ` ] ( https://spdx.github.io/spdx-spec/v2.3/package-information/#710-package-checksum-field )
527
541
: Minimally, the list of checksums must include the SHA256 checksum of the RPM file or source archive itself.
528
- All other checksums should be specified as annotations (see below).
542
+ All other checksums should be specified as annotations (see below).
529
543
530
544
[ ` annotations ` ] ( https://spdx.github.io/spdx-spec/v2.3/annotations/ )
531
545
: A list of annotations may provide additional information that is specific to the RPM format. In the example
@@ -534,7 +548,7 @@ purl identifiers
534
548
- The SHA256 checksum of the RPM header (this value does not change when an RPM is signed; unlike the file SHA256 \
535
549
checksum used in ` checksums ` ).
536
550
537
- Each set of architecture-specific RPMs also have an associated source RPM (SRPM) that bundles all the source code
551
+ Each set of architecture-specific RPMs also has an associated source RPM (SRPM) that bundles all the source code
538
552
that was used to build those RPMs. SRPMs should be represented as a separate package object in an SBOM, and their
539
553
relationship to architecture-specific RPMs can be represented with:
540
554
@@ -595,6 +609,35 @@ To associate a set of source archives with the SRPM that includes them, use:
595
609
}
596
610
```
597
611
612
+ Optionally, an upstream source may be mirrored in a different repository where the source is modified in a way that
613
+ makes it consumable by the downstream distributor. This is referred to as a midstream source. The package object for
614
+ the midstream source looks identical to an upstream package, but with different download location and purl identifier.
615
+
616
+ The relationship between an upstream source and a midstream source can be represented with:
617
+
618
+ === "SPDX 2.3"
619
+
620
+ ```json
621
+ {
622
+ "spdxElementId": "SPDXRef-Midstream0",
623
+ "relationshipType": "GENERATED_FROM",
624
+ "relatedSpdxElement": "SPDXRef-Source0"
625
+ }
626
+ ```
627
+
628
+ The complete diagram of the relationships between the various types of sources in an SBOM might look like this:
629
+
630
+ ``` mermaid
631
+ graph TD
632
+ A["https://openssl.org/source/openssl-3.0.7.tar.gz"]
633
+ B["https://github.com/(RH openssl midstream repo)/archive/refs/tags/3.0.7.tar.gz"]
634
+ C["SRPM: openssl 3.0.7-18.el9_2.src"]
635
+ D["RPM: openssl 3.0.7-18.el9_2.aarch64"]
636
+ C -->|CONTAINS| B
637
+ B -->|GENERATED_FROM| A
638
+ D -->|GENERATED_FROM| C
639
+ ```
640
+
598
641
#### Product
599
642
600
643
Individual components such as packages and container images are almost always provided as part of a specific product.
0 commit comments