Skip to content

Commit b756179

Browse files
authored
[cravex2-reachability] Add documentation for triage rules (#565)
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 326f7ff commit b756179

18 files changed

Lines changed: 724 additions & 44 deletions

docs/howto-4-product-vulnerability-analysis.rst

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ Overview
1111

1212
Product Vulnerability Analysis in DejaCode helps teams assess, review, and manage
1313
vulnerabilities specific to individual Products. The platform supports detailed
14-
analysis workflows, data propagation across related products, and integration with
15-
external tools via the **REST API**.
14+
analysis workflows and data propagation across related products.
1615

1716
1. Accessing Product Vulnerability Analysis
1817
-------------------------------------------
@@ -39,36 +38,12 @@ vulnerability, enabling in-depth review and understanding of its potential impac
3938

4039
.. image:: images/howto-4-product-vulnerability-analysis/vulnerabilities-tab.jpg
4140

42-
Each entry includes the following information:
43-
44-
- **Vulnerability ID**:
45-
A unique identifier prefixed with "VCID-", such as **VCID-2024-0001**, ensuring
46-
traceability.
47-
- **Aliases**:
48-
Alternate identifiers for the vulnerability, including **CVE identifiers**
49-
(e.g., **CVE-2019-17571**).
50-
- **Severity Levels**:
51-
Categorized as **critical**, **high**, **medium**, or **low**, based on potential
52-
impact.
53-
- **Exploitability Score**:
54-
Indicates the likelihood of exploitation, with three levels:
55-
56-
- **0.5**: No known exploits.
57-
- **1.0**: Potential exploits exist.
58-
- **2.0**: Known exploits are available.
59-
60-
- **Risk Score**:
61-
A value between **0.0** and **10.0**, representing the overall risk posed by the
62-
vulnerability.
63-
This score is calculated by multiplying the highest severity with its weight and
64-
the exploitability score, capped at **10.0**.
65-
- **Affected Packages**:
66-
Links to the affected packages and their versions.
41+
Each entry includes the vulnerability ID, its aliases, severity, exploitability, and
42+
risk score, along with links to the affected packages.
6743

68-
.. note::
69-
All vulnerability details, including analysis results and propagation status, are
70-
accessible through the **REST API**, enabling automated workflows and seamless
71-
integration with external tools.
44+
.. seealso::
45+
Refer to :ref:`reference_vulnerability_management` for a complete description of
46+
these fields and how the risk score is calculated.
7247

7348
3. Conducting Analysis
7449
----------------------
@@ -158,10 +133,6 @@ To analyze a vulnerability effectively:
158133
6. **Save Changes**:
159134
Save your analysis to ensure it is available for reference and propagated as needed.
160135

161-
.. note::
162-
The analysis data is also accessible via the **REST API**, making it possible to
163-
integrate with automated tools and workflows.
164-
165136
4. Propagating Analysis Across Products
166137
---------------------------------------
167138

@@ -177,15 +148,16 @@ To streamline reviews, DejaCode supports analysis data propagation:
177148
5. Leveraging REST API for Automation
178149
-------------------------------------
179150

180-
The **REST API** provides full access to vulnerability analysis data, enabling
181-
programmatic workflows such as:
182-
183-
- Querying vulnerabilities linked to specific Products.
184-
- Automating analysis result updates.
151+
Vulnerability analyses are available at ``/api/v2/vulnerability_analyses/``, supporting
152+
create, retrieve, update, and list operations. Use it to query analyses for specific
153+
products or packages, and to automate analysis updates as part of your own workflows.
185154

186-
Refer to the **API documentation** from the **"Tools" menu** for detailed guidance on
187-
using these endpoints.
155+
.. seealso::
156+
Refer to the **API documentation** from the **"Tools" menu** for the full list of
157+
fields and filters.
188158

189159
.. seealso::
190160
Explore the :ref:`reference_vulnerability_management` chapter for an overview of
191-
related features.
161+
related features. If you are looking for automated, rule-based recommendations
162+
instead of manual review, refer to :ref:`reference_vulnerability_triage` and
163+
:ref:`how_to_7`.
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
.. _how_to_7:
2+
3+
How To 7 - Configure Vulnerability Triage
4+
=========================================
5+
6+
This chapter explains how to create and configure **Triage Rulesets** for your
7+
Dataspace and how to assign them to products. Triage rulesets automatically detect
8+
vulnerabilities that match configured conditions and recommend a remediation action to
9+
your product teams.
10+
11+
All rulesets are disabled by default. You must create and configure the rulesets that
12+
are relevant to your security program, then assign them to the products you want to
13+
monitor.
14+
15+
.. seealso::
16+
Refer to :ref:`reference_vulnerability_triage` for a complete description of all
17+
available rules, actions, triage record lifecycle, and configuration options.
18+
19+
.. tip::
20+
To get started quickly, a set of reference rulesets and presets covering common
21+
scenarios can be seeded automatically with ``./manage.py create_triage_rulesets
22+
<dataspace_name>``. This section covers creating a ruleset manually for full
23+
control over its rules and thresholds.
24+
25+
1. Create a Triage Ruleset
26+
--------------------------
27+
28+
1. From the DejaCode **Administration dashboard**, navigate to
29+
:guilabel:`Vulnerabilities > Triage Rulesets`.
30+
2. Click :guilabel:`Add Triage Ruleset`.
31+
3. Fill in the **Name** field with a descriptive label (e.g., "Critical and Exploited").
32+
4. Select an **Action** from the dropdown. This is the remediation action that will be
33+
recommended when any rule in the ruleset fires.
34+
5. Set a **Precedence** value (integer). Higher values take priority when multiple
35+
rulesets match the same vulnerability on the same product.
36+
6. Leave **Enabled** checked to make the ruleset active immediately after saving.
37+
38+
.. image:: images/howto-7-vulnerability-triage-configuration/add-ruleset-form.jpg
39+
40+
2. Configure Rules
41+
------------------
42+
43+
Below the base fields, each built-in rule appears as a collapsible section.
44+
45+
1. Expand the rule sections you want to activate.
46+
2. Check the :guilabel:`Enable [Rule Name]` checkbox to include that rule in the
47+
ruleset evaluation.
48+
3. For rules that support parameters, adjust the threshold values:
49+
50+
- **Risk Score**: set :guilabel:`Min risk score` (default 8.0) to restrict
51+
detection to vulnerabilities at or above that score.
52+
- **Weighted Risk**: set :guilabel:`Min weighted risk score` (default 8.0) to
53+
restrict detection by weighted package exposure.
54+
- **Stale Vulnerability**: set :guilabel:`Max days` (default 30) and
55+
:guilabel:`Min risk score` (default 8.0).
56+
57+
A ruleset must have at least one rule enabled to produce any triage records.
58+
59+
Click :guilabel:`Save` to create the ruleset. Disabling a rule that was previously
60+
active removes the triage records it produced on the next evaluation.
61+
62+
.. image:: images/howto-7-vulnerability-triage-configuration/rule-sections.jpg
63+
:width: 500
64+
65+
3. Set Up an Analysis Preset
66+
----------------------------
67+
68+
An **Analysis Preset** instructs the engine to automatically apply default analysis
69+
values to each vulnerability matched by the ruleset. This is useful when you want to
70+
pre-fill new analyses with a known state, such as marking newly detected vulnerabilities
71+
as ``in_triage``.
72+
73+
To create an Analysis Preset:
74+
75+
1. Navigate to :guilabel:`Vulnerabilities > Analysis Presets`.
76+
2. Click :guilabel:`Add Analysis Preset`.
77+
3. Fill in the **Name** and optionally a **Description**.
78+
4. Under **Analysis defaults**, configure the fields you want the engine to apply:
79+
80+
- **State**: e.g., ``in_triage`` to mark all new analyses as being evaluated.
81+
- **Justification**, **Responses**, **Detail**, **Is Reachable**: leave blank to
82+
leave that field unchanged on any existing analysis.
83+
84+
5. Click :guilabel:`Save`.
85+
86+
To attach the preset to a ruleset, open the ruleset form and select the preset in the
87+
:guilabel:`Analysis Preset` field, then save.
88+
89+
.. image:: images/howto-7-vulnerability-triage-configuration/add-preset-form.jpg
90+
91+
.. note::
92+
Only analyses created by the preset are updated on subsequent evaluation runs.
93+
Any analysis modified by a user is never overwritten.
94+
95+
4. Link a Request Template
96+
--------------------------
97+
98+
When a **Request Template** is linked to a ruleset, the engine opens one DejaCode
99+
request per new triage record automatically. This routes newly detected vulnerabilities
100+
into a review workflow without manual intervention.
101+
102+
Prerequisites:
103+
104+
- A **Request Template** of content type **Product** must already exist under
105+
:guilabel:`Workflow > Request Templates`.
106+
- The template must have a creator (the user who created it): they are used as the
107+
automatic requester. A template with no creator is rejected when you try to select
108+
it on a ruleset.
109+
110+
To link a template to a ruleset:
111+
112+
1. Open the ruleset form in the Admin interface.
113+
2. Select the template in the :guilabel:`Request Template` field. Only product-type
114+
templates are listed.
115+
3. Click :guilabel:`Save`.
116+
117+
From the next evaluation, new triage records will have a DejaCode request opened
118+
automatically. Triage records that already have a linked request are not affected by
119+
subsequent evaluations.
120+
121+
.. _how_to_7_assign_rulesets:
122+
123+
5. Assign Rulesets to Products
124+
------------------------------
125+
126+
A ruleset has no effect until it is assigned to one or more products.
127+
128+
1. Open a product detail page.
129+
2. Navigate to the :guilabel:`Vulnerabilities` tab.
130+
3. Click :guilabel:`Manage Triage Rulesets` in the triage panel header.
131+
4. In the modal that opens, select the rulesets you want to assign to this product.
132+
5. Click :guilabel:`Save`.
133+
134+
.. image:: images/howto-7-vulnerability-triage-configuration/manage-rulesets-modal.jpg
135+
136+
The engine evaluates all assigned and enabled rulesets immediately. The
137+
**Recommendation** column appears in the Vulnerabilities tab as soon as at least one
138+
enabled ruleset is assigned.
139+
140+
To unassign a ruleset, open the same modal and deselect it. Existing triage records
141+
for that ruleset are deleted (a record with an open request is kept so reassigning the
142+
ruleset later reconnects to it instead of opening a duplicate). Preset-applied analyses
143+
are left in place: only the tracking record is removed, not the analysis itself.
144+
145+
6. Manage Precedence
146+
--------------------
147+
148+
When multiple rulesets are assigned to a product and their rules overlap on the same
149+
vulnerability, only the record from the highest-precedence ruleset is displayed in the
150+
Recommendation column. Lower-precedence records still exist and are maintained by the
151+
engine, but are hidden from the product view.
152+
153+
To adjust precedence:
154+
155+
1. Open the ruleset form in the Admin interface.
156+
2. Change the :guilabel:`Precedence` value. A higher number raises the ruleset's
157+
priority.
158+
3. Click :guilabel:`Save`.
159+
160+
Re-evaluation of all assigned products is triggered automatically after saving.
182 KB
Loading
178 KB
Loading
260 KB
Loading
174 KB
Loading
175 KB
Loading
213 KB
Loading
280 KB
Loading
36.3 KB
Loading

0 commit comments

Comments
 (0)