Skip to content

Commit d686481

Browse files
Merge branch 'dev' into valkey-compose
2 parents ecfe553 + 3352897 commit d686481

30 files changed

Lines changed: 8892 additions & 115 deletions

.github/workflows/close-stale.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ jobs:
1515
close-stale:
1616
runs-on: ubuntu-latest
1717
steps:
18+
- name: Close issues and PRs that are pending closure
19+
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
20+
with:
21+
# Disable automatic stale marking - only close manually labeled items
22+
days-before-stale: -1
23+
days-before-close: 7
24+
stale-issue-label: 'pending-closure'
25+
stale-pr-label: 'pending-closure'
26+
close-issue-message: 'This issue has been automatically closed because it was manually labeled as stale. If you believe this was closed in error, please reopen it and remove the stale label.'
27+
close-pr-message: 'This PR has been automatically closed because it was manually labeled as stale. If you believe this was closed in error, please reopen it and remove the stale label.'
28+
1829
- name: Close stale issues and PRs
1930
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
2031
with:
@@ -23,5 +34,5 @@ jobs:
2334
days-before-close: 7
2435
stale-issue-label: 'stale'
2536
stale-pr-label: 'stale'
26-
close-issue-message: 'This issue has been automatically closed because it was manually labeled as stale. If you believe this was closed in error, please reopen it and remove the stale label.'
27-
close-pr-message: 'This PR has been automatically closed because it was manually labeled as stale. If you believe this was closed in error, please reopen it and remove the stale label.'
37+
close-issue-message: 'This issue has been automatically closed because it was labeled as stale. If you believe this was closed in error, please reopen it and remove the stale label.'
38+
close-pr-message: 'This PR has been automatically closed because it was labeled as stale. If you believe this was closed in error, please reopen it and remove the stale label.'

