Skip to content

Commit a5714cd

Browse files
authored
Merge pull request #3149 from DefectDojo/release/1.9.1
Release/1.9.1
2 parents 00cbdda + 43d00de commit a5714cd

File tree

7 files changed

+38
-13
lines changed

7 files changed

+38
-13
lines changed

dojo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
default_app_config = 'dojo.apps.DojoAppConfig'
88

9-
__version__ = '1.9.0'
9+
__version__ = '1.9.1'
1010
__url__ = 'https://github.com/DefectDojo/django-DefectDojo'
1111
__docs__ = 'http://defectdojo.readthedocs.io/'

dojo/filters.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ class ComponentFilter(ProductComponentFilter):
297297
queryset=Product_Type.objects.all().order_by('name'),
298298
label="Product Type")
299299

300+
300301
class EngagementFilter(DojoFilter):
301302
engagement__lead = ModelChoiceFilter(
302303
queryset=User.objects.filter(
@@ -536,7 +537,7 @@ class ApiFindingFilter(DojoFilter):
536537
class Meta:
537538
model = Finding
538539
exclude = ['url', 'is_template', 'thread_id', 'notes', 'images',
539-
'sourcefile', 'line']
540+
'sourcefile', 'line', 'endpoint_status']
540541

541542

542543
class OpenFindingFilter(DojoFilter):
@@ -589,7 +590,7 @@ class Meta:
589590
'endpoint', 'references', 'test', 'is_template',
590591
'thread_id', 'notes', 'scanner_confidence', 'mitigated',
591592
'numerical_severity', 'reporter', 'last_reviewed', 'line',
592-
'duplicate_finding', 'hash_code', 'images',
593+
'duplicate_finding', 'hash_code', 'images', 'endpoint_status',
593594
'line_number', 'reviewers', 'mitigated_by', 'sourcefile', 'jira_creation', 'jira_change', 'created']
594595

595596
def __init__(self, *args, **kwargs):
@@ -687,7 +688,7 @@ class Meta:
687688
'endpoint', 'references', 'test', 'is_template',
688689
'active', 'verified', 'out_of_scope', 'false_p',
689690
'duplicate', 'thread_id', 'date', 'notes',
690-
'numerical_severity', 'reporter', 'endpoints',
691+
'numerical_severity', 'reporter', 'endpoints', 'endpoint_status',
691692
'last_reviewed', 'review_requested_by', 'defect_review_requested_by',
692693
'last_reviewed_by', 'created', 'jira_creation', 'jira_change']
693694

@@ -754,7 +755,7 @@ class Meta:
754755
'endpoint', 'references', 'test', 'is_template',
755756
'active', 'verified', 'out_of_scope', 'false_p',
756757
'duplicate', 'thread_id', 'mitigated', 'notes',
757-
'numerical_severity', 'reporter', 'endpoints',
758+
'numerical_severity', 'reporter', 'endpoints', 'endpoint_status',
758759
'last_reviewed', 'o', 'jira_creation', 'jira_change']
759760

760761
def __init__(self, *args, **kwargs):
@@ -815,7 +816,7 @@ class Meta:
815816
'endpoint', 'references', 'test', 'is_template',
816817
'active', 'verified', 'out_of_scope', 'false_p',
817818
'duplicate_finding', 'thread_id', 'mitigated', 'notes',
818-
'numerical_severity', 'reporter', 'endpoints',
819+
'numerical_severity', 'reporter', 'endpoints', 'endpoint_status',
819820
'last_reviewed', 'jira_creation', 'jira_change']
820821

821822
def __init__(self, *args, **kwargs):
@@ -1052,6 +1053,7 @@ class Meta:
10521053
'last_reviewed_by',
10531054
'images',
10541055
'endpoints',
1056+
'endpoint_status',
10551057
'is_template',
10561058
'jira_creation',
10571059
'jira_change']
@@ -1123,6 +1125,7 @@ class Meta:
11231125
'last_reviewed_by',
11241126
'images',
11251127
'endpoints',
1128+
'endpoint_status',
11261129
'is_template',
11271130
'jira_creation',
11281131
'jira_change']
@@ -1215,7 +1218,7 @@ class Meta:
12151218
model = Finding
12161219
exclude = ['date', 'cwe', 'url', 'description', 'mitigation', 'impact',
12171220
'endpoint', 'references', 'test', 'is_template',
1218-
'thread_id', 'notes', 'endpoints',
1221+
'thread_id', 'notes', 'endpoints', 'endpoint_status',
12191222
'numerical_severity', 'reporter', 'last_reviewed', 'images', 'jira_creation', 'jira_change']
12201223

