Skip to content

Commit e21bfbb

Browse files
authored
Merge pull request #12385 from DefectDojo/bugfix
Release 2.46.0: Merge Bugfix into Dev
2 parents 32b1bdd + 8ff6f7d commit e21bfbb

File tree

69 files changed

+25746
-19123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+25746
-19123
lines changed

.github/workflows/gh-pages.yml

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252

5353
- name: Deploy
5454
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
55+
if: github.repository == 'DefectDojo/django-DefectDojo' # Deploy docs only in core repo, not in forks - it would just fail in fork
5556
with: # publishes to the `gh-pages` branch by default
5657
github_token: ${{ secrets.GITHUB_TOKEN }}
5758
publish_dir: ./docs/public

.github/workflows/release-1-create-pr.yml

+18-7
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ on:
99
# the actual branch that can be chosen on the UI is made irrelevant by further steps
1010
# because someone will forget one day to change it.
1111
from_branch:
12-
description: "Select branch to release from ('release/x.y.z'. If `dev` is entered, a new release branch will be created from `dev`)"
12+
description: "Select branch to release from. Dev branch releases happen the first monday of the month. Otherwise, use bugfix."
1313
required: true
14+
type: choice
15+
default: 'bugfix'
16+
options:
17+
- bugfix
18+
- dev
1419
release_number:
1520
description: "Release version (x.y.z format)"
1621
required: true
@@ -19,6 +24,18 @@ jobs:
1924
create_pr:
2025
runs-on: ubuntu-latest
2126
steps:
27+
- name: Validate proper bugfix branch release_number format is being used
28+
if: ${{ inputs.from_branch == 'bugfix' }}
29+
run: |
30+
# Expect the last octet in release_number to not be 0
31+
echo "${{ inputs.release_number }}" | grep "^[0-9]*\.[0-9]*\.[1-9]$"
32+
33+
- name: Validate proper dev branch release_number format is being used
34+
if: ${{ inputs.from_branch == 'dev' }}
35+
run: |
36+
# Expect the last octet in release_number to not be 1-9
37+
echo "${{ inputs.release_number }}" | grep "^[0-9]*\.[0-9]*\.0$"
38+
2239
- id: Set-GitHub-org
2340
run: echo "GITHUB_ORG=${GITHUB_REPOSITORY%%/*}" >> $GITHUB_ENV
2441

@@ -28,15 +45,9 @@ jobs:
2845
ref: ${{ inputs.from_branch }}
2946

3047
- name: Create release branch
31-
if: ${{ !startsWith(inputs.from_branch, 'release/') }}
3248
run: |
3349
echo "NEW_BRANCH=release/${{ inputs.release_number }}" >> $GITHUB_ENV
3450
35-
- name: Use existing release branch
36-
if: startsWith(inputs.from_branch, 'release/')
37-
run: |
38-
echo "NEW_BRANCH=${{ inputs.from_branch }}" >> $GITHUB_ENV
39-
4051
- name: Configure git
4152
run: |
4253
git config --global user.name "${{ env.GIT_USERNAME }}"

.github/workflows/slack-pr-reminder.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
notify-reviewers:
1010
runs-on: ubuntu-latest
11+
if: github.repository == 'DefectDojo/django-DefectDojo' # Notify only in core repo, not in forks - it would just fail in fork
1112

1213
steps:
1314
- name: Checkout repository
142 KB
Loading

docs/assets/images/tags_product.png

113 KB
Loading

