Skip to content

Commit 0523665

Browse files
authored
Merge branch 'bugfix' into importing-tags
2 parents d34047e + 0bc088c commit 0523665

15 files changed

Lines changed: 112 additions & 19 deletions

File tree

docs/assets/images/pro_new_sla.png

242 KB
Loading
79.9 KB
Loading
149 KB
Loading
47.1 KB
Loading
44.2 KB
Loading
66.9 KB
Loading
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: "SLA Configuration"
3+
description: "Configure Service Level Agreements for different Products"
4+
weight: 2
5+
---
6+
7+
Each Product in DefectDojo can have its own Service Level Agreement (SLA) configuration, which represents the days your organization has to remediate or otherwise manage a Finding.
8+
9+
SLA can be set based on either **[Finding Severity](/en/working_with_findings/organizing_engagements_tests/product_hierarchy/#findings)** or **[Finding Risk](/en/working_with_findings/finding_priority/)** (in DefectDojo Pro).
10+
11+
![image](images/sla_multiple.png)
12+
13+
SLAs apply a countdown of days to a Finding based on the day that the Finding was created in DefectDojo. If a Finding is not Closed within the countdown, the Finding will be labeled as in breach of SLA.
14+
15+
## Working with SLAs
16+
17+
You can use SLAs as a way to represent your organizations remediation policies. You can also use them as a way to prioritize the longest-active, most critical Findings in your DefectDojo instance.
18+
19+
* You can sort or filter Finding tables by SLA days.
20+
* SLA violations can be configured to trigger [Notifications](/en/customize_dojo/notifications/about_notifications/) to DefectDojo users assigned to the related Product.
21+
* In **DefectDojo Pro**, SLA performance is also tracked on the [Executive Insights and Remediation](/en/customize_dojo/dashboards/pro_dashboards/) Metrics Dashboards.
22+
* SLA compliance can also be used to create custom [Dashboard Tiles](/en/customize_dojo/dashboards/about_custom_dashboard_tiles/#sla-violation-tile) in **DefectDojo Pro**.
23+
24+
### Mitigated Within SLA status
25+
26+
If a Finding is successfully Mitigated by the SLA deadline, the Finding will record a ✅ green check mark in the Mitigated Within SLA column.
27+
28+
![image](images/sla_mitigated_within.png)
29+
30+
If a Finding was Mitigated, but not before the SLA was violated, the Finding will record a ❌ red X in the Mitigated Within SLA column.
31+
32+
### Breaching SLAs
33+
34+
When an SLA for a given Finding is violated (the Finding is not Closed within the SLA timeline) the ✅ green check will switch to a ❌ red X. The SLA will continue to be tracked with a negative number, to represent how many days the SLA has been breached by.
35+
36+
![image](images/sla_breached.png)
37+
38+
## Managing SLA Configurations (Pro)
39+
40+
In DefectDojo Pro, one or more SLA Configurations are managed under the **Configuration > Service Level Agreements** part of the sidebar. You can create a **New Service Level Agreement** or work with existing SLA configurations from the **All Service Level Agreements** page.
41+
42+
![image](images/pro_sla_risk.png)
43+
44+
SLA Configurations can only be edited by Superusers or by a user with the corresponding [Configuration Permission](/en/customize_dojo/user_management/user_permission_chart/#configuration-permission-chart).
45+
46+
### Configuring SLA
47+
48+
SLA configurations contain the days assigned to each **Severity** or **Risk** value of DefectDojo.
49+
50+
![image](images/pro_new_sla.png)
51+
52+
Each Service Level Agreement can have a unique name, along with an optional description.
53+
54+
**Restart SLA on Finding Reactivation**: if enabled, this option will start an SLA over when a Finding is Reopened. Otherwise, the SLA will be based on when the Finding was created.
55+
56+
When editing an SLA, you can choose whether that SLA will use **Severity** or **Risk** as a benchmark for assigning Days To Remediate. This is done by selecting the related option from the **Service Level configuration Type** section of the form.
57+
58+
From here, you can set the number of days allowed for each **Severity** or **Risk** level. You can also selectively enforce SLAs; by unchecking the **Enforce ___ Finding Days** you can ignore SLA calculation for those levels of Severity or Risk.
59+
60+
## Apply an SLA Configuration to a Product (Pro)
61+
62+
Newly created Products in DefectDojo will always apply the **Default SLA Configuration**, which can be set to different values if you wish.
63+
64+
If you have SLA configurations, you can choose which of these is applied to your Product from the **Edit Product** form.
65+
66+
![image](images/pro_sla_product.png)
67+
68+
### SLA Recalculation
69+
70+
Once a new SLA has been selected for a Product, all of the associated Findings' SLAs will need to be recalculated by DefectDojo. While this process is running, a Product's SLA cannot be changed.
71+
72+
## Notes on SLAs
73+
74+
* SLAs can be optionally restarted once a [Risk Accepted](/en/working_with_findings/findings_workflows/risk_acceptances/) Finding reactivates. This is set when creating the Risk Acceptance by setting the **Restart SLA Expired** field.
75+
* Reimporting a Finding does not restart the SLA - SLAs are always calculated from when a Finding was first detected unless **Restart SLA on Finding Reactivation** is enabled.
76+
* Risk Acceptance expiry or reactivation of a Closed Finding are the only ways to reset or recalculate an SLA for a Finding once it is created (without changing the Product's SLA configuration).

docs/content/supported_tools/parsers/file/nancy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This parser expects a JSON file.
1616
Sample Nancy scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/nancy).
1717

1818
### Link To Tool
19-
See Nancy on GitHub: https://github.com/sonatype-nexus-community/nancy
19+
See Nancy on [Github](https://github.com/sonatype-nexus-community/nancy)
2020

2121
### Default Deduplication Hashcode Fields
2222
By default, DefectDojo identifies duplicate Findings using these [hashcode fields](https://docs.defectdojo.com/en/working_with_findings/finding_deduplication/about_deduplication/):

dojo/middleware.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,23 @@ def __call__(self, request):
8383
class CustomSocialAuthExceptionMiddleware(SocialAuthExceptionMiddleware):
8484
def process_exception(self, request, exception):
8585
if isinstance(exception, requests.exceptions.RequestException):
86-
messages.error(request, "Please use the standard login below.")
86+
messages.error(request, settings.SOCIAL_AUTH_EXCEPTION_MESSAGE_REQUEST_EXCEPTION)
8787
return redirect("/login?force_login_form")
8888
if isinstance(exception, AuthCanceled):
89-
messages.warning(request, "Social login was canceled. Please try again or use the standard login.")
89+
messages.warning(request, settings.SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_CANCELED)
9090
return redirect("/login?force_login_form")
9191
if isinstance(exception, AuthFailed):
92-
messages.error(request, "Social login failed. Please try again or use the standard login.")
92+
messages.error(request, settings.SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FAILED)
9393
return redirect("/login?force_login_form")
9494
if isinstance(exception, AuthForbidden):
95-
messages.error(request, "You are not authorized to log in via this method. Please contact support or use the standard login.")
95+
messages.error(request, settings.SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FORBIDDEN)
9696
return redirect("/login?force_login_form")
9797
if isinstance(exception, AuthTokenError):
98-
messages.error(request, "Social login failed due to an invalid or expired token. Please try again or use the standard login.")
98+
messages.error(request, settings.SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_TOKEN_ERROR)
9999
return redirect("/login?force_login_form")
100100
if isinstance(exception, TypeError) and "'NoneType' object is not iterable" in str(exception):
101101
logger.warning("OIDC login error: NoneType is not iterable")
102-
messages.error(request, "An unexpected error occurred during social login. Please use the standard login.")
102+
messages.error(request, settings.SOCIAL_AUTH_EXCEPTION_MESSAGE_NONE_TYPE)
103103
return redirect("/login?force_login_form")
104104
logger.error(f"Unhandled exception during social login: {exception}")
105105
return super().process_exception(request, exception)

dojo/settings/settings.dist.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@
174174
DD_SOCIAL_AUTH_GITHUB_ENTERPRISE_KEY=(str, ""),
175175
DD_SOCIAL_AUTH_GITHUB_ENTERPRISE_SECRET=(str, ""),
176176
DD_SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL=(bool, True),
177+
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_REQUEST_EXCEPTION=(str, "Please use the standard login below."),
178+
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_CANCELED=(str, "Social login was canceled. Please try again or use the standard login."),
179+
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FAILED=(str, "Social login failed. Please try again or use the standard login."),
180+
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FORBIDDEN=(str, "You are not authorized to log in via this method. Please contact support or use the standard login."),
181+
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_NONE_TYPE=(str, "An unexpected error occurred during social login. Please use the standard login."),
182+
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_TOKEN_ERROR=(str, "Social login failed due to an invalid or expired token. Please try again or use the standard login."),
177183
DD_SAML2_ENABLED=(bool, False),
178184
# Allows to override default SAML authentication backend. Check https://djangosaml2.readthedocs.io/contents/setup.html#custom-user-attributes-processing
179185
DD_SAML2_AUTHENTICATION_BACKENDS=(str, "djangosaml2.backends.Saml2Backend"),
@@ -649,6 +655,13 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
649655
if value := env("DD_SOCIAL_AUTH_OIDC_LOGIN_BUTTON_TEXT"):
650656
SOCIAL_AUTH_OIDC_LOGIN_BUTTON_TEXT = value
651657

658+
SOCIAL_AUTH_EXCEPTION_MESSAGE_REQUEST_EXCEPTION = env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_REQUEST_EXCEPTION")
659+
SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_CANCELED = env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_CANCELED")
660+
SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FAILED = env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FAILED")
661+
SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FORBIDDEN = env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FORBIDDEN")
662+
SOCIAL_AUTH_EXCEPTION_MESSAGE_NONE_TYPE = env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_NONE_TYPE")
663+
SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_TOKEN_ERROR = env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_TOKEN_ERROR")
664+
652665
AUTH0_OAUTH2_ENABLED = env("DD_SOCIAL_AUTH_AUTH0_OAUTH2_ENABLED")
653666
SOCIAL_AUTH_AUTH0_KEY = env("DD_SOCIAL_AUTH_AUTH0_KEY")
654667
SOCIAL_AUTH_AUTH0_SECRET = env("DD_SOCIAL_AUTH_AUTH0_SECRET")

0 commit comments

Comments
 (0)