components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "defectdojo",
3-
"version": "2.51.0-dev",
3+
"version": "2.52.0-dev",
44
"license" : "BSD-3-Clause",
55
"private": true,
66
"dependencies": {

docs/content/en/changelog/changelog.md

Lines changed: 5 additions & 0 deletions
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
## Sept 2025: v2.50
1212

13+
### Sept 22, 2025: v2.50.4
14+
15+
* **(Pro UI)** Changes Engagement Deduplication form label and help text
16+
* **(Pro UI)** Adds toggle for MCP (for superusers only)
17+
1318
### Sept 15, 2025: v2.50.3
1419

1520
* **(Pro UI)** Added support for [CVSSv4.0](https://www.first.org/cvss/v4-0/) vector strings.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: "Github Secrets Detection Report"
3+
toc_hide: true
4+
---
5+
Import findings in JSON format from Github Secret Scanning REST API:
6+
<https://docs.github.com/en/rest/secret-scanning/secret-scanning>
7+
8+
### Sample Scan Data
9+
Sample Github SAST scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/github_secrets_detection_report_many_vul.json).

docs/content/en/open_source/contributing/how-to-write-a-parser.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ Good example:
166166
finding.cwe = data["mykey"]
167167
```
168168

169+
```python
170+
finding.cwe = data.get("mykey", 123)
171+
```
172+
173+
```python
174+
some_list = data.get("key_of_the_list") or []
175+
```
176+
177+
The finale example guards against cases where `key_of_the_list` is present, but `null`.
178+
179+
169180
### Parsing of CVSS vectors
170181

171182
Data can have `CVSS` vectors or scores. Defect Dojo use the `cvss` module provided by RedHat Security.

docs/content/en/open_source/upgrading/2.51.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ weight: -20250902
55
description: Helm chart changes and Postgres major version updates.
66
---
77

8+
## Performance improvements
9+
10+
This release includes multiple improvements aimed at making DefectDojo faster, more scalable, and lighter on your database and workers.
11+
12+
- Import and reimport are significantly more efficient: product grading is now orchestrated in batches using Celery chords, reducing the number of background tasks and database churn during large scans. This means faster imports and smoother post-processing on busy systems. See [PR 12914](https://github.com/DefectDojo/django-DefectDojo/pull/12914).
13+
- Query-count reductions and importer hot-path tuning: we trimmed unnecessary ORM calls and optimized how findings/endpoints are updated during (re)import. You should see noticeably quicker runs out of the box. See [PR 13182](https://github.com/DefectDojo/django-DefectDojo/pull/13182) and [PR 13152](https://github.com/DefectDojo/django-DefectDojo/pull/13152).
14+
- Smarter background task orchestration for product graing: less duplicate work and better scheduling during heavy operations, keeping the UI responsive while long jobs run. See [PR 12900](https://github.com/DefectDojo/django-DefectDojo/pull/12900).
15+
- Bulk tag addition for large batches: adds an internal method to add tags to many findings at once, performing tagging in batches (default 1,000) with only a few queries per batch. This replaces ~3 queries per finding with ~3 queries per batch, significantly reducing DB load during imports, reimports, and bulk edit. On a ~10k-findings sample, import time dropped from ~372s to ~190s. See [PR 13285](https://github.com/DefectDojo/django-DefectDojo/pull/13285).
16+
- Preparations for our switch to `django-pghistory` which provides more features and better performance compared to `django-auditlog`. See [PR 13169](https://github.com/DefectDojo/django-DefectDojo/pull/13169).
17+
18+
No configuration changes are required—gains are automatic after upgrading.
19+
820
## Helm Chart Changes
921

1022
This release introduces several important changes to the Helm chart configuration:

docs/content/en/open_source/upgrading/2.52.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ If you want to be 110% sure no tasks will be lost you could perform the upgrade
3131
`docker compose pull`
3232
`docker compose up -d`
3333

34+
There are no special instructions for upgrading to 2.52.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.52.0) for the contents of the release.

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.51.0-dev"
7+
__version__ = "2.52.0-dev"
88
__url__ = "https://github.com/DefectDojo/django-DefectDojo"
99
__docs__ = "https://documentation.defectdojo.com"

dojo/api_v2/serializers.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,13 +1761,15 @@ def update(self, instance, validated_data):
17611761
if reporter_id := validated_data.get("reporter"):
17621762
instance.reporter = reporter_id
17631763

1764+
# Persist vulnerability IDs first so model save computes hash including them (if there is no hash yet)
1765+
# we can't pass unsaved_vulnerabilitiy_ids to super.update()
1766+
if parsed_vulnerability_ids:
1767+
save_vulnerability_ids(instance, parsed_vulnerability_ids)
1768+
17641769
instance = super().update(
17651770
instance, validated_data,
17661771
)
17671772

1768-
if parsed_vulnerability_ids:
1769-
save_vulnerability_ids(instance, parsed_vulnerability_ids)
1770-
17711773
if push_to_jira:
17721774
jira_helper.push_to_jira(instance)
17731775

@@ -1901,11 +1903,15 @@ def create(self, validated_data):
19011903
if (vulnerability_ids := validated_data.pop("vulnerability_id_set", None)):
19021904
logger.debug("VULNERABILITY_ID_SET: %s", vulnerability_ids)
19031905
parsed_vulnerability_ids.extend(vulnerability_id["vulnerability_id"] for vulnerability_id in vulnerability_ids)
1906+
logger.debug("PARSED_VULNERABILITY_IDST: %s", parsed_vulnerability_ids)
19041907
logger.debug("SETTING CVE FROM VULNERABILITY_ID_SET: %s", parsed_vulnerability_ids[0])
19051908
validated_data["cve"] = parsed_vulnerability_ids[0]
1909+
# validated_data["unsaved_vulnerability_ids"] = parsed_vulnerability_ids
19061910

1907-
new_finding = super().create(
1908-
validated_data)
1911+
# super.create() doesn't accept unsaved_vulnerability_ids or dedupe_option=False, so call save directly.
1912+
new_finding = Finding(**validated_data)
1913+
new_finding.unsaved_vulnerability_ids = parsed_vulnerability_ids or []
1914+
new_finding.save()
19091915

19101916
logger.debug(f"New finding CVE: {new_finding.cve}")
19111917

@@ -1918,9 +1924,6 @@ def create(self, validated_data):
19181924
new_finding.reviewers.set(reviewers)
19191925
if parsed_vulnerability_ids:
19201926
save_vulnerability_ids(new_finding, parsed_vulnerability_ids)
1921-
# can we avoid this extra save? the cve has already been set above in validated_data. but there are no tests for this
1922-
# on finding update nothing is done # with vulnerability_ids?
1923-
# new_finding.save()
19241927

19251928
if push_to_jira:
19261929
jira_helper.push_to_jira(new_finding)

dojo/finding/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ def request_finding_review(request, fid):
15611561

15621562
create_notification(
15631563
event="review_requested", # TODO: - if 'review_requested' functionality will be supported by API as well, 'create_notification' needs to be migrated to place where it will be able to cover actions from both interfaces
1564-
title="Finding review requested",
1564+
title=f"Finding review requested for Test created for {finding.test.engagement.product}: {finding.test.engagement.name}: {finding.test} - {finding.title}",
15651565
requested_by=user,
15661566
note=new_note,
15671567
finding=finding,

0 commit comments

Comments
 (0)