docs/content/en/changelog/changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ For Open Source release notes, please see the [Releases page on GitHub](https://
1010

1111
## Apr 2025: v2.45
1212

13+
### Apr 28, 2025: v2.45.3
14+
15+
- **(Tools)** Fortify parser can now assign False Positive status to Findings according to the audit.xml file.
16+
- **(Import)** Reimporting a scan can now handle special statuses assigned by a tool. Now, if a Finding was initially imported as Active, but the status was changed to False Positive, Out Of Scope or Risk Accepted by a subsequent report, that status will now be respected and applied to the Finding by Reimport.
17+
1318
### Apr 22, 2025: v2.45.2
1419

1520
![image](images/risk_table.png)

docs/content/en/connecting_your_tools/parsers/generic_findings_import.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ You can use Generic Findings Import as a method to ingest JSON or CSV files into
99
Files uploaded using Generic Findings Import must conform to the accepted format with respect to CSV column headers / JSON attributes.
1010

1111
These attributes are supported for CSV:
12+
1213
- Date: Date of the finding in mm/dd/yyyy format.
1314
- Title: Title of the finding
1415
- CweId: Cwe identifier, must be an integer value.
@@ -104,18 +105,32 @@ Example:
104105
}
105106
```
106107

107-
This parser supports an attribute `name` and `type` to be able to define `TestType`. Based on this, you can define custom `HASHCODE_FIELDS` or `DEDUPLICATION_ALGORITHM` in the settings.
108+
This parser supports some additional attributes to be able to define custom `TestTypes` as well as influencing some meta fields on the `Test`:
109+
110+
- `name`: The internal name of the tool you are using. This is primarily informational, and used for reading the report manually.
111+
- `type`: The name of the test type to create in DefectDojo with the suffix of `(Generic Findings Import)`. The suffix is an important identifier for future users attempting to identify the test type to supply when importing new reports. This value is very important when fetching the correct test type to import findings into, so be sure to keep the `type` consistent from import to import! As an example, a report submitted with a `type` of `Internal Company Tool` will produce a test type in DefectDojo with the title `Internal Company Tool (Generic Findings Import)`. With this newly created test type, you can define custom `HASHCODE_FIELDS` or `DEDUPLICATION_ALGORITHM` in the settings.
112+
- `version`: The version of the tool you are using. This is primarily informational, and is used for reading the report manually and tracking format changes from version to version.
113+
- `description`: A brief description of the test. This could be an explanation of what the tool is reporting, where the tools is maintained, who the point of contact is for the tool when issues arise, or anything in between.
114+
- `static_tool`: Dictates that tool used is running static analysis methods to discover vulnerabilities.
115+
- `dynamic_tool`: Dictates that tool used is running dynamic analysis methods to discover vulnerabilities.
116+
- `soc`: Dictates that tool is used for reporting alerts from a soc (Pro Edition Only).
108117

109118
Example:
110119

111120
```JSON
112121
{
113122
"name": "My wonderful report",
114123
"type": "My custom Test type",
124+
"version": "1.0.5",
125+
"description": "A unicorn tool that is capable of static analysis, dynamic analysis, and even capturing soc alerts!",
126+
"static_tool": true,
127+
"dynamic_tool": true,
128+
"soc": true,
115129
"findings": [
116130
]
117131
}
118132
```
119133

120134
### Sample Scan Data
135+
121136
Sample Generic Findings Import scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/generic).

docs/content/en/customize_dojo/user_management/configure_sso.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ In order to use Google Authentication, a Google Authentication Server will need
315315
- **Google OAuth Secret** should be set to your **Client Secret Key**.
316316
- **Whitelisted Domains** can be set to the domain name used by your organization. However, this will allow login from any user with this domain name in their Google email address.
317317
- Alternatively, if you only want to allow specific Google email addresses to log in to DefectDojo, you can enter those in the **Whitelisted E-mail Addresses** section of the form. `([email protected],[email protected])`, etc.
318+
- Note that you must add at least one user or domain to the whitelist, or DefectDojo will not allow any users to log in using Google OAuth.
318319

319-
2. Check the **Enable Azure AD OAuth** box. Submit the form, and `Login With Google` will be added as an option to the Login menu.
320+
2. Check the **Enable Google OAuth** box. Submit the form, and `Login With Google` will be added as an option to the Login menu.
320321

321322
### Open-Source
322323

@@ -678,4 +679,4 @@ ecosystem as it has a library of compatible providers with documentation
678679
of implementation. Conveniently, each provider has an identical
679680
procedure of managing the authenticated responses and authorizing access
680681
within a given application. The only difficulty is creating a new
681-
authentication client with a given OAuth2 provider.
682+
authentication client with a given OAuth2 provider.

docs/content/en/working_with_findings/findings_workflows/finding_status_definitions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ If you have a testing and remediation effort related to a specific aspect of you
6868

6969
‘This Finding was discovered by our scanning tool, but after reviewing the Finding we have discovered that this reported vulnerability does not exist.’
7070

71-
Once you’ve reviewed a Finding, you might discover that the vulnerability reported does not actually exist. The False Positive status allows DefectDojo to keep track of this information, and future imports will also apply the False Positive status to this Finding.
71+
Once you’ve reviewed a Finding, you might discover that the vulnerability reported does not actually exist. The False Positive status will be maintained by reimport and prevent matching findings from being opened or closed, which assists with noise reduction.
7272

7373
If a different scanning tool finds a similar Finding, it will not be recorded as a False Positive. DefectDojo can only compare Findings within the same tool to determine if a Finding has already been recorded.
7474

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
title: "Tags"
3+
description: "Use Tags to create a new slice of your data model"
4+
draft: false
5+
weight: 2
6+
exclude_search: false
7+
---
8+
9+
Tags are ideal for grouping objects in a manner that can be filtered out into smaller, more digestible chunks. They can be used to denote status, or to create custom sets of Product Type, Products, Engagements or Findings across the data model.
10+
11+
In DefectDojo, tags are a first class citizen and are recognized as the facilitators
12+
of organization within each level of the [data model](../Product_hierarchy).
13+
14+
Here is an example with a Product with two tags and four findings each with a single tag:
15+
16+
![High level example of usage with tags](images/tags-high-level-example.png)
17+
18+
### Tag Formats
19+
20+
Tags can be formatted in any of the following ways:
21+
- StringWithNoSpaces
22+
- string-with-hyphens
23+
- string_with_underscores
24+
- colons:acceptable
25+
26+
## Tag Management (Pro UI)
27+
28+
### Adding and Removing
29+
30+
Tags can be managed in the following ways:
31+
32+
1. **Creating or Editing new objects**
33+
34+
When a new object is created or edited through the UI or API, there is a field for specifying
35+
the tags to be set on a given object.
36+
37+
![tag](images/tags_product.png)
38+
39+
2. **When Importing/Reimporting Findings**
40+
41+
Tags are available on the Import/Reimport form, both in the UI and via the API. When this form is submitted, the **Test** will be tagged with `[tag]` and `[daily-import]`. If "Apply Tags to Findings" or "Apply Tags to Endpoints" is selected, those objects will also be tagged. Tags provide an opportunity to append automation run details and tool information that may not be captured in the Test or Finding object directly.
42+
43+
![tag](images/tags_importscan.png)
44+
45+
3. **Via Bulk Edit**
46+
47+
When many Findings are selected from a table, you can use the Bulk Edit menu to change the associated Tags for many Findings simultaneously. Note that this will replace all Finding-level Tags with the Tags specified; existing Finding Tags will be overwritten.
48+
49+
![bulk editing findings](images/Bulk_Editing_Findings.png)
50+
51+
For more information, see our guide to [Bulk Editing Findings](/en/working_with_findings/findings_workflows/editing_findings/#bulk-edit-findings).
52+
53+
54+
## Tag Management (Classic UI / OpenSource)
55+
56+
### Adding and Removing
57+
58+
Tags can be managed in the following ways:
59+
60+
1. Creating or Editing new objects
61+
62+
When a new object is created or edited through the UI or API, there is a field for specifying
63+
the tags to be set on a given object. This field is a multiselect field that also has
64+
auto completion to make searching and adding existing tags a breeze. Here is what the field
65+
looks like on the Product from the screenshot in the previous section:
66+
67+
![Tag management on an object](images/tags-management-on-object.png)
68+
69+
2. Import and Reimport
70+
71+
Tags can also be applied to a given test at the time of import or reimport. This is a very
72+
handy use case when importing via the API with automation as it provides an opportunity to
73+
append automation run details and tool information that may not be captured in the test
74+
or finding object directly.
75+
76+
The field looks and behaves exactly as it does on a given object
77+
78+
3. Bulk Edit Menu (Findings only)
79+
80+
When needing to update many Findings with the same set of tags, the bulk edit menu can be
81+
used to ease the burden.
82+
83+
In the following example, lets say I want to update the tags of the two findings with the tag "tag-group-alpha" to be a new tag list like this ["tag-group-charlie", "tag-group-delta"].
84+
First I would select the tags to be updated:
85+
86+
![Select findings for bulk edit tag update](images/tags-select-findings-for-bulk-edit.png)
87+
88+
Once a finding is selected, a new button appears with the name "Bulk Edit". Clicking this button
89+
produces a dropdown menu with many options, but the focus is just on tags for now. Update the
90+
field to have the desired tag list as follows, and click submit
91+
92+
![Apply changes for bulk edit tag update](images/tags-bulk-edit-submit.png)
93+
94+
The tags on the selected Findings will be updated to whatever was specified in the tags field
95+
within the bulk edit menu
96+
97+
![Completed bulk edit tag update](images/tags-bulk-edit-complete.png)
98+
99+
## Tag Inheritance
100+
101+
**Pro UI note: though Tag inheritance can be configured using the Pro UI, inherited Tags currently can only be accessed and filtered for through the Classic UI or the API.**
102+
103+
When Tag Inheritance is enabled, tags applied to a given Product will automatically be applied to all objects under Products in the [Product Hierarchy](/en/working_with_findings/organizing_engagements_tests/Product_hierarchy).
104+
105+
### Configuration
106+
107+
Tag Inheritance can be enabled at the following scope levels:
108+
- Global Scope
109+
- Every Product system wide will begin applying tags to all children objects (Engagements, Tests and Findings)
110+
- This is set within the System Settings
111+
- Product Scope
112+
- Only the selected Product will begin applying tags to all children objects (Engagements, Tests and Findings)
113+
- This is set at the Product creation/edit page
114+
115+
### Behaviors
116+
117+
When Tag Inheritance is enabled, standard Tags can be added to and removed from objects in the standard way.
118+
However inherited tags cannot be removed from a child object without removing them from the parent object
119+
See the following example of adding a tag "test_only_tag" to the Test object and a tag "engagement_only_tag" to the Engagement.
120+
121+
![Example of inherited tags](images/tags-inherit-exmaple.png)
122+
123+
When updates are made to the tag list on a Product, the same changes are made to all objects within the Product asynchronously. The duration of this task directly correlates to the number the objects contained within a finding.
124+
125+
**Open-Source:** If Tag changes are not observed within a reasonable time period, consult the celery worker logs to identify where any problems might have arisen.
126+
127+
128+
### Filtering for Tags (Classic UI)
129+
130+
Tags can be filtered in many ways through both the UI and the API. For example, here is a snippet
131+
of the Finding filters:
132+
133+
![Snippet of the finding filters](images/tags-finding-filter-snippet.png)
134+
135+
There are ten fields related to tags:
136+
137+
- Tags: filter on any tags that are attached to a given Finding
138+
- Examples:
139+
- Finding will be returned
140+
- Finding Tags: ["A", "B", "C"]
141+
- Filter Query: "B"
142+
- Finding Will *not* be returned
143+
- Finding Tags: ["A", "B", "C"]
144+
- Filter Query: "F"
145+
- Not Tags: filter on any tags that are *not* attached to a given Finding
146+
- Examples:
147+
- Finding will be returned
148+
- Finding Tags: ["A", "B", "C"]
149+
- Filter Query: "F"
150+
- Finding Will *not* be returned
151+
- Finding Tags: ["A", "B", "C"]
152+
- Filter Query: "B"
153+
- Tag Name Contains: filter on any tags that contain part or all of the query in the given Finding
154+
- Examples:
155+
- Finding will be returned
156+
- Finding Tags: ["Alpha", "Beta", "Charlie"]
157+
- Filter Query: "et" (part of "Beta")
158+
- Finding Will *not* be returned
159+
- Finding Tags: ["Alpha", "Beta", "Charlie"]
160+
- Filter Query: "meg" (part of "Omega")
161+
- Not Tags: filter on any tags that do *not* contain part or all of the query in the given Finding
162+
- Examples:
163+
- Finding will be returned
164+
- Finding Tags: ["Alpha", "Beta", "Charlie"]
165+
- Filter Query: "meg" (part of "Omega")
166+
- Finding Will *not* be returned
167+
- Finding Tags: ["Alpha", "Beta", "Charlie"]
168+
- Filter Query: "et" (part of "Beta")
169+
170+
For the other six tag filters, they follow the same rules as "Tags" and "Not Tags" as above,
171+
but at different levels in the data model:
172+
173+
- Tags (Test): filter on any tags that are attached to the Test of a given Finding
174+
- Not Tags (Test): filter on any tags that are *not* attached to the Test of a given Finding
175+
- Tags (Engagement): filter on any tags that are attached to the Engagement of a given Finding
176+
- Not Tags (Engagement): filter on any tags that are *not* attached to the Engagement of a given Finding
177+
- Tags (Product): filter on any tags that are attached to the Product of a given Finding
178+
- Not Tags (Product): filter on any tags that are *not* attached to the Product of a given Finding

dojo/api_v2/serializers.py

-10
Original file line numberDiff line numberDiff line change
@@ -1527,8 +1527,6 @@ class Meta:
15271527

15281528

15291529
class RiskAcceptanceSerializer(serializers.ModelSerializer):
1530-
recommendation = serializers.SerializerMethodField()
1531-
decision = serializers.SerializerMethodField()
15321530
path = serializers.SerializerMethodField()
15331531

15341532
def create(self, validated_data):
@@ -1556,14 +1554,6 @@ def update(self, instance, validated_data):
15561554
ra_helper.remove_finding_from_risk_acceptance(user, instance, finding)
15571555
return instance
15581556

1559-
@extend_schema_field(serializers.CharField())
1560-
def get_recommendation(self, obj):
1561-
return Risk_Acceptance.TREATMENT_TRANSLATIONS.get(obj.recommendation)
1562-
1563-
@extend_schema_field(serializers.CharField())
1564-
def get_decision(self, obj):
1565-
return Risk_Acceptance.TREATMENT_TRANSLATIONS.get(obj.decision)
1566-
15671557
@extend_schema_field(serializers.CharField())
15681558
def get_path(self, obj):
15691559
engagement = Engagement.objects.filter(

0 commit comments

Comments
 (0)