12211224

@@ -1264,7 +1267,7 @@ class Meta:
12641267
model = Finding
12651268
exclude = ['date', 'cwe', 'url', 'description', 'mitigation', 'impact',
12661269
'endpoint', 'references', 'test', 'is_template',
1267-
'thread_id', 'notes', 'endpoints',
1270+
'thread_id', 'notes', 'endpoints', 'endpoint_status',
12681271
'numerical_severity', 'reporter', 'last_reviewed', 'jira_creation', 'jira_change']
12691272

12701273

dojo/product_type/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ def add_product_type(request):
8787
@user_passes_test(lambda u: u.is_staff)
8888
def edit_product_type(request, ptid):
8989
pt = get_object_or_404(Product_Type, pk=ptid)
90-
pt_form = Product_TypeForm(instance=pt)
90+
authed_users = pt.authorized_users.all()
91+
pt_form = Product_TypeForm(instance=pt, initial={'authorized_users': authed_users})
9192
delete_pt_form = Delete_Product_TypeForm(instance=pt)
9293
if request.method == "POST" and request.POST.get('edit_product_type'):
9394
pt_form = Product_TypeForm(request.POST, instance=pt)
9495
if pt_form.is_valid():
9596
pt = pt_form.save()
97+
pt.authorized_users.set(pt_form.cleaned_data['authorized_users'])
9698
messages.add_message(
9799
request,
98100
messages.SUCCESS,

dojo/test/views.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,14 @@ def add_findings(request, tid):
360360
# always false now since this will be deprecated soon in favor of new Finding_Template model
361361
new_finding.is_template = False
362362
new_finding.save(dedupe_option=False, push_to_jira=False)
363-
new_finding.endpoints.set(form.cleaned_data['endpoints'])
363+
for ep in form.cleaned_data['endpoints']:
364+
eps, created = Endpoint_Status.objects.get_or_create(
365+
finding=new_finding,
366+
endpoint=ep)
367+
ep.endpoint_status.add(eps)
368+
369+
new_finding.endpoints.add(ep)
370+
new_finding.endpoint_status.add(eps)
364371

365372
# Push to jira?
366373
push_to_jira = False
@@ -514,7 +521,14 @@ def add_temp_finding(request, tid, fid):
514521
# no further action needed here since this is already adding from template.
515522
new_finding.is_template = False
516523
new_finding.save(dedupe_option=False, false_history=False)
517-
new_finding.endpoints.set(form.cleaned_data['endpoints'])
524+
for ep in form.cleaned_data['endpoints']:
525+
eps, created = Endpoint_Status.objects.get_or_create(
526+
finding=new_finding,
527+
endpoint=ep)
528+
ep.endpoint_status.add(eps)
529+
530+
new_finding.endpoints.add(ep)
531+
new_finding.endpoint_status.add(eps)
518532
new_finding.save(false_history=True)
519533
tags = request.POST.getlist('tags')
520534
t = ", ".join('"{0}"'.format(w) for w in tags)

dojo/user/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,12 @@ def edit_user(request, uid):
310310

311311
if form.is_valid() and contact_form.is_valid():
312312
form.save()
313+
for init_auth_prods in authed_products:
314+
init_auth_prods.authorized_users.remove(user)
315+
init_auth_prods.save()
316+
for init_auth_prod_types in authed_product_types:
317+
init_auth_prod_types.authorized_users.remove(user)
318+
init_auth_prod_types.save()
313319
if 'authorized_products' in form.cleaned_data and len(form.cleaned_data['authorized_products']) > 0:
314320
for p in form.cleaned_data['authorized_products']:
315321
p.authorized_users.add(user)

helm/defectdojo/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
2-
appVersion: "1.9.0"
2+
appVersion: "1.9.1"
33
description: A Helm chart for Kubernetes to installs DefectDojo
44
name: defectdojo
55
version: 1.4.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name='DefectDojo',
7-
version='1.9.0',
7+
version='1.9.1',
88
author='Greg Anderson',
99
description="Tool for managing vulnerability engagements",
1010
install_requires=[

0 commit comments

Comments
 (0)