-
Notifications
You must be signed in to change notification settings - Fork 81
Add documentation for SBOM #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
007d0df
41da0b5
e7f9c4b
89572e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you use auto-numbered lists for this instead of manual numbering? |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,175 @@ | ||||||
| .. _how-to-work-with-sbom: | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This newly added section doesn't seem to follow the guidelines of section headers https://github.com/TexasInstruments/processor-sdk-doc?tab=contributing-ov-file#headings--sections
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. But few questions,
|
||||||
|
|
||||||
| ############################################################### | ||||||
| How to Guide for working with Software Bill of Materials (SBOM) | ||||||
|
Check warning on line 4 in source/linux/How_to_Guides/FAQ/How_to_work_with_SBOM.rst
|
||||||
| ############################################################### | ||||||
|
|
||||||
| ******** | ||||||
| Glossary | ||||||
| ******** | ||||||
|
|
||||||
| .. glossary:: | ||||||
|
|
||||||
| SBOM | ||||||
| Software Bill of Materials - is a comprehensive list of all the software components, dependencies, and metadata associated with an application. | ||||||
|
|
||||||
| SPDX | ||||||
| Software Package Data Exchange - is an open standard (or format) for communicating Software Bill of Materials (SBOM) information including components, licenses, copyrights, and security references. | ||||||
|
|
||||||
| CycloneDX | ||||||
| CycloneDX is a full-stack Bill of Materials (BOM) standard that provides advanced supply chain capabilities for cyber risk reduction. | ||||||
|
|
||||||
| VEX | ||||||
| Vulnerability Exploitability eXchange - is a standardized format for sharing information about vulnerabilities and their exploitability. | ||||||
|
|
||||||
| *************** | ||||||
| Generating SBOM | ||||||
| *************** | ||||||
|
|
||||||
| |__SDK_FULL_NAME__| Yocto build generates SBOMs in the following formats and versions: | ||||||
|
Check warning on line 29 in source/linux/How_to_Guides/FAQ/How_to_work_with_SBOM.rst
|
||||||
|
|
||||||
| .. list-table:: | ||||||
| :header-rows: 1 | ||||||
|
|
||||||
| * - Format | ||||||
| - Version | ||||||
| * - SPDX | ||||||
|
Check warning on line 36 in source/linux/How_to_Guides/FAQ/How_to_work_with_SBOM.rst
|
||||||
| - 3.0 | ||||||
| * - CycloneDX | ||||||
| - 1.6 | ||||||
|
|
||||||
| Follow the steps below based on your required format. | ||||||
|
Check warning on line 41 in source/linux/How_to_Guides/FAQ/How_to_work_with_SBOM.rst
|
||||||
|
|
||||||
| Generating SBOM in SPDX 3.0 Format | ||||||
|
Check warning on line 43 in source/linux/How_to_Guides/FAQ/How_to_work_with_SBOM.rst
|
||||||
| ================================== | ||||||
|
|
||||||
| SPDX 3.0 is generated by default when building |__SDK_FULL_NAME__| Yocto, no extra steps required. | ||||||
|
Check warning on line 46 in source/linux/How_to_Guides/FAQ/How_to_work_with_SBOM.rst
|
||||||
| If you require additional vulnerability information, follow these steps: | ||||||
|
|
||||||
| 1. Add the following line to your ``local.conf``: | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. role file can be used to highlight the same
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the difference between & How is it rendered different to the user? |
||||||
|
|
||||||
| .. code-block:: text | ||||||
|
|
||||||
| INHERIT += "vex" | ||||||
|
yogeshhegde marked this conversation as resolved.
|
||||||
|
|
||||||
| 2. Build Yocto according to the build instructions in :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>`. | ||||||
|
Check warning on line 55 in source/linux/How_to_Guides/FAQ/How_to_work_with_SBOM.rst
|
||||||
|
|
||||||
| The following artifacts will be generated in the Yocto deploy directory: | ||||||
|
Check warning on line 57 in source/linux/How_to_Guides/FAQ/How_to_work_with_SBOM.rst
|
||||||
|
|
||||||
| .. list-table:: | ||||||
| :header-rows: 1 | ||||||
| :widths: 50 50 | ||||||
|
|
||||||
| * - File | ||||||
| - Description | ||||||
| * - ``${IMAGE_NAME}.rootfs.spdx.json`` | ||||||
| - The SPDX v3.0 SBOM file | ||||||
| * - ``${IMAGE_NAME}.rootfs.json`` | ||||||
| - Vulnerability information file generated by ``vex.bbclass`` | ||||||
|
|
||||||
|
|
||||||
| Generating SBOM in CycloneDX Format | ||||||
| =================================== | ||||||
|
|
||||||
| To generate SBOM in CycloneDX format, follow these steps: | ||||||
|
|
||||||
| 1. Start with the build instructions in :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>` | ||||||
| 2. After cloning ``oe-layersetup``, uncomment the ``meta-cyclonedx`` line in | ||||||
| the layer configuration file, for example: | ||||||
|
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reasons we aren't pushing a new oe-config file to oe-layersetup dedicated for SBOMs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are few reasons,
With these constraints, I believe this is the best course, since it is just uncommenting a line for the user and they also see less oe-configs. |
||||||
| .. code-block:: text | ||||||
|
|
||||||
| meta-cyclonedx,https://github.com/iris-GmbH/meta-cyclonedx.git,main,0170751b487162f8e476fd32d441ddfcf24ca78a,layers= | ||||||
|
|
||||||
| 3. Add the following line to your :file:`local.conf`: | ||||||
|
|
||||||
| .. code-block:: text | ||||||
|
|
||||||
| INHERIT += "cyclonedx-export" | ||||||
|
|
||||||
| 4. Continue to build Yocto according to the build instructions in :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>`. | ||||||
|
|
||||||
| The following artifacts will be generated in the Yocto deploy directory: | ||||||
|
|
||||||
| .. list-table:: | ||||||
| :header-rows: 1 | ||||||
| :widths: 50 50 | ||||||
|
|
||||||
| * - File | ||||||
| - Description | ||||||
| * - :file:`${IMAGE_NAME}.rootfs.cyclonedx.bom.json` | ||||||
| - The CycloneDX SBOM file | ||||||
| * - :file:`${IMAGE_NAME}.rootfs.cyclonedx.vex.json` | ||||||
| - The CycloneDX VEX file | ||||||
|
|
||||||
| ***************** | ||||||
| Working with SBOM | ||||||
| ***************** | ||||||
|
|
||||||
| It is recommended to use open-source tools for working with SBOMs. | ||||||
| The following open-source tools are recommended for working with SBOMs: | ||||||
|
|
||||||
| .. list-table:: | ||||||
| :header-rows: 1 | ||||||
| :widths: 20 40 40 | ||||||
|
|
||||||
| * - Format | ||||||
| - Tool | ||||||
| - Description | ||||||
| * - CycloneDX | ||||||
| - `CycloneDX Sunshine <https://github.com/CycloneDX/Sunshine/>`_ | ||||||
| - Visualize CycloneDX SBOMs in a human-readable format | ||||||
| * - CycloneDX | ||||||
| - `CycloneDX CLI <https://github.com/CycloneDX/cyclonedx-cli>`_ | ||||||
| - BOM analysis, modification, diffing, merging, format conversion, signing and verification. | ||||||
| * - SPDX | ||||||
| - `SPDX Open Source Tools <https://spdx.dev/tools/open-source-tools/>`_ | ||||||
| - A collection of open-source tools for working with SPDX SBOMs | ||||||
|
|
||||||
| .. note:: | ||||||
|
|
||||||
| SPDX 3.0 is not yet widely supported by SPDX tools. Using such tools with | ||||||
| SPDX 3.0 files may give varied or unexpected results. | ||||||
|
|
||||||
| ************ | ||||||
| CVE Analysis | ||||||
| ************ | ||||||
|
|
||||||
| The `sbom-cve-check <https://pypi.org/project/sbom-cve-check/>`_ tool can be | ||||||
| used to perform CVE analysis on the generated SPDX SBOM. | ||||||
|
|
||||||
| 1. Install the tool: | ||||||
|
|
||||||
| .. code-block:: console | ||||||
|
|
||||||
| pip install sbom-cve-check | ||||||
|
|
||||||
| .. note:: | ||||||
|
|
||||||
| It is recommended to install this tool in a Python virtual environment. | ||||||
|
|
||||||
| 2. Retrieve the following artifacts from the Yocto deploy directory: | ||||||
|
|
||||||
| .. list-table:: | ||||||
| :header-rows: 1 | ||||||
| :widths: 50 50 | ||||||
|
|
||||||
| * - File | ||||||
| - Description | ||||||
| * - :file:`${IMAGE_NAME}.rootfs.spdx.json` | ||||||
| - The SPDX v3.0 SBOM file | ||||||
| * - :file:`${IMAGE_NAME}.rootfs.json` | ||||||
| - Vulnerability information file generated by ``vex.bbclass`` | ||||||
|
|
||||||
| 3. Run the CVE analysis: | ||||||
|
|
||||||
| .. code-block:: console | ||||||
|
|
||||||
| sbom-cve-check --sbom-path ${IMAGE_NAME}.rootfs.spdx.json \ | ||||||
| --yocto-vex-manifest ${IMAGE_NAME}.rootfs.json \ | ||||||
| --export-type yocto-cve-check-manifest \ | ||||||
| --export-path cve-check.json | ||||||
|
|
||||||
| .. note:: | ||||||
|
|
||||||
| ``sbom-cve-check`` only supports SPDX format and does not support CycloneDX. | ||||||
Uh oh!
There was an error while loading. Please reload this page.