Skip to content

Commit 2e8efae

Browse files
Merge branch 'bugfix' into issue_13593
2 parents c46e2a0 + 9fb0dae commit 2e8efae

15 files changed

Lines changed: 140 additions & 9 deletions
103 KB
Loading
106 KB
Loading
30.9 KB
Loading
59.1 KB
Loading
68.5 KB
Loading

docs/content/en/working_with_findings/finding_priority.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ High. Criticality is a subjective field, so when assigning this field, consider
5858
Product compares to other Products in your organization.
5959
* **User Records** is a numerical estimation of user records in a database (or a system
6060
that can access that database).
61-
* **Revenue** is a numerical estimation of annual revenue for the Product. It is not
62-
possible to set a currency type in DefectDojo, so make sure that all of your Revenue
61+
* **Revenue** is a numerical estimation of annual revenue for the Product. To calculate Priority, DefectDojo will calculate a percentage by comparing this Product's revenue to the sum of all Products within the Product Type.
62+
63+
It is not possible to set a currency type in DefectDojo, so make sure that all of your Revenue
6364
estimations have the same currency denomination. (“50000” could mean $50,000
6465
US Dollars or ¥50,000 Japanese Yen - the denomination does not matter as long as
6566
all of your Products have revenue calculated in the same currency).
@@ -85,9 +86,6 @@ Findings within a Product can have additional metadata which can further adjust
8586
* Whether the Finding is in the KEV (Known Exploited Vulnerabilities) database, which is checked by DefectDojo on a regular basis
8687
* The tool-reported Severity of a Finding (Info, Low, Medium, High, Critical)
8788

88-
Currently, Priority calculation and the underlying formula cannot be adjusted. These
89-
numbers are meant as a reference only - your team’s actual priority for remediation
90-
may vary from the DefectDojo calculation.
9189

9290
## Finding Risk Calculation
9391

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: "Adjusting Priority and Risk (Pro)"
3+
description: "Change weighting of Priority and Risk calculations"
4+
weight: 2
5+
---
6+
7+
DefectDojo Pro's Priority and Risk calculations can be adjusted, allowing you to tailor DefectDojo Pro to match your internal standards for Finding Priority and Risk.
8+
9+
## Prioritization Engines
10+
11+
Similar to SLA configurations, Prioritization Engines allow you to set the rules governing how Priority and Risk are calculated.
12+
13+
![image](images/priority_default.png)
14+
15+
DefectDojo comes with a built-in Prioritization Engine, which is applied to all Products. However, you can edit this Prioritization Engine to change the weighting of **Finding** and **Product** multipliers, which will adjust how Finding Priority and Risk are assigned.
16+
17+
### Finding Multipliers
18+
19+
Eight contextual factors impact the Priority score of a Finding. Three of these are Finding-specific, and the other five are assigned based on the Product that holds the Finding.
20+
21+
You can tune your Prioritization Engine by adjusting how these factors are applied to the final calculation.
22+
23+
![image](images/priority_sliders.png)
24+
25+
Select a factor by clicking the button, and adjust this slider allows you to control the percentage a particular factor is applied. As you adjust the slider, you'll see the Risk thresholds change as a result.
26+
27+
#### Finding-Level Multipliers
28+
29+
* **Severity** - a Finding's Severity level
30+
* **Exploitability** - a Finding's KEV and/or EPSS score
31+
* **Endpoints** - the amount of Endpoints associated with a Finding
32+
33+
#### Product-Level Multipliers
34+
35+
* **Business Criticality** - the related Product's Business Criticality (None, Very Low, Low, Medium, High, or Very
36+
High)
37+
* **User Records** - the related Product's User Records count
38+
* **Revenue** - the related Product's revenue, relative to the total revenue of the Product Type
39+
* **External Audience** - whether or not the related Product has an external audience
40+
* **Internet Accessible** - whether or not the related Product is internet accessible
41+
42+
### Risk Thresholds
43+
44+
Based on the tuning of the Priority Engine, DefectDojo will automatically recommend Risk Thresholds. However, these thresholds can be adjusted as well and set to whatever values you deem appropriate.
45+
46+
![image](images/risk_threshold.png)
47+
48+
## Creating New Prioritization Engines
49+
50+
You can use multiple Prioritization Engines, which can each be assigned to different Products.
51+
52+
![image](images/priority_engine_new.png)
53+
54+
Creating a new Prioritization Engine will open the Prioritization Engine form. Once this form is submitted, a new Prioritization Engine will be added to the table.
55+
56+
## Assigning Prioritization Engines to Products
57+
58+
Each Product can have a Prioritization Engine currently in use via the **Edit Product** form for a given Product.
59+
60+
![image](images/priority_chooseengine.png)
61+
62+
Note that when a Product's Prioritization Engine is changed, or a Prioritization Engine is updated, the Product's Prioritization Engine or the Prioritization Engine itself will be "Locked" until the prioritization calculation has completed.

