Skip to content

Commit 6023ce4

Browse files
author
Paul Osinski
committed
Merge branch 'bugfix' of https://github.com/paulOsinski/django-DefectDojo into bugfix
2 parents efcfd7f + 51fe54d commit 6023ce4

14 files changed

Lines changed: 248 additions & 41 deletions

File tree

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424
</tr>
2525
</table>
2626

27-
![Screenshot of DefectDojo](https://raw.githubusercontent.com/DefectDojo/django-DefectDojo/dev/docs/assets/images/screenshot1.png)
28-
2927
[DefectDojo](https://www.defectdojo.com/) is a DevSecOps, ASPM (application security posture management), and
3028
vulnerability management tool. DefectDojo orchestrates end-to-end security testing, vulnerability tracking,
3129
deduplication, remediation, and reporting.
3230

3331
## Demo
3432

35-
Try out DefectDojo on our demo server at [demo.defectdojo.org](https://demo.defectdojo.org)
33+
Pro Edition: [pro.demo.defectdojo.com](https://pro.demo.defectdojo.com)
34+
35+
Community Edition: [demo.defectdojo.org](https://demo.defectdojo.org)
3636

37-
Log in with username `admin` and password `1Defectdojo@demo#appsec`. Please note that the demo is publicly accessible
38-
and regularly reset. Do not put sensitive data in the demo. An easy way to test Defect Dojo is to upload some [sample scan reports](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans).
37+
Either demo enviornment can be logged into with username `admin` and password `1Defectdojo@demo#appsec`. Please note that the demos are publicly accessible
38+
and reset every day. Do not put sensitive data in the demo. An easy way to test DefectDojo is to upload some [sample scan reports](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans).
3939

4040
## Quick Start for Compose V2
4141

@@ -91,8 +91,9 @@ Navigate to `http://localhost:8080` to see your new instance!
9191

9292
## Supported Installation Options
9393

94+
* [SaaS](https://cloud.defectdojo.com/accounts/onboarding/plg_step_1) - New UI, addittional features, includes support & supports the project
9495
* [Docker / Docker Compose](readme-docs/DOCKER.md)
95-
* [SaaS](https://www.defectdojo.com/) - Includes Support & Supports the Project
96+
9697

9798
## Community, Getting Involved, and Updates
9899

@@ -101,22 +102,20 @@ Navigate to `http://localhost:8080` to see your new instance!
101102
[<img src="https://raw.githubusercontent.com/DefectDojo/django-DefectDojo/dev/docs/assets/images/Twitter_Logo.png" alt="Twitter" height="50"/>](https://twitter.com/defectdojo)
102103
[<img src="https://raw.githubusercontent.com/DefectDojo/django-DefectDojo/dev/docs/assets/images/YouTube-Emblem.png" alt="Youtube" height="50"/>](https://www.youtube.com/channel/UCWw9qzqptiIvTqSqhOFuCuQ)
103104

104-
[Join the OWASP Slack community](https://owasp.org/slack/invite) and participate in the discussion! You can find us in
105+
[Join the OWASP Slack Community](https://owasp.org/slack/invite) and participate in the discussion! You can find us in
105106
our channel there, [#defectdojo](https://owasp.slack.com/channels/defectdojo). Follow DefectDojo on
106107
[Twitter](https://twitter.com/defectdojo), [LinkedIn](https://www.linkedin.com/company/defectdojo), and
107108
[YouTube](https://www.youtube.com/channel/UCWw9qzqptiIvTqSqhOFuCuQ) for project updates!
108109

109110
## Contributing
110111

111-
Please see our [contributing guidelines](readme-docs/CONTRIBUTING.md) for more
112-
information.
112+
Please see our [contributing guidelines](readme-docs/CONTRIBUTING.md) for details and standards on contributing __before__ considering or submitting a pull request.
113113

114114
## Pro Edition
115-
[Upgrade to DefectDojo Pro](https://www.defectdojo.com/) today to take your DevSecOps to 11. DefectDojo Pro is
116-
designed to meet you wherever you are on your security journey and help you scale, with enhanced dashboards, additional
117-
smart features, tunable deduplication, and support from DevSecOps experts.
118115

119-
Alternatively, for information please email info@defectdojo.com
116+
[Upgrade to DefectDojo Pro!](https://defectdojo.com/pricing) Pro transcends the do-it-yourself approach of open-source: A new UI, incredibile scalability, API connectors, ServiceNow, GitHub, GitLab, Azure DevOps, automatic data enrichment, prioritization, and more! See all the differentiators at the bottom of our pricing page: [defectdojo.com/pricing](https://defectdojo.com/pricing).
117+
118+
Alternatively, for information please email hello@defectdojo.com
120119

121120
## About Us
122121

51.5 KB
Loading
197 KB
Loading
165 KB
Loading
80.6 KB
Loading
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: "Integrations Guide (Pro)"
3+
weight: 1
4+
---
5+
6+
DefectDojo Pro's Integrations let you push your Findings and Finding Groups to ticket tracking systems to easily integrate security remediation with your teams existing development workflow.
7+
8+
Supported Integrations:
9+
- [Azure Devops](/en/share_your_findings/integrations_toolreference/#azure-devops-boards)
10+
- [GitHub](/en/share_your_findings/integrations_toolreference/#github)
11+
- [GitLab Boards](/en/share_your_findings/integrations_toolreference/#gitlab)
12+
- ServiceNow (Coming Soon)
13+
14+
## Opening the Integrations page
15+
16+
The Integrations page can be found under **Settings > Integrations** in the sidebar.
17+
18+
![image](images/integrators_3.png)
19+
20+
## Setting up an Integration
21+
22+
An Integrator is configured with three key components:
23+
24+
- **Integration Instance**: This is the primary connection method that DefectDojo will use with a third-party system. The Instance will include details such as a label, location and credentials to connect with, along with any other information that may be required by the vendor.
25+
- **Issue Tracker Mapping**: This is where mapping information is stored - defining the details required to connect to a given "project" within the vendor. These details include the name or ID of the "project", and mappings from DefectDojo Finding severity and status to the corresponding field in the vendor "ticket". You may have multiple mappings configured if you are trying to push Findings to multiple "project" locations.
26+
- **Issue Tracker Assignment**: This is where DefectDojo Products and Engagements are assigned to a given Issue Tracker Mapping, with per-Product/Engagement options to to define how a Finding will be pushed to a given vendor system.
27+
28+
These components are hierarchical: Each **Instance** has one or more **Mappings**, which then have one or more **Tracker Assignments**.
29+
30+
![image](images/integrators_2.png)
31+
32+
## Pushing Findings and Finding Groups
33+
34+
Once these components are configured, Findings and Finding Groups can be sent to a given Issue Tracker in two ways; manually, or automatically.
35+
36+
- **Manually**: Findings and Finding Groups contained in a Product/Engagement with an assigned **Issue Tracker Mapping** will have an option to "Push to Integrators". This will then create an Issue in the Issue Tracker with the corresponding Finding/Finding Group information. Push To Integrators can also be used to update an existing Issue.
37+
38+
### Automatically Push Findings
39+
40+
Findings can also be pushed automatically, with the **Issue Tracker Assignment** dictating how those objects will be pushed. These are the four options:
41+
42+
- **Explicitly Publish Changes**: This option disables any automatic behavior in the assigned Product or Engagement. The only way to push a Finding or Finding Group will be explicitly, as mentioned above.
43+
- **Automatically Link New Findings**: When new Findings or Finding Groups are **created** in the assigned Product or Engagement, DefectDojo will automatically push the object to the Issue Tracker. Once created, these Findings or Findings Groups will not be updated without a manual Push To Integrators action.
44+
- **Automatically Update Existing Link**: When Findings or Finding Groups are **updated** in the assigned Product or Engagement, automatically push the object to the Issue Tracker if an existing link has already been created manually.
45+
- **Automatically Link New and Update Existing Link**: When Findings or Finding Groups are created **or** updated in the assigned Product or Engagement, automatically push the object to the Issue Tracker.
46+
47+
## Issue Tracker Ticket Representation
48+
49+
Issue Tracker Tickets are represented by a series of icons under the "Integrator Tickets" column when viewing and listing
50+
Findings and Finding Groups
51+
52+
Icons from left to right:
53+
54+
- **Integration Type**: The type of Issue Tracker the Ticket is associated with
55+
- **Ticket ID**: The ID of the Ticket, as defined by the Issue Tracker
56+
- **Ticket Link**: The direct link to the Ticket, as define by the Issue Tracker
57+
- **Changelog**: Specifies when the Issue Tracker Ticket was associated with a Finding or Finding Group, as well as the last time DefectDojo made a change to the ticket
58+
59+
![image](images/integrators_1.png)
60+
61+
## Supported Project Integrations
62+
63+
Project Integrations will have varying requirements for how DefectDojo will need to interact with them. This could be in the form of an authentication mechanism, additional fields on a per "project" basis, or severity/status mappings.
64+
65+
For the complete list of requirements, please open the vendor specific pages below:
66+
67+
- [Azure Devops](/en/share_your_findings/integrations_toolreference/#azure-devops-boards)
68+
- [GitHub](/en/share_your_findings/integrations_toolreference/#github)
69+
- [GitLab Boards](/en/share_your_findings/integrations_toolreference/#gitlab)
70+
- ServiceNow (Coming Soon)
71+
72+
## Error Handling and Debugging
73+
74+
Integrations can produce errors for a variety of reasons such as connectivity, authentication, permissions, etc.. To assist
75+
in debugging these errors, each Issue Tracker Mapping has a table of errors that list when the error occurred, the reason it
76+
occurred, and the Finding or Finding Group that failed to be pushed.
77+
78+
These errors can be found by looking at the Issue Tracker Mappings & Assignments page, under the ⚠️ Total Errors column.
79+
80+
![image](images/integrators_4.png)
81+
82+
Clicking on the Total Errors entry will bring you to a page with more detailed descriptions of errors associated with this Integration.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
title: "Integrators Tool Reference"
3+
description: "Beta Feature"
4+
weight: 1
5+
---
6+
7+
Here are specific instructions detailing how to set up a DefectDojo Integration with a third party Issue Tracker.
8+
9+
## Azure DevOps Boards
10+
11+
### Instance Setup
12+
13+
- **Label** should be the label that you want to use to identify this integration.
14+
- **Location** should be set to your Azure URL - for example `https://dev.azure.com/{your organization}`
15+
- **Token** should be set to a personal access token from Azure.
16+
17+
Authentication with Azure DevOps requires a [personal access token](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows)
18+
with permissions set to "Read, Write and Manage" for "Work Items" for the Azure Project that you wish to work with.
19+
20+
### Issue Tracker Mapping
21+
22+
These details dictate how DefectDojo will map Finding or Finding Group attributes to a given Project in Azure DevOps:
23+
24+
#### Issue Tracker Mapping Details
25+
26+
The `Project ID` field corresponds to the name or the ID of the Project in Azure.
27+
28+
#### Severity Mapping Details
29+
30+
The attributes in the form are supplied as defaults, and are as follows:
31+
32+
- **Severity Field Name**: `/fields/Microsoft.VSTS.Common.Priority`
33+
- **Info Mapping**: `4`
34+
- **Low Mapping**: `4`
35+
- **Medium Mapping**: `3`
36+
- **High Mapping**: `2`
37+
- **Critical Mapping**: `1`
38+
39+
#### Status Mapping Details
40+
41+
The attributes in the form are supplied as defaults and are as follows:
42+
43+
- **Status Field Name**: `/fields/System.State`
44+
- **Active Mapping**: `To Do`
45+
- **Closed Mapping**: `Done`
46+
- **False Positive Mapping**: `Done`
47+
- **Risk Accepted Mapping**: `Done`
48+
49+
## GitHub
50+
51+
The GitHub integration allows you to add issues to a [GitHub Project](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects), which also open Issues in an associated Repo. These Repos/Projects can be associated with either a GitHub Organization or a personal GitHub account.
52+
53+
### Instance Setup
54+
55+
- **Label** should be the label that you want to use to identify this integration.
56+
- **Location** should be set to your GitHub User or Organization URL, depending on where you wish to create issues. for example `https://github.com/{your-organization}`
57+
- **Token** should be set to a personal access token from GitHub.
58+
59+
Personal access tokens for GitHub can be created at https://github.com/settings/tokens. The token must have Repo and Project scopes.
60+
61+
### Issue Tracker Mapping
62+
63+
- **Issue Tracker Mapping Label** should be set to identify the Project or Repo that you wish to create Issues in.
64+
- **Project Number** should be the ID of a GitHub project that you want to send items to. You can get this from the URL while looking at a Project, for example `https://github.com/orgs/{your-org}/projects/{project number}`.
65+
- **Repository Name** should be the name of a repo associated with your organization (or user) that you want to push Issues to.
66+
67+
68+
### Severity Mapping Details
69+
70+
**In order to set up the integration, the Project MUST have a custom field created to represent Issue Priority, otherwise Severity will not be mapped correctly and Issues will not push to GitHub.**
71+
72+
Follow this guide to create a [custom field](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/quickstart-for-projects#creating-a-field-to-track-priority).
73+
Each Severity will need to have a corresponding single-select option available. For example, out of the box DefectDojo suggests P0, P1, P2, P3, P4 as possible Priority values, and each of those will need to be added to the Priority custom field.
74+
75+
- **Severity Field Name**: `Priority`
76+
- **Info Mapping**: `P0`
77+
- **Low Mapping**: `P1`
78+
- **Medium Mapping**: `P2`
79+
- **High Mapping**: `P3`
80+
- **Critical Mapping**: `P4`
81+
82+
### Status Mapping Details
83+
84+
By default, new GitHub Projects will have Statuses for Issues of "In Progress" and "Done". Additional statuses can be added to the Project to track False Positive or Risk Accepted status if you wish. One of the ways this can be done is by adding a new Status Column to the Project Board.
85+
86+
- **Status Field Name**: `Status`
87+
- **Active Mapping**: `In Progress`
88+
- **Closed Mapping**: `Done`
89+
- **False Positive Mapping**: `Done`
90+
- **Risk Accepted Mapping**: `Done`
91+
92+
## GitLab
93+
94+
The GitLab integration allows you to add issues to a [GitLab Project](https://docs.gitlab.com/ee/user/project/).
95+
96+
### Instance Setup
97+
98+
- **Label** should be the label that you want to use to identify this integration.
99+
- **Location** should be set to the link to your GitLab server, for example `https://gitlab.com/`.
100+
- **Token** should be set to a personal access token from GitLab. The token must have API scopes. See [GitLab’s guide to creating a personal access token](https://docs.gitlab.com/user/profile/personal_access_tokens/#create-a-personal-access-token).
101+
102+
### Issue Tracker Mapping
103+
104+
- **Project Name**: The name of the project in GitLab that you want to send issues to
105+
106+
### Severity Mapping Details
107+
108+
This maps to the GitLab Priority field.
109+
- **Severity Field Name**: `Priority`
110+
- **Info Mapping**: `1`
111+
- **Low Mapping**: `2`
112+
- **Medium Mapping**: `3`
113+
- **High Mapping**: `4`
114+
- **Critical Mapping**: `5`
115+
116+
### Status Mapping Details
117+
118+
By default, GitLab has statuses of 'opened' and 'closed'. Additional status labels can be added if you want to track False Positive or Risk Accepted status. See [GitLab Docs](https://docs.gitlab.com/user/work_items/status/) for details.
119+
120+
- **Status Field Name**: `Status`
121+
- **Active Mapping**: `opened`
122+
- **Closed Mapping**: `closed`
123+
- **False Positive Mapping**: `closed`
124+
- **Risk Accepted Mapping**: `closed`

docs/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dojo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# Django starts so that shared_task will use this app.
55
from .celery import app as celery_app # noqa: F401
66

7-
__version__ = "2.49.1"
7+
__version__ = "2.49.2"
88
__url__ = "https://github.com/DefectDojo/django-DefectDojo"
99
__docs__ = "https://documentation.defectdojo.com"

dojo/endpoint/signals.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import contextlib
2+
13
from auditlog.models import LogEntry
24
from django.conf import settings
35
from django.contrib.contenttypes.models import ContentType
@@ -12,18 +14,20 @@
1214

1315
@receiver(post_delete, sender=Endpoint)
1416
def endpoint_post_delete(sender, instance, using, origin, **kwargs):
15-
if instance == origin:
16-
description = _('The endpoint "%(name)s" was deleted') % {"name": str(instance)}
17-
if settings.ENABLE_AUDITLOG:
18-
if le := LogEntry.objects.filter(
19-
action=LogEntry.Action.DELETE,
20-
content_type=ContentType.objects.get(app_label="dojo", model="endpoint"),
21-
object_id=instance.id,
22-
).order_by("-id").first():
23-
description = _('The endpoint "%(name)s" was deleted by %(user)s') % {
24-
"name": str(instance), "user": le.actor}
25-
create_notification(event="endpoint_deleted", # template does not exists, it will default to "other" but this event name needs to stay because of unit testing
26-
title=_("Deletion of %(name)s") % {"name": str(instance)},
27-
description=description,
28-
url=reverse("endpoint"),
29-
icon="exclamation-triangle")
17+
# Catch instances in async delete where a single object is deleted more than once
18+
with contextlib.suppress(sender.DoesNotExist):
19+
if instance == origin:
20+
description = _('The endpoint "%(name)s" was deleted') % {"name": str(instance)}
21+
if settings.ENABLE_AUDITLOG:
22+
if le := LogEntry.objects.filter(
23+
action=LogEntry.Action.DELETE,
24+
content_type=ContentType.objects.get(app_label="dojo", model="endpoint"),
25+
object_id=instance.id,
26+
).order_by("-id").first():
27+
description = _('The endpoint "%(name)s" was deleted by %(user)s') % {
28+
"name": str(instance), "user": le.actor}
29+
create_notification(event="endpoint_deleted", # template does not exists, it will default to "other" but this event name needs to stay because of unit testing
30+
title=_("Deletion of %(name)s") % {"name": str(instance)},
31+
description=description,
32+
url=reverse("endpoint"),
33+
icon="exclamation-triangle")

0 commit comments

Comments
 (0)