sbom.rst 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Creating a Software Bill of Materials
  3. *************************************
  4. Once you are able to build an image for your project, once the licenses for
  5. each software component are all identified (see
  6. ":ref:`dev-manual/licenses:working with licenses`") and once vulnerability
  7. fixes are applied (see ":ref:`dev-manual/vulnerabilities:checking
  8. for vulnerabilities`"), the OpenEmbedded build system can generate
  9. a description of all the components you used, their licenses, their dependencies,
  10. the changes that were applied and the known vulnerabilities that were fixed.
  11. This description is generated in the form of a *Software Bill of Materials*
  12. (:term:`SBOM`), using the :term:`SPDX` standard.
  13. When you release software, this is the most standard way to provide information
  14. about the Software Supply Chain of your software image and SDK. The
  15. :term:`SBOM` tooling is often used to ensure open source license compliance by
  16. providing the license texts used in the product which legal departments and end
  17. users can read in standardized format.
  18. :term:`SBOM` information is also critical to performing vulnerability exposure
  19. assessments, as all the components used in the Software Supply Chain are listed.
  20. The OpenEmbedded build system doesn't generate such information by default.
  21. To make this happen, you must inherit the
  22. :ref:`create-spdx <ref-classes-create-spdx>` class from a configuration file::
  23. INHERIT += "create-spdx"
  24. You then get :term:`SPDX` output in JSON format as an
  25. ``IMAGE-MACHINE.spdx.json`` file in ``tmp/deploy/images/MACHINE/`` inside the
  26. :term:`Build Directory`.
  27. This is a toplevel file accompanied by an ``IMAGE-MACHINE.spdx.index.json``
  28. containing an index of JSON :term:`SPDX` files for individual recipes, together
  29. with an ``IMAGE-MACHINE.spdx.tar.zst`` compressed archive containing all such
  30. files.
  31. The :ref:`create-spdx <ref-classes-create-spdx>` class offers options to include
  32. more information in the output :term:`SPDX` data, such as making the generated
  33. files more human readable (:term:`SPDX_PRETTY`), adding compressed archives of
  34. the files in the generated target packages (:term:`SPDX_ARCHIVE_PACKAGED`),
  35. adding a description of the source files handled by the target recipes
  36. (:term:`SPDX_INCLUDE_SOURCES`) and adding archives of these source files
  37. themselves (:term:`SPDX_ARCHIVE_SOURCES`).
  38. Though the toplevel :term:`SPDX` output is available in
  39. ``tmp/deploy/images/MACHINE/`` inside the :term:`Build Directory`, ancillary
  40. generated files are available in ``tmp/deploy/spdx/MACHINE`` too, such as:
  41. - The individual :term:`SPDX` JSON files in the ``IMAGE-MACHINE.spdx.tar.zst``
  42. archive.
  43. - Compressed archives of the files in the generated target packages,
  44. in ``packages/packagename.tar.zst`` (when :term:`SPDX_ARCHIVE_PACKAGED`
  45. is set).
  46. - Compressed archives of the source files used to build the host tools
  47. and the target packages in ``recipes/recipe-packagename.tar.zst``
  48. (when :term:`SPDX_ARCHIVE_SOURCES` is set). Those are needed to fulfill
  49. "source code access" license requirements.
  50. See the `tools page <https://spdx.dev/resources/tools/>`__ on the :term:`SPDX`
  51. project website for a list of tools to consume and transform the :term:`SPDX`
  52. data generated by the OpenEmbedded build system.