dojo/middleware.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ def process_exception(self, request, exception):
9494
if isinstance(exception, AuthForbidden):
9595
messages.error(request, "You are not authorized to log in via this method. Please contact support or use the standard login.")
9696
return redirect("/login?force_login_form")
97+
if isinstance(exception, TypeError) and "'NoneType' object is not iterable" in str(exception):
98+
logger.warning("OIDC login error: NoneType is not iterable")
99+
messages.error(request, "An unexpected error occurred during social login. Please use the standard login.")
100+
return redirect("/login?force_login_form")
101+
logger.error(f"Unhandled exception during social login: {exception}")
97102
return super().process_exception(request, exception)
98103

99104

dojo/pipeline.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,6 @@ def sanitize_username(username):
183183
def create_user(strategy, details, backend, user=None, *args, **kwargs):
184184
if not settings.SOCIAL_AUTH_CREATE_USER:
185185
return None
186-
details["username"] = sanitize_username(details.get("username"))
186+
username = details.get(settings.SOCIAL_AUTH_CREATE_USER_MAPPING)
187+
details["username"] = sanitize_username(username)
187188
return social_core.pipeline.user.create_user(strategy, details, backend, user, args, kwargs)

dojo/settings/settings.dist.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
DD_FORGOT_USERNAME=(bool, True), # do we show link "I forgot my username" on login screen
114114
DD_SOCIAL_AUTH_SHOW_LOGIN_FORM=(bool, True), # do we show user/pass input
115115
DD_SOCIAL_AUTH_CREATE_USER=(bool, True), # if True creates user at first login
116+
DD_SOCIAL_AUTH_CREATE_USER_MAPPING=(str, "username"), # could also be email or fullname
116117
DD_SOCIAL_LOGIN_AUTO_REDIRECT=(bool, False), # auto-redirect if there is only one social login method
117118
DD_SOCIAL_AUTH_TRAILING_SLASH=(bool, True),
118119
DD_SOCIAL_AUTH_OIDC_AUTH_ENABLED=(bool, False),
@@ -574,6 +575,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
574575
SHOW_LOGIN_FORM = env("DD_SOCIAL_AUTH_SHOW_LOGIN_FORM")
575576
SOCIAL_LOGIN_AUTO_REDIRECT = env("DD_SOCIAL_LOGIN_AUTO_REDIRECT")
576577
SOCIAL_AUTH_CREATE_USER = env("DD_SOCIAL_AUTH_CREATE_USER")
578+
SOCIAL_AUTH_CREATE_USER_MAPPING = env("DD_SOCIAL_AUTH_CREATE_USER_MAPPING")
577579

578580
SOCIAL_AUTH_STRATEGY = "social_django.strategy.DjangoStrategy"
579581
SOCIAL_AUTH_STORAGE = "social_django.models.DjangoStorage"
@@ -1881,6 +1883,7 @@ def saml2_attrib_map_format(din):
18811883
"KB": "https://support.hcl-software.com/csm?id=kb_article&sysparm_article=", # e.g. https://support.hcl-software.com/csm?id=kb_article&sysparm_article=KB0108401
18821884
"KHV": "https://avd.aquasec.com/misconfig/kubernetes/", # e.g. https://avd.aquasec.com/misconfig/kubernetes/khv045
18831885
"LEN-": "https://support.lenovo.com/cl/de/product_security/", # e.g. https://support.lenovo.com/cl/de/product_security/LEN-94953
1886+
"MAL-": "https://cvepremium.circl.lu/vuln/", # e.g. https://cvepremium.circl.lu/vuln/mal-2025-49305
18841887
"MGAA-": "https://advisories.mageia.org/&&.html", # e.g. https://advisories.mageia.org/MGAA-2013-0054.html
18851888
"MGASA-": "https://advisories.mageia.org/&&.html", # e.g. https://advisories.mageia.org/MGASA-2025-0023.html
18861889
"MSRC_": "https://cvepremium.circl.lu/vuln/", # e.g. https://cvepremium.circl.lu/vuln/msrc_cve-2025-59200

0 commit comments

Comments
 (0)