summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/common-tasks.rst
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2022-10-28 11:17:55 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-07 21:31:32 +0000
commita4dee23387839ec5c995f1508851f964a622cf69 (patch)
treeca5a24163fce79807e9ccdd6179e3a4b208ca6bd /documentation/dev-manual/common-tasks.rst
parenta6f7c43e9229031483af906d5c119f3a9346b9b2 (diff)
downloadpoky-a4dee23387839ec5c995f1508851f964a622cf69.tar.gz
dev-manual: common-tasks.rst: add section about SPDX / SBOM generation
Also stop refering to the meta-spdxscanner class, no longer relevant. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual/common-tasks.rst')
-rw-r--r--documentation/dev-manual/common-tasks.rst101
1 files changed, 66 insertions, 35 deletions
diff --git a/documentation/dev-manual/common-tasks.rst b/documentation/dev-manual/common-tasks.rst
index d99d327937..21215d1203 100644
--- a/documentation/dev-manual/common-tasks.rst
+++ b/documentation/dev-manual/common-tasks.rst
@@ -11200,8 +11200,6 @@ to be covered by assuming that there are three main areas of concern:
11200- Compilation scripts and modifications to the source code must be 11200- Compilation scripts and modifications to the source code must be
11201 provided. 11201 provided.
11202 11202
11203- spdx files can be provided.
11204
11205There are other requirements beyond the scope of these three and the 11203There are other requirements beyond the scope of these three and the
11206methods described in this section (e.g. the mechanism through which 11204methods described in this section (e.g. the mechanism through which
11207source code is distributed). 11205source code is distributed).
@@ -11392,39 +11390,6 @@ layers (recipes, configuration files, and so forth) enables you to meet
11392your requirements to include the scripts to control compilation as well 11390your requirements to include the scripts to control compilation as well
11393as any modifications to the original source. 11391as any modifications to the original source.
11394 11392
11395Providing spdx files
11396~~~~~~~~~~~~~~~~~~~~~~~~~
11397
11398The spdx module has been integrated to a layer named meta-spdxscanner.
11399meta-spdxscanner provides several kinds of scanner. If you want to enable
11400this function, you have to follow the following steps:
11401
114021. Add meta-spdxscanner layer into ``bblayers.conf``.
11403
114042. Refer to the README in meta-spdxscanner to setup the environment (e.g,
11405 setup a fossology server) needed for the scanner.
11406
114073. Meta-spdxscanner provides several methods within the bbclass to create spdx files.
11408 Please choose one that you want to use and enable the spdx task. You have to
11409 add some config options in ``local.conf`` file in your :term:`Build Directory`.
11410 Here is an example showing how to generate spdx files during BitBake using the
11411 fossology-python.bbclass::
11412
11413 # Select fossology-python.bbclass.
11414 INHERIT += "fossology-python"
11415 # For fossology-python.bbclass, TOKEN is necessary, so, after setup a
11416 # Fossology server, you have to create a token.
11417 TOKEN = "eyJ0eXAiO..."
11418 # The fossology server is necessary for fossology-python.bbclass.
11419 FOSSOLOGY_SERVER = "http://xx.xx.xx.xx:8081/repo"
11420 # If you want to upload the source code to a special folder:
11421 FOLDER_NAME = "xxxx" //Optional
11422 # If you don't want to put spdx files in tmp/deploy/spdx, you can enable:
11423 SPDX_DEPLOY_DIR = "${DEPLOY_DIR}" //Optional
11424
11425For more usage information refer to :yocto_git:`the meta-spdxscanner repository
11426</meta-spdxscanner/>`.
11427
11428Compliance Limitations with Executables Built from Static Libraries 11393Compliance Limitations with Executables Built from Static Libraries
11429~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 11394~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11430 11395
@@ -11674,6 +11639,72 @@ When analyzing CVEs, it is recommended to:
11674- follow public `open source security mailing lists <https://oss-security.openwall.org/wiki/mailing-lists>`__ for 11639- follow public `open source security mailing lists <https://oss-security.openwall.org/wiki/mailing-lists>`__ for
11675 discussions and advance notifications of CVE bugs and software releases with fixes. 11640 discussions and advance notifications of CVE bugs and software releases with fixes.
11676 11641
11642Creating a Software Bill of Materials
11643=====================================
11644
11645Once you are able to build an image for your project, once the licenses for
11646each software component are all identified (see
11647":ref:`dev-manual/common-tasks:working with licenses`") and once vulnerability
11648fixes are applied (see ":ref:`dev-manual/common-tasks:checking
11649for vulnerabilities`"), the OpenEmbedded build system can generate
11650a description of all the components you used, their licenses, their dependencies,
11651the changes that were applied and the known vulnerabilities that were fixed.
11652
11653This description is generated in the form of a *Software Bill of Materials*
11654(:term:`SBOM`), using the :term:`SPDX` standard.
11655
11656When you release software, this is the most standard way to provide information
11657about the Software Supply Chain of your software image and SDK. The
11658:term:`SBOM` tooling is often used to ensure open source license compliance by
11659providing the license texts used in the product which legal departments and end
11660users can read in standardized format.
11661
11662:term:`SBOM` information is also critical to performing vulnerability exposure
11663assessments, as all the components used in the Software Supply Chain are listed.
11664
11665The OpenEmbedded build system doesn't generate such information by default.
11666To make this happen, you must inherit the
11667:ref:`create-spdx <ref-classes-create-spdx>` class from a configuration file::
11668
11669 INHERIT += "create-spdx"
11670
11671You then get :term:`SPDX` output in JSON format as an
11672``IMAGE-MACHINE.spdx.json`` file in ``tmp/deploy/images/MACHINE/`` inside the
11673:term:`Build Directory`.
11674
11675This is a toplevel file accompanied by an ``IMAGE-MACHINE.spdx.index.json``
11676containing an index of JSON :term:`SPDX` files for individual recipes, together
11677with an ``IMAGE-MACHINE.spdx.tar.zst`` compressed archive containing all such
11678files.
11679
11680The :ref:`create-spdx <ref-classes-create-spdx>` class offers options to include
11681more information in the output :term:`SPDX` data, such as making the generated
11682files more human readable (:term:`SPDX_PRETTY`), adding compressed archives of
11683the files in the generated target packages (:term:`SPDX_ARCHIVE_PACKAGED`),
11684adding a description of the source files handled by the target recipes
11685(:term:`SPDX_INCLUDE_SOURCES`) and adding archives of these source files
11686themselves (:term:`SPDX_ARCHIVE_SOURCES`).
11687
11688Though the toplevel :term:`SPDX` output is available in
11689``tmp/deploy/images/MACHINE/`` inside the :term:`Build Directory`, ancillary
11690generated files are available in ``tmp/deploy/spdx/MACHINE`` too, such as:
11691
11692- The individual :term:`SPDX` JSON files in the ``IMAGE-MACHINE.spdx.tar.zst``
11693 archive.
11694
11695- Compressed archives of the files in the generated target packages,
11696 in ``packages/packagename.tar.zst`` (when :term:`SPDX_ARCHIVE_PACKAGED`
11697 is set).
11698
11699- Compressed archives of the source files used to build the host tools
11700 and the target packages in ``recipes/recipe-packagename.tar.zst``
11701 (when :term:`SPDX_ARCHIVE_SOURCES` is set). Those are needed to fulfill
11702 "source code access" license requirements.
11703
11704See the `tools page <https://spdx.dev/resources/tools/>`__ on the :term:`SPDX`
11705project website for a list of tools to consume and transform the :term:`SPDX`
11706data generated by the OpenEmbedded build system.
11707
11677Using the Error Reporting Tool 11708Using the Error Reporting Tool
11678============================== 11709==============================
11679 11710