15.6. Generating SBOMs from scanned images
You can use RHACS to generate a Software Bill of Materials (SBOM) from scanned container images.
Generation of SBOMs from the scanned container images is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Scanner V4 must be enabled to generate SBOMs. For information about enabling Scanner V4, see the following resources:
For OpenShift Container Platform:
- Installing Central using the Operator method
- Scanner V4 (Helm installation)
For Kubernetes:
- Scanner V4 (Helm installation)
SBOMs give you a detailed overview of software components, dependencies, and libraries within your application. RHACS uses the results of scans performed by Scanner V4 to generate an SBOM. You can generate an SBOM by using the RHACS portal, the roxctl CLI, or the RHACS API.
Scanner V4 cannot generate SBOMs from results of delegated scans. In delegated scanning, you are using your secured cluster to index images and sending data to Central for vulnerability matching. SBOM generation is only available when using Scanner V4 configured in Central.
15.6.1. About SBOMs 复制链接链接已复制到粘贴板!
A Software Bill of Materials (SBOM) is a digital record that lists the components of a piece of software and their origins. Organizations can use SBOMs to locate the presence of vulnerable software packages and components and respond more quickly to mitigate the risk. Additionally, being able to generate SBOMs assists organizations in complying with Executive Order 14028: Improving the Nations Cybersecurity.
SBOMs can contain different types of information, depending on the methods of data collection and how they are generated. The Cybersecurity & Infrastructure Security Agency (CISA) provides a document, Types of Software Bill of Materials (SBOM), that summarizes the types of SBOMs.
The type of SBOM that RHACS generates is "Analyzed." CISA notes that these types of SBOMs are created through an analysis of artifacts such as executables, packages, containers, and virtual machine images. Analyzed SBOMs provide the following benefits, as summarized by CISA:
- They can provide information about software without an active development environment.
- They can be generated without access to the build process.
- You can use them to discover hidden dependencies that might be missed by other tools.
The SBOM generated by RHACS is in System Package Data Exchange (SPDX) 2.3 format.
15.6.2. Generating SBOMs 复制链接链接已复制到粘贴板!
You can generate SBOMs by using the following methods:
- Using the RHACS portal
Go to Vulnerability Management
Results and locate the image that you want to use. Do one of the following actions: -
In the image row, click the overflow menu
, and then select Generate SBOM.
- Select the image to view the image details, and then click Generate SBOM.
A window opens that provides information about the image and the SBOM format that is generated. After you click Generate SBOM, RHACS creates the file in JSON format. Depending on your browser configuration, your browser can automatically download the file to your computer.
-
In the image row, click the overflow menu
- Using the
roxctlCLI In the
roxctlCLI, run the following command:$ roxctl image sbom --image=image-name1 - 1
- Type the name and reference of the image that you want to generate an SBOM for, in string format. For example,
nginx:latestornginx@sha256:….
This command has the following options:
| Option | Description |
|---|---|
|
|
Bypass Central’s cache for the image and force a new pull from the scanner. The default is |
|
| Sets the time to wait between retries in seconds. The default is 3. |
|
|
Image name and reference, for example, |
|
| Sets the number of times that Scanner V4 should retry before exiting with an error. The default is 3. |
- Using the API
-
You can use the RHACS API to create an SBOM. You must use the
ROX_API_TOKENfor authorization to connect to the endpoint and generate the SBOM. The request payload is generated in JSON format.
See "GenerateSBOM" in the API reference for more information.