sbom.rst 3.2 KB

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