|
| 1 | +*************************************************************** |
| 2 | +How to Guide for working with Software Bill of Materials (SBOM) |
| 3 | +*************************************************************** |
| 4 | + |
| 5 | +Generating an Software Bill of Materials (SBOM) |
| 6 | +=============================================== |
| 7 | + |
| 8 | +|__SDK_FULL_NAME__| build generates SBOMs in the following formats and versions: |
| 9 | + |
| 10 | +.. list-table:: |
| 11 | + :header-rows: 1 |
| 12 | + :widths: 50 50 |
| 13 | + |
| 14 | + * - Format |
| 15 | + - Version |
| 16 | + - Yocto |
| 17 | + - Buildroot |
| 18 | + * - SPDX |
| 19 | + - 3.0 |
| 20 | + - Supported |
| 21 | + - Not-Supported |
| 22 | + * - CycloneDX |
| 23 | + - 1.6 |
| 24 | + - Supported |
| 25 | + - Supported |
| 26 | + |
| 27 | +Follow the steps below based on your required format. |
| 28 | + |
| 29 | +Generating an SBOM in SPDX 3.0 Format |
| 30 | +------------------------------------- |
| 31 | + |
| 32 | +SPDX 3.0 is generated by default when building |__SDK_FULL_NAME__| Yocto, no extra steps required. |
| 33 | +If you require additional vulnerability information, follow these steps: |
| 34 | + |
| 35 | +1. Add the following line to your ``local.conf``: |
| 36 | + |
| 37 | + .. code-block:: text |
| 38 | +
|
| 39 | + INHERIT += "vex" |
| 40 | +
|
| 41 | +2. Build Yocto according to the build instructions in :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>`. |
| 42 | + |
| 43 | +The following artifacts will be generated in the Yocto deploy directory: |
| 44 | + |
| 45 | +.. list-table:: |
| 46 | + :header-rows: 1 |
| 47 | + :widths: 50 50 |
| 48 | + |
| 49 | + * - File |
| 50 | + - Description |
| 51 | + * - ``${IMAGE_NAME}.rootfs.spdx.json`` |
| 52 | + - The SPDX v3.0 SBOM file |
| 53 | + * - ``${IMAGE_NAME}.rootfs.json`` |
| 54 | + - Vulnerability information file generated by ``vex.bbclass`` |
| 55 | + |
| 56 | + |
| 57 | +Generating an SBOM in CycloneDX Format |
| 58 | +-------------------------------------- |
| 59 | + |
| 60 | +To generate an SBOM in CycloneDX format, follow these steps: |
| 61 | + |
| 62 | +1. Start with the build instructions in :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>` |
| 63 | +2. After cloning ``oe-layersetup``, uncomment the ``meta-cyclonedx`` line in |
| 64 | + the layer configuration file, for example: |
| 65 | + |
| 66 | + .. code-block:: text |
| 67 | +
|
| 68 | + meta-cyclonedx,https://github.com/iris-GmbH/meta-cyclonedx.git,main,0170751b487162f8e476fd32d441ddfcf24ca78a,layers= |
| 69 | +
|
| 70 | +3. Add the following line to your ``local.conf``: |
| 71 | + |
| 72 | + .. code-block:: text |
| 73 | +
|
| 74 | + INHERIT += "cyclonedx-export" |
| 75 | +
|
| 76 | +4. Continue to build Yocto according to the build instructions in :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>`. |
| 77 | + |
| 78 | +The following artifacts will be generated in the Yocto deploy directory: |
| 79 | + |
| 80 | +.. list-table:: |
| 81 | + :header-rows: 1 |
| 82 | + :widths: 50 50 |
| 83 | + |
| 84 | + * - File |
| 85 | + - Description |
| 86 | + * - ``${IMAGE_NAME}.rootfs.cyclonedx.bom.json`` |
| 87 | + - The CycloneDX SBOM file |
| 88 | + * - ``${IMAGE_NAME}.rootfs.cyclonedx.vex.json`` |
| 89 | + - The CycloneDX VEX file |
| 90 | + |
| 91 | +Working with Software Bill of Materials (SBOM) |
| 92 | +============================================== |
| 93 | + |
| 94 | +It is recommended to use open-source tools for working with SBOMs. |
| 95 | +The following open-source tools are recommended for working with SBOMs: |
| 96 | + |
| 97 | +.. list-table:: |
| 98 | + :header-rows: 1 |
| 99 | + :widths: 20 40 40 |
| 100 | + |
| 101 | + * - Format |
| 102 | + - Tool |
| 103 | + - Description |
| 104 | + * - CycloneDX |
| 105 | + - `CycloneDX Sunshine <https://github.com/CycloneDX/Sunshine/>`_ |
| 106 | + - Visualize CycloneDX SBOMs in a human-readable format |
| 107 | + * - CycloneDX |
| 108 | + - `CycloneDX CLI <https://github.com/CycloneDX/cyclonedx-cli>`_ |
| 109 | + - BOM analysis, modification, diffing, merging, format conversion, signing and verification. |
| 110 | + * - SPDX |
| 111 | + - `SPDX Open Source Tools <https://spdx.dev/tools/open-source-tools/>`_ |
| 112 | + - A collection of open-source tools for working with SPDX SBOMs |
| 113 | + |
| 114 | +.. note:: |
| 115 | + |
| 116 | + SPDX 3.0 is not yet widely supported by SPDX tools. Using such tools with |
| 117 | + SPDX 3.0 files may give varied or unexpected results. |
0 commit comments