@@ -149,7 +149,7 @@ composing multiple SBOMs into a larger set (to describe a product, for example).
149149
150150_ Complete_ SBOMs provide a full, in-depth representation of all levels of the build process in a single file. A
151151Complete 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.
153153
154154Red Hat aims to publish Complete SBOMs at
155155[ 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:
466466
467467#### RPM
468468
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:
470484
471485=== "SPDX 2.3"
472486
@@ -525,7 +539,7 @@ purl identifiers
525539
526540[ ` checksums ` ] ( https://spdx.github.io/spdx-spec/v2.3/package-information/#710-package-checksum-field )
527541: 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).
529543
530544[ ` annotations ` ] ( https://spdx.github.io/spdx-spec/v2.3/annotations/ )
531545: A list of annotations may provide additional information that is specific to the RPM format. In the example
@@ -534,7 +548,7 @@ purl identifiers
534548 - The SHA256 checksum of the RPM header (this value does not change when an RPM is signed; unlike the file SHA256 \
535549 checksum used in ` checksums ` ).
536550
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
538552that was used to build those RPMs. SRPMs should be represented as a separate package object in an SBOM, and their
539553relationship to architecture-specific RPMs can be represented with:
540554
@@ -595,6 +609,35 @@ To associate a set of source archives with the SRPM that includes them, use:
595609 }
596610 ```
597611
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+
598641#### Product
599642
600643Individual components such as packages and container images are almost always provided as part of a specific product.
0 commit comments