Skip to content

Commit 4b695cb

Browse files
authored
Merge pull request #13348 from DefectDojo/bugfix
Release 2.51.0: Merge Bugfix into Dev
2 parents b1a5cba + 4a80d28 commit 4b695cb

File tree

23 files changed

+8833
-72
lines changed

23 files changed

+8833
-72
lines changed

.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.'

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.

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,

dojo/search/views.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from dojo.engagement.queries import get_authorized_engagements
1616
from dojo.filters import FindingFilter, FindingFilterWithoutObjectLookups
1717
from dojo.finding.queries import get_authorized_findings, get_authorized_vulnerability_ids, prefetch_for_findings
18-
from dojo.forms import SimpleSearchForm
18+
from dojo.forms import FindingBulkUpdateForm, SimpleSearchForm
1919
from dojo.models import Engagement, Finding, Finding_Template, Languages, Product, Test
2020
from dojo.product.queries import get_authorized_app_analysis, get_authorized_products
2121
from dojo.test.queries import get_authorized_tests
@@ -390,7 +390,9 @@ def simple_search(request):
390390
"form": form,
391391
"activetab": activetab,
392392
"show_product_column": True,
393-
"generic": generic})
393+
"generic": generic,
394+
"bulk_edit_form": FindingBulkUpdateForm(request.GET),
395+
})
394396

395397
if cookie:
396398
response.set_cookie("highlight", value=keywords_query,

dojo/settings/settings.dist.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
DD_SOCIAL_AUTH_GITHUB_ENTERPRISE_API_URL=(str, ""),
173173
DD_SOCIAL_AUTH_GITHUB_ENTERPRISE_KEY=(str, ""),
174174
DD_SOCIAL_AUTH_GITHUB_ENTERPRISE_SECRET=(str, ""),
175+
DD_SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL=(bool, True),
175176
DD_SAML2_ENABLED=(bool, False),
176177
# Allows to override default SAML authentication backend. Check https://djangosaml2.readthedocs.io/contents/setup.html#custom-user-attributes-processing
177178
DD_SAML2_AUTHENTICATION_BACKENDS=(str, "djangosaml2.backends.Saml2Backend"),
@@ -577,7 +578,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
577578
SOCIAL_AUTH_STRATEGY = "social_django.strategy.DjangoStrategy"
578579
SOCIAL_AUTH_STORAGE = "social_django.models.DjangoStorage"
579580
SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ["username", "first_name", "last_name", "email"]
580-
SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True
581+
SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = env("DD_SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL")
581582

582583
GOOGLE_OAUTH_ENABLED = env("DD_SOCIAL_AUTH_GOOGLE_OAUTH2_ENABLED")
583584
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = env("DD_SOCIAL_AUTH_GOOGLE_OAUTH2_KEY")
@@ -1325,6 +1326,7 @@ def saml2_attrib_map_format(din):
13251326
"Scout Suite Scan": ["file_path", "vuln_id_from_tool"], # for now we use file_path as there is no attribute for "service"
13261327
"Meterian Scan": ["cwe", "component_name", "component_version", "description", "severity"],
13271328
"Github Vulnerability Scan": ["title", "severity", "component_name", "vulnerability_ids", "file_path"],
1329+
"Github Secrets Detection Report": ["title", "file_path", "line"],
13281330
"Solar Appscreener Scan": ["title", "file_path", "line", "severity"],
13291331
"pip-audit Scan": ["vuln_id_from_tool", "component_name", "component_version"],
13301332
"Rubocop Scan": ["vuln_id_from_tool", "file_path", "line"],
@@ -1570,6 +1572,7 @@ def saml2_attrib_map_format(din):
15701572
"AWS Security Hub Scan": DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL,
15711573
"Meterian Scan": DEDUPE_ALGO_HASH_CODE,
15721574
"Github Vulnerability Scan": DEDUPE_ALGO_HASH_CODE,
1575+
"Github Secrets Detection Report": DEDUPE_ALGO_HASH_CODE,
15731576
"Cloudsploit Scan": DEDUPE_ALGO_HASH_CODE,
15741577
"SARIF": DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL_OR_HASH_CODE,
15751578
"Azure Security Center Recommendations Scan": DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL,
@@ -1850,6 +1853,7 @@ def saml2_attrib_map_format(din):
18501853
"ALSA-": "https://osv.dev/vulnerability/", # e.g. https://osv.dev/vulnerability/ALSA-2024:0827
18511854
"ASA-": "https://security.archlinux.org/", # e.g. https://security.archlinux.org/ASA-202003-8
18521855
"AVD": "https://avd.aquasec.com/misconfig/", # e.g. https://avd.aquasec.com/misconfig/avd-ksv-01010
1856+
"AWS-": "https://aws.amazon.com/security/security-bulletins/", # e.g. https://aws.amazon.com/security/security-bulletins/AWS-2025-001
18531857
"BAM-": "https://jira.atlassian.com/browse/", # e.g. https://jira.atlassian.com/browse/BAM-25498
18541858
"BSERV-": "https://jira.atlassian.com/browse/", # e.g. https://jira.atlassian.com/browse/BSERV-19020
18551859
"C-": "https://hub.armosec.io/docs/", # e.g. https://hub.armosec.io/docs/c-0085

dojo/templates/dojo/findings_list_snippet.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,9 @@ <h3 class="has-filters">
722722
<td class="nowrap">
723723
{% if finding.planned_remediation_date %}{{ finding.planned_remediation_date }}{% endif %}
724724
</td>
725+
<td class="nowrap">
726+
{% if finding.planned_remediation_version %}{{ finding.planned_remediation_version }}{% endif %}
727+
</td>
725728
{% if filter_name != 'Closed' %}
726729
<td class="nowrap">
727730
{% if finding.reviewers %}
@@ -820,6 +823,7 @@ <h3 class="has-filters">
820823
{% endif %}
821824
{ "data": "service" },
822825
{ "data": "planned_remediation_date" },
826+
{ "data": "planned_remediation_version" },
823827
{% if filter_name != 'Closed' %}
824828
{ "data": "reviewers" },
825829
{% endif %}

dojo/tools/github_secrets_detection_report/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)