Skip to content

Commit 2dbbde0

Browse files
authored
docs: add ScanCode.io and DejaCode compliance workflow reference (#607)
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent fec2bdd commit 2dbbde0

10 files changed

Lines changed: 228 additions & 8 deletions

‎docs/howto-1.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ Review Usage Policy Impact
142142

143143
Continue refining and reviewing your Usage Policies.
144144

145+
.. _how_to_1_export_license_policies:
146+
145147
Export License Policy Definitions
146148
---------------------------------
147149

@@ -155,3 +157,6 @@ ScanCode Toolkit (scancode-toolkit).
155157
section of the form.
156158
- View or edit the exported **license_policies.yml** file in your preferred text editor.
157159
- Use the file as an input option to ScanCode Toolkit to enhance the output results.
160+
- Provide the file to ScanCode.io, for the whole instance or per project, to flag each
161+
detected license with your compliance alerts. See
162+
`ScanCode.io License Policies <https://scancodeio.readthedocs.io/en/latest/policies.html>`_.
Lines changed: 84 additions & 0 deletions
Loading

‎docs/index.rst‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ DejaCode includes the following modules:
3131
* **API**: Use the DejaCode API to integrate with your other data sources and
3232
applications.
3333

34-
New to DejaCode? Start with the :ref:`quickstart`.
34+
New to DejaCode? Start with the :ref:`quickstart`. To see how DejaCode and ScanCode.io
35+
work together, read the :ref:`reference_scancodeio_workflow`.
3536

3637
.. toctree::
3738
:maxdepth: 2
@@ -72,13 +73,14 @@ New to DejaCode? Start with the :ref:`quickstart`.
7273
:maxdepth: 1
7374
:caption: Reference
7475

76+
reference-scancodeio-workflow
7577
reference-data-models
76-
reference-vulnerability-management
78+
reference-package-url
79+
reference-license-clarity
7780
reference-policy-rules
81+
reference-vulnerability-management
7882
reference-vulnerability-triage
79-
reference-1
80-
reference-2
81-
reference-3-cravex
83+
reference-cra-support
8284

8385
.. toctree::
8486
:maxdepth: 1

‎docs/integrations-aboutcode.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ With ScanCode.io, you can:
6363
Scans are listed from :guilabel:`Scans` in the :guilabel:`Integrations` section of the
6464
side menu.
6565

66+
.. seealso::
67+
:ref:`reference_scancodeio_workflow` for the complete workflow with ScanCode.io.
68+
6669
Install your own ScanCode.io server
6770
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6871

‎docs/quickstart.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ First steps
8484
Next steps
8585
----------
8686

87+
- :ref:`reference_scancodeio_workflow` describes how DejaCode and ScanCode.io work
88+
together.
8789
- :ref:`user_tutorial_1` and the following tutorials walk through each feature in
8890
detail.
8991
- :ref:`dataspace` explains how to set up your own Dataspace, users, and usage
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _reference_3_cravex:
1+
.. _reference_cra_support:
22

33
Cyber Resilience Act (CRA) Support
44
==================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _reference_1:
1+
.. _reference_license_clarity:
22

33
Declared License Expression and License Clarity Scoring
44
=======================================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _reference_2:
1+
.. _reference_package_url:
22

33
Package URL (purl)
44
==================
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
.. _reference_scancodeio_workflow:
2+
3+
ScanCode.io and DejaCode Compliance Workflow
4+
============================================
5+
6+
**ScanCode.io detects what is in your code. DejaCode records what you decide about it.**
7+
8+
ScanCode.io analyzes one codebase at a time. DejaCode manages the compliance of all your
9+
Products over time.
10+
11+
This page covers how the two work together. For everything else that DejaCode does, such
12+
as the License Library, Workflow Requests, and Reporting, see the
13+
:doc:`DejaCode documentation index <index>`.
14+
15+
.. image:: images/reference-scancodeio-workflow/workflow.svg
16+
:width: 100%
17+
:alt: DejaCode shares the license policies with ScanCode.io (1), imports the Product
18+
inventory detected by ScanCode.io (2), and requests Package scans (3). DejaCode
19+
then supports the review (4), delivery (5), and maintenance (6) of the Product.
20+
21+
Each number in the diagram is a step of the workflow, described below.
22+
23+
1. Set Up
24+
---------
25+
26+
- Enable the ScanCode.io, VulnerableCode, and PurlDB integrations, see
27+
:ref:`integrations_aboutcode`.
28+
- Define your usage policies, see :ref:`how_to_1`.
29+
- Share your license policies with ScanCode.io, which then flags each detected license
30+
with your compliance alerts, see :ref:`how_to_1_export_license_policies`.
31+
- Activate your policy rules, see :ref:`reference_policy_rules`.
32+
- Create a Product for each version of the software that you distribute, see
33+
:ref:`user_tutorial_1`.
34+
35+
2. Discover the Inventory
36+
-------------------------
37+
38+
Choose the import action from the :guilabel:`Actions` dropdown of the Product, according
39+
to what you have:
40+
41+
.. list-table::
42+
:header-rows: 1
43+
:widths: 30 35 35
44+
45+
* - You have
46+
- Action
47+
- ScanCode.io pipeline
48+
* - An SBOM (CycloneDX, SPDX)
49+
- :guilabel:`Import SBOM`
50+
- ``load_sbom``, run by DejaCode
51+
* - Package manifests or lockfiles
52+
- :guilabel:`Import Package manifests`
53+
- ``resolve_dependencies``, run by DejaCode
54+
* - A ScanCode.io project
55+
- :guilabel:`Import ScanCode.io project`
56+
- Any pipeline, already run
57+
* - A ScanCode scan results file
58+
- :guilabel:`Import ScanCode scan results`
59+
- None: the file is imported as is
60+
61+
For an in-depth analysis, run the pipelines in ScanCode.io, then import the project: it
62+
brings the Packages, their dependencies, and their vulnerabilities. With the
63+
``find_vulnerabilities`` and ``analyze_symbols_reachability`` pipelines, it also brings
64+
the reachability of each vulnerability.
65+
66+
Imports run in the background, follow them on the :guilabel:`Activity` tab of the
67+
Product. A Package that already exists in your Dataspace keeps its curated data.
68+
69+
3. Enrich the Packages
70+
----------------------
71+
72+
The discovery identifies the Packages and their declared licenses. A scan of each
73+
Package goes further: it detects the licenses and copyrights in its files.
74+
75+
- :guilabel:`Scan all Packages` sends each Package of the Product with a download URL to
76+
ScanCode.io.
77+
- On the :guilabel:`Scan` tab of a Package, apply the detected values to its definition,
78+
see :ref:`reference_license_clarity`.
79+
- :guilabel:`Improve Packages from PurlDB` completes the Package metadata.
80+
81+
A Package is scanned and reviewed once, and every Product that uses it benefits.
82+
83+
4. Review
84+
---------
85+
86+
- Set the review status and concluded license of each Package in the Product, see
87+
:ref:`user_tutorial_5_sboms`.
88+
- Resolve the policy violations, see :ref:`reference_policy_rules`.
89+
- Triage the vulnerabilities, see :ref:`how_to_4`. The reachability imported from
90+
ScanCode.io is a starting point.
91+
92+
5. Deliver
93+
----------
94+
95+
Export from the reviewed Product. Unlike the ScanCode.io outputs, built from the scan
96+
results, these documents reflect your review decisions.
97+
98+
- **SBOM** (CycloneDX, SPDX), see :ref:`user_tutorial_5_sboms`.
99+
- **VEX**, see :ref:`user_tutorial_6_vuln_report`.
100+
- **Attribution**, see :ref:`user_tutorial_1`.
101+
102+
6. Maintain
103+
-----------
104+
105+
- **New release**: clone the Product, then import the new release. The clone keeps the
106+
inventory and its review. Imports only add Packages: remove the ones that are no
107+
longer in the release.
108+
- **New vulnerabilities**: DejaCode refreshes them daily by default and can notify you,
109+
see :ref:`reference_vulnerability_management`.
110+
111+
Automate
112+
--------
113+
114+
Each import action is available on the Product endpoint of the REST API:
115+
``load_sboms``, ``import_manifests``, ``pull_scancodeio_project_data``, and
116+
``import_from_scan``. See :ref:`integrations_rest_api`.
117+
118+
The ScanCode.io tutorial `Analyze Codebase End to End with DepLock and DejaCode
119+
<https://scancodeio.readthedocs.io/en/latest/tutorial_cli_end_to_end_scanning_to_dejacode.html>`_
120+
shows a complete example.

‎docs/tutorial-4-vulnerabilities.rst‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ as for an imported SBOM, in :ref:`user_tutorial_5_sboms`:
6262
1. :ref:`user_tutorial_5_review_vulnerabilities`
6363
2. :ref:`user_tutorial_5_vulnerability_analysis`
6464
3. :ref:`user_tutorial_5_export_vex`
65+
66+
.. seealso::
67+
:ref:`reference_scancodeio_workflow` to use ScanCode.io and DejaCode together beyond
68+
a one-time import.

0 commit comments

Comments
 (0)