Skip to content

Commit 1342043

Browse files
authored
Merge pull request #10571 from DefectDojo/release/2.36.3
Release: Merge release into master from: release/2.36.3
2 parents 45d7e0a + 7af5c69 commit 1342043

50 files changed

Lines changed: 414 additions & 1509 deletions

Some content is hidden

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

.flake8

Lines changed: 0 additions & 25 deletions
This file was deleted.

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

docker/entrypoint-uwsgi.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ python3 manage.py check
2222

2323
DD_UWSGI_LOGFORMAT_DEFAULT='[pid: %(pid)|app: -|req: -/-] %(addr) (%(dd_user)) {%(vars) vars in %(pktsize) bytes} [%(ctime)] %(method) %(uri) => generated %(rsize) bytes in %(msecs) msecs (%(proto) %(status)) %(headers) headers in %(hsize) bytes (%(switches) switches on core %(core))'
2424

25+
EXTRA_ARGS=""
26+
if [ -n "${DD_UWSGI_MAX_FD}" ]; then
27+
EXTRA_ARGS="${EXTRA_ARGS} --max-fd ${DD_UWSGI_MAX_FD}"
28+
fi
29+
2530
exec uwsgi \
2631
"--${DD_UWSGI_MODE}" "${DD_UWSGI_ENDPOINT}" \
2732
--protocol uwsgi \
@@ -31,5 +36,6 @@ exec uwsgi \
3136
--wsgi dojo.wsgi:application \
3237
--buffer-size="${DD_UWSGI_BUFFER_SIZE:-8192}" \
3338
--http 0.0.0.0:8081 --http-to "${DD_UWSGI_ENDPOINT}" \
34-
--logformat "${DD_UWSGI_LOGFORMAT:-$DD_UWSGI_LOGFORMAT_DEFAULT}"
39+
--logformat "${DD_UWSGI_LOGFORMAT:-$DD_UWSGI_LOGFORMAT_DEFAULT}" \
40+
$EXTRA_ARGS
3541
# HTTP endpoint is enabled for Kubernetes liveness checks. It should not be exposed as a service.

docs/content/en/usage/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ Custom reports, generated with the Report Builder, allow you to select specific
540540
5. Vulnerable Endpoints
541541
6. Page Breaks
542542

543-
DefectDojo's reports can be generated in HTML and AsciiDoc.
543+
DefectDojo's reports can be generated in HTML.
544544

545545
## Metrics
546546

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

dojo/api_v2/serializers.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,6 +2951,7 @@ class Meta:
29512951
def validate(self, data):
29522952
user = None
29532953
product = None
2954+
template = False
29542955

29552956
if self.instance is not None:
29562957
user = self.instance.user
@@ -2960,25 +2961,26 @@ def validate(self, data):
29602961
user = data.get("user")
29612962
if "product" in data:
29622963
product = data.get("product")
2964+
if "template" in data:
2965+
template = data.get("template")
29632966

2967+
if (
2968+
template
2969+
and Notifications.objects.filter(template=True).count() > 0
2970+
):
2971+
msg = "Notification template already exists"
2972+
raise ValidationError(msg)
29642973
if (
29652974
self.instance is None
29662975
or user != self.instance.user
29672976
or product != self.instance.product
29682977
):
29692978
notifications = Notifications.objects.filter(
2970-
user=user, product=product, template=False
2979+
user=user, product=product, template=template
29712980
).count()
29722981
if notifications > 0:
29732982
msg = "Notification for user and product already exists"
29742983
raise ValidationError(msg)
2975-
if (
2976-
data.get("template")
2977-
and Notifications.objects.filter(template=True).count() > 0
2978-
):
2979-
msg = "Notification template already exists"
2980-
raise ValidationError(msg)
2981-
29822984
return data
29832985

29842986

dojo/endpoint/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def endpoint_get_or_create(**kwargs):
7979
count = qs.count()
8080
if count == 0:
8181
return Endpoint.objects.get_or_create(**kwargs)
82+
elif count == 1:
83+
return qs.order_by("id").first(), False
8284
else:
8385
logger.warning(
8486
f"Endpoints in your database are broken. "

dojo/endpoint/views.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
calculate_grade,
2929
get_page_items,
3030
get_period_counts,
31+
get_setting,
3132
get_system_setting,
3233
is_scan_file_too_large,
3334
redirect,
@@ -223,9 +224,12 @@ def delete_endpoint(request, eid):
223224
extra_tags='alert-success')
224225
return HttpResponseRedirect(reverse('view_product', args=(product.id,)))
225226

226-
collector = NestedObjects(using=DEFAULT_DB_ALIAS)
227-
collector.collect([endpoint])
228-
rels = collector.nested()
227+
rels = ["Previewing the relationships has been disabled.", ""]
228+
display_preview = get_setting("DELETE_PREVIEW")
229+
if display_preview:
230+
collector = NestedObjects(using=DEFAULT_DB_ALIAS)
231+
collector.collect([endpoint])
232+
rels = collector.nested()
229233

230234
product_tab = Product_Tab(endpoint.product, "Delete Endpoint", tab="endpoints")
231235

dojo/finding/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,6 +2756,7 @@ def finding_bulk_update_all(request, pid=None):
27562756
)
27572757

27582758
finds = prefetch_for_findings(finds)
2759+
note = None
27592760
if form.cleaned_data["severity"] or form.cleaned_data["status"]:
27602761
for find in finds:
27612762
old_find = copy.deepcopy(find)
@@ -3083,6 +3084,8 @@ def finding_bulk_update_all(request, pid=None):
30833084
"pushing to jira from finding.finding_bulk_update_all()"
30843085
)
30853086
jira_helper.push_to_jira(finding)
3087+
if note is not None and isinstance(note, Notes):
3088+
jira_helper.add_comment(finding, note)
30863089
success_count += 1
30873090

30883091
for error_message, error_count in error_counts.items():

dojo/finding_group/views.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from dojo.finding.views import prefetch_for_findings
1717
from dojo.forms import DeleteFindingGroupForm, EditFindingGroupForm, FindingBulkUpdateForm
1818
from dojo.models import Engagement, Finding, Finding_Group, GITHUB_PKey, Product
19-
from dojo.utils import Product_Tab, add_breadcrumb, get_page_items, get_system_setting, get_words_for_field
19+
from dojo.utils import Product_Tab, add_breadcrumb, get_page_items, get_setting, get_system_setting, get_words_for_field
2020

2121
logger = logging.getLogger(__name__)
2222

@@ -121,9 +121,12 @@ def delete_finding_group(request, fgid):
121121
extra_tags='alert-success')
122122
return HttpResponseRedirect(reverse('view_test', args=(finding_group.test.id,)))
123123

124-
collector = NestedObjects(using=DEFAULT_DB_ALIAS)
125-
collector.collect([finding_group])
126-
rels = collector.nested()
124+
rels = ["Previewing the relationships has been disabled.", ""]
125+
display_preview = get_setting("DELETE_PREVIEW")
126+
if display_preview:
127+
collector = NestedObjects(using=DEFAULT_DB_ALIAS)
128+
collector.collect([finding_group])
129+
rels = collector.nested()
127130
product_tab = Product_Tab(finding_group.test.engagement.product, title="Product", tab="settings")
128131

129132
return render(request, 'dojo/delete_finding_group.html', {

0 commit comments

Comments
 (0)