Skip to content

Commit 31f0be8

Browse files
authored
Merge pull request #11806 from DefectDojo/release/2.43.2
Release: Merge release into master from: release/2.43.2
2 parents f9e98a7 + afaa581 commit 31f0be8

File tree

13 files changed

+94
-64
lines changed

13 files changed

+94
-64
lines changed

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.43.1",
3+
"version": "2.43.2",
44
"license" : "BSD-3-Clause",
55
"private": true,
66
"dependencies": {

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

dojo/finding/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2983,7 +2983,7 @@ def finding_bulk_update_all(request, pid=None):
29832983
) = jira_helper.can_be_pushed_to_jira(group)
29842984
if not can_be_pushed_to_jira:
29852985
error_counts[error_message] += 1
2986-
jira_helper.log_jira_alert(error_message, group)
2986+
jira_helper.log_jira_cannot_be_pushed_reason(error_message, group)
29872987
else:
29882988
logger.debug(
29892989
"pushing to jira from finding.finding_bulk_update_all()",
@@ -3033,10 +3033,10 @@ def finding_bulk_update_all(request, pid=None):
30333033
"finding already pushed as part of Finding Group"
30343034
)
30353035
error_counts[error_message] += 1
3036-
jira_helper.log_jira_alert(error_message, finding)
3036+
jira_helper.log_jira_cannot_be_pushed_reason(error_message, finding)
30373037
elif not can_be_pushed_to_jira:
30383038
error_counts[error_message] += 1
3039-
jira_helper.log_jira_alert(error_message, finding)
3039+
jira_helper.log_jira_cannot_be_pushed_reason(error_message, finding)
30403040
else:
30413041
logger.debug(
30423042
"pushing to jira from finding.finding_bulk_update_all()",

dojo/jira_link/helper.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@ def get_jira_comments(finding):
513513
return None
514514

515515

516-
# Logs the error to the alerts table, which appears in the notification toolbar
517516
def log_jira_generic_alert(title, description):
517+
"""Creates a notification for JIRA errors happening outside the scope of a specific (finding/group/epic) object"""
518518
create_notification(
519519
event="jira_update",
520520
title=title,
@@ -523,8 +523,8 @@ def log_jira_generic_alert(title, description):
523523
source="JIRA")
524524

525525

526-
# Logs the error to the alerts table, which appears in the notification toolbar
527526
def log_jira_alert(error, obj):
527+
"""Creates a notification for JIRA errors when handling a specific (finding/group/epic) object"""
528528
create_notification(
529529
event="jira_update",
530530
title="Error pushing to JIRA " + "(" + truncate_with_dots(prod_name(obj), 25) + ")",
@@ -535,6 +535,19 @@ def log_jira_alert(error, obj):
535535
obj=obj)
536536

537537

538+
def log_jira_cannot_be_pushed_reason(error, obj):
539+
"""Creates an Alert for GUI display when handling a specific (finding/group/epic) object"""
540+
create_notification(
541+
event="jira_update",
542+
title="Error pushing to JIRA " + "(" + truncate_with_dots(prod_name(obj), 25) + ")",
543+
description=obj.__class__.__name__ + ": " + error,
544+
url=obj.get_absolute_url(),
545+
icon="bullseye",
546+
source="Push to JIRA",
547+
obj=obj,
548+
alert_only=True)
549+
550+
538551
# Displays an alert for Jira notifications
539552
def log_jira_message(text, finding):
540553
create_notification(
@@ -787,10 +800,12 @@ def failure_to_add_message(message: str, exception: Exception, object: Any) -> b
787800

788801
obj_can_be_pushed_to_jira, error_message, _error_code = can_be_pushed_to_jira(obj)
789802
if not obj_can_be_pushed_to_jira:
803+
# not sure why this check is not part of can_be_pushed_to_jira, but afraid to change it
790804
if isinstance(obj, Finding) and obj.duplicate and not obj.active:
791805
logger.warning("%s will not be pushed to JIRA as it's a duplicate finding", to_str_typed(obj))
806+
log_jira_cannot_be_pushed_reason(error_message + " and findis a duplicate", obj)
792807
else:
793-
log_jira_alert(error_message, obj)
808+
log_jira_cannot_be_pushed_reason(error_message, obj)
794809
logger.warning("%s cannot be pushed to JIRA: %s.", to_str_typed(obj), error_message)
795810
logger.warning("The JIRA issue will NOT be created.")
796811
return False

dojo/notifications/helper.py

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def create_notification(
5454
no_users: bool = False, # noqa: FBT001
5555
url: str | None = None,
5656
url_api: str | None = None,
57+
alert_only: bool = False, # noqa: FBT001
5758
**kwargs: dict,
5859
) -> None:
5960
"""Create an instance of a NotificationManager and dispatch the notification."""
@@ -86,6 +87,7 @@ def create_notification(
8687
no_users=no_users,
8788
url=url,
8889
url_api=url_api,
90+
alert_only=alert_only,
8991
**kwargs,
9092
)
9193

@@ -802,61 +804,68 @@ def _process_notifications(
802804
)
803805
logger.debug("process notifications for %s", notifications.user)
804806

805-
if self.system_settings.enable_slack_notifications and "slack" in getattr(
806-
notifications,
807-
event,
808-
getattr(notifications, "other"),
809-
):
810-
logger.debug("Sending Slack Notification")
811-
self._get_manager_instance("slack").send_slack_notification(
807+
alert_only = kwargs.get("alert_only", False)
808+
if alert_only:
809+
logger.debug("sending alert only")
810+
811+
if "alert" in getattr(notifications, event, getattr(notifications, "other")):
812+
logger.debug(f"Sending Alert to {notifications.user}")
813+
self._get_manager_instance("alert").send_alert_notification(
812814
event,
813815
user=notifications.user,
814816
**kwargs,
815817
)
816818

817-
if self.system_settings.enable_msteams_notifications and "msteams" in getattr(
818-
notifications,
819-
event,
820-
getattr(notifications, "other"),
821-
):
822-
logger.debug("Sending MSTeams Notification")
823-
self._get_manager_instance("msteams").send_msteams_notification(
819+
# Some errors should not be pushed to all channels, only to alerts.
820+
# For example reasons why JIRA Issues: https://github.com/DefectDojo/django-DefectDojo/issues/11575
821+
if not alert_only:
822+
if self.system_settings.enable_slack_notifications and "slack" in getattr(
823+
notifications,
824824
event,
825-
user=notifications.user,
826-
**kwargs,
827-
)
825+
getattr(notifications, "other"),
826+
):
827+
logger.debug("Sending Slack Notification")
828+
self._get_manager_instance("slack").send_slack_notification(
829+
event,
830+
user=notifications.user,
831+
**kwargs,
832+
)
828833

829-
if self.system_settings.enable_mail_notifications and "mail" in getattr(
830-
notifications,
831-
event,
832-
getattr(notifications, "other"),
833-
):
834-
logger.debug("Sending Mail Notification")
835-
self._get_manager_instance("mail").send_mail_notification(
834+
if self.system_settings.enable_msteams_notifications and "msteams" in getattr(
835+
notifications,
836836
event,
837-
user=notifications.user,
838-
**kwargs,
839-
)
837+
getattr(notifications, "other"),
838+
):
839+
logger.debug("Sending MSTeams Notification")
840+
self._get_manager_instance("msteams").send_msteams_notification(
841+
event,
842+
user=notifications.user,
843+
**kwargs,
844+
)
840845

841-
if self.system_settings.enable_webhooks_notifications and "webhooks" in getattr(
842-
notifications,
843-
event,
844-
getattr(notifications, "other"),
845-
):
846-
logger.debug("Sending Webhooks Notification")
847-
self._get_manager_instance("webhooks").send_webhooks_notification(
846+
if self.system_settings.enable_mail_notifications and "mail" in getattr(
847+
notifications,
848848
event,
849-
user=notifications.user,
850-
**kwargs,
851-
)
849+
getattr(notifications, "other"),
850+
):
851+
logger.debug("Sending Mail Notification")
852+
self._get_manager_instance("mail").send_mail_notification(
853+
event,
854+
user=notifications.user,
855+
**kwargs,
856+
)
852857

853-
if "alert" in getattr(notifications, event, getattr(notifications, "other")):
854-
logger.debug(f"Sending Alert to {notifications.user}")
855-
self._get_manager_instance("alert").send_alert_notification(
858+
if self.system_settings.enable_webhooks_notifications and "webhooks" in getattr(
859+
notifications,
856860
event,
857-
user=notifications.user,
858-
**kwargs,
859-
)
861+
getattr(notifications, "other"),
862+
):
863+
logger.debug("Sending Webhooks Notification")
864+
self._get_manager_instance("webhooks").send_webhooks_notification(
865+
event,
866+
user=notifications.user,
867+
**kwargs,
868+
)
860869

861870

862871
@app.task(ignore_result=True)

dojo/settings/settings.dist.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,6 +1771,7 @@ def saml2_attrib_map_format(dict):
17711771
"KHV": "https://avd.aquasec.com/misconfig/kubernetes/", # e.g. https://avd.aquasec.com/misconfig/kubernetes/khv045
17721772
"MGASA-": "https://advisories.mageia.org/&&.html", # e.g. https://advisories.mageia.org/MGASA-2025-0023.html
17731773
"OSV-": "https://osv.dev/vulnerability/", # e.g. https://osv.dev/vulnerability/OSV-2024-1330
1774+
"PMASA-": "https://www.phpmyadmin.net/security/", # e.g. https://www.phpmyadmin.net/security/PMASA-2025-1
17741775
"PYSEC-": "https://osv.dev/vulnerability/", # e.g. https://osv.dev/vulnerability/PYSEC-2024-48
17751776
"RHBA-": "https://access.redhat.com/errata/", # e.g. https://access.redhat.com/errata/RHBA-2024:2406
17761777
"RHEA-": "https://access.redhat.com/errata/", # e.g. https://access.redhat.com/errata/RHEA-2024:8857
@@ -1781,6 +1782,7 @@ def saml2_attrib_map_format(dict):
17811782
"RXSA-": "https://errata.rockylinux.org/", # e.g. https://errata.rockylinux.org/RXSA-2024:4928
17821783
"SNYK-": "https://snyk.io/vuln/", # e.g. https://security.snyk.io/vuln/SNYK-JS-SOLANAWEB3JS-8453984
17831784
"TEMP-": "https://security-tracker.debian.org/tracker/", # e.g. https://security-tracker.debian.org/tracker/TEMP-0841856-B18BAF
1785+
"TYPO3-": "https://typo3.org/security/advisory/", # e.g. https://typo3.org/security/advisory/typo3-core-sa-2025-010
17841786
"USN-": "https://ubuntu.com/security/notices/", # e.g. https://ubuntu.com/security/notices/USN-6642-1
17851787
"VNS": "https://vulners.com/",
17861788
}

dojo/templates/base.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
{% if request.user.is_authenticated %}
160160
<li>
161161
<a href="{% url 'view_profile' %}">
162-
<i class="fa-solid fa-user fa-fw"></i>
162+
<i class="fa-solid fa-user fa-fw"></i>
163163
{{ request.user.username }}
164164
</a>
165165
</li>
@@ -438,7 +438,7 @@
438438
</a>
439439
<ul class="nav nav-second-level">
440440
{% if "auth.view_user"|has_configuration_permission:request %}
441-
<li>
441+
<li>
442442
<a href="{% url 'users' %}">
443443
{% trans "Users" %}
444444
</a>
@@ -666,7 +666,7 @@ <h3 class="no-margin-top" style="padding-bottom: 5px;">
666666
<a class="dropdown-toggle" data-toggle="dropdown" href="">
667667
<span class="fa-solid fa-calendar-days" aria-hidden="true"></span>
668668
<span class="hidden-xs">{% trans "Engagements" %}
669-
{% if product_tab.engagements > 0 %}
669+
{% if product_tab.engagements > 0 %}
670670
<span class="badge">{{ product_tab.engagements }}</span>
671671
{% endif %}
672672
</span>
@@ -1136,6 +1136,9 @@ <h3 class="no-margin-top" style="padding-bottom: 5px;">
11361136
{% endif %}
11371137

11381138
function htmlEscape(str) {
1139+
if (!str) {
1140+
return '';
1141+
}
11391142
return str
11401143
.replace(/\n/g, " ")
11411144
.replace(/&/g, '&amp;')

dojo/tools/noseyparker/parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def version_0_22_0(self, line, test):
112112
if json_path.get("first_commit"):
113113
title = f"Secret(s) Found in Repository with Commit ID {json_path['first_commit']['commit_metadata']['commit_id']}"
114114
filepath = json_path["first_commit"]["blob_path"]
115-
description = f"Secret found of type: {rule_name} \n" \
116-
f"SECRET starts with: '{rule_text_id[:3]}' \n" \
115+
description = f"Secret found of type: {rule_name} \n" \
116+
f"Rule Text ID: '{rule_text_id}' \n" \
117117
f"Committer Name: {json_path['first_commit']['commit_metadata']['committer_name']} \n" \
118118
f"Committer Email: {json_path['first_commit']['commit_metadata']['committer_email']} \n" \
119119
f"Commit ID: {json_path['first_commit']['commit_metadata']['commit_id']} \n" \
@@ -123,8 +123,8 @@ def version_0_22_0(self, line, test):
123123
else:
124124
title = "Secret(s) Found in Repository"
125125
filepath = json_path["path"]
126-
description = f"Secret found of type: {rule_name} \n" \
127-
f"SECRET starts with: '{rule_text_id[:3]}' \n" \
126+
description = f"Secret found of type: {rule_name} \n" \
127+
f"Rule Text ID: '{rule_text_id}' \n" \
128128
f"Location: {filepath} line #{line_num} \n" \
129129
f"Line #{line_num} \n"
130130

helm/defectdojo/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
2-
appVersion: "2.43.1"
2+
appVersion: "2.43.2"
33
description: A Helm chart for Kubernetes to install DefectDojo
44
name: defectdojo
5-
version: 1.6.172
5+
version: 1.6.173
66
icon: https://www.defectdojo.org/img/favicon.ico
77
maintainers:
88
- name: madchap

helm/defectdojo/templates/media-pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
app.kubernetes.io/instance: {{ $.Release.Name }}
1111
app.kubernetes.io/managed-by: {{ $.Release.Service }}
1212
helm.sh/chart: {{ include "defectdojo.chart" $ }}
13-
{{- with .Values.extraLabels }}
13+
{{- with $.Values.extraLabels }}
1414
{{- toYaml . | nindent 4 }}
1515
{{- end }}
1616
name: {{ $fullName }}

0 commit comments

Comments
 (0)