Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ services:
- type: bind
source: ./docker/extra_settings
target: /app/docker/extra_settings

- "defectdojo_media:${DD_MEDIA_ROOT:-/app/media}"
celerybeat:
image: "defectdojo/defectdojo-django:${DJANGO_VERSION:-latest}"
Expand Down
2 changes: 1 addition & 1 deletion dojo/engagement/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def delete_engagement(request, eid):
messages.SUCCESS,
message,
extra_tags="alert-success")
return HttpResponseRedirect(reverse("view_engagements", args=(product.id, )))
return HttpResponseRedirect(reverse("view_product", args=(product.id, )))

rels = ["Previewing the relationships has been disabled.", ""]
display_preview = get_setting("DELETE_PREVIEW")
Expand Down
7 changes: 7 additions & 0 deletions dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,13 @@ def __str__(self):
def get_absolute_url(self):
return reverse("view_engagement", args=[str(self.id)])

@property
def engagement_id(self):
try:
return f"ENG-{self.id:03d}"
except Exception:
return str(self.id)

def copy(self):
copy = copy_model_util(self)
# Save the necessary ManyToMany relationships
Expand Down
4 changes: 4 additions & 0 deletions dojo/settings/settings.dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,10 @@ def saml2_attrib_map_format(din):
# Maximum size of a scan file in MB
SCAN_FILE_MAX_SIZE = env("DD_SCAN_FILE_MAX_SIZE")

# Engagement ID format
# Example: "ENG-{id:04d}"
ENGAGEMENT_ID_FORMAT = env("DD_ENGAGEMENT_ID_FORMAT", default="ENG-{id:04d}")

# Apply a severity level to "Security Weaknesses" in Qualys WAS
QUALYS_WAS_WEAKNESS_IS_VULN = env("DD_QUALYS_WAS_WEAKNESS_IS_VULN")

Expand Down
419 changes: 217 additions & 202 deletions dojo/templates/dojo/engagement.html

Large diffs are not rendered by default.

508 changes: 260 additions & 248 deletions dojo/templates/dojo/engagements_all.html

Large diffs are not rendered by default.

696 changes: 356 additions & 340 deletions dojo/templates/dojo/snippets/engagement_list.html

Large diffs are not rendered by default.

1,976 changes: 1,020 additions & 956 deletions dojo/templates/dojo/view_eng.html

Large diffs are not rendered by default.

94 changes: 48 additions & 46 deletions dojo/templates/dojo/view_engagements.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,61 @@
{% load display_tags %}
{% load static %}
{% block add_styles %}
{{ block.super }}
.tooltip-inner {
max-width: 350px;
}
{{ block.super }}
.tooltip-inner {
max-width: 350px;
}
{% endblock %}
{% block content %}
{{ block.super }}
<div class="row">
{% include "dojo/snippets/engagement_list.html" with engs=engs filter=engs_filter count=engs_count prefix="engs" status="open" type=engagement_type recent_test_day_count=recent_test_day_count %}
{% include "dojo/snippets/engagement_list.html" with engs=queued_engs filter=queued_engs_filter count=queued_engs_count prefix="queued_engs" status="paused" type=engagement_type recent_test_day_count=recent_test_day_count %}
{% include "dojo/snippets/engagement_list.html" with engs=inactive_engs filter=inactive_engs_filter count=inactive_engs_count prefix="inactive_engs" status="closed" type=engagement_type recent_test_day_count=recent_test_day_count %}
</div>
<div class="protip">
<i class="fa-solid fa-lightbulb"></i> <strong>ProTip!</strong> Type <kbd>a</kbd> to add a new engagement.
</div>
{{ block.super }}
<div class="row">
{% include "dojo/snippets/engagement_list.html" with engs=engs filter=engs_filter count=engs_count prefix="engs" status="open" type=engagement_type recent_test_day_count=recent_test_day_count %}
{% include "dojo/snippets/engagement_list.html" with engs=queued_engs filter=queued_engs_filter count=queued_engs_count prefix="queued_engs" status="paused" type=engagement_type recent_test_day_count=recent_test_day_count %}
{% include "dojo/snippets/engagement_list.html" with engs=inactive_engs filter=inactive_engs_filter count=inactive_engs_count prefix="inactive_engs" status="closed" type=engagement_type recent_test_day_count=recent_test_day_count %}
</div>
<div class="protip">
<i class="fa-solid fa-lightbulb"></i> <strong>ProTip!</strong> Type <kbd>a</kbd> to add a new engagement.
</div>
{% endblock %}
{% block postscript %}
{{ block.super }}
<script type="text/javascript" src="{% static "jquery-highlight/jquery.highlight.js" %}"></script>
<script type="text/javascript">
$(function () {
{{ block.super }}
<script type="text/javascript" src="{% static " jquery-highlight/jquery.highlight.js" %}"></script>
<script type="text/javascript">
$(function () {

document.addEventListener('keydown', function(e) {
// return immediately if any of the search box is in focus while doing the keypress
if (e.target.getAttribute('type') === 'search' || e.target.id === 'simple_search') {
return;
}
document.addEventListener('keydown', function (e) {
// return immediately if any of the search box is in focus while doing the keypress
if (e.target.getAttribute('type') === 'search' || e.target.id === 'simple_search') {
return;
}

if (e.key =='a') {
{% if engagement_type == "CI/CD" %}
window.location.assign('{% url 'new_eng_for_prod_cicd' prod.id %}');
{% else %}
window.location.assign('{% url 'new_eng_for_prod' prod.id %}');
{% endif %}
}
});
//Ensures dropdown has proper zindex
$('.table-responsive').on('show.bs.dropdown', function () {
$('.table-responsive').css( "overflow", "inherit" );
});
if (document.referrer.indexOf('simple_search') > 0) {
var terms = '';
if ($.cookie('highlight')) {
terms = $.cookie('highlight').split(' ');
if (e.key == 'a') {
var new_eng_url = "";
{% if engagement_type == "CI/CD" %}
new_eng_url = "{% url 'new_eng_for_prod_cicd' prod.id %}";
{% else %}
new_eng_url = "{% url 'new_eng_for_prod' prod.id %}";
{% endif %}
window.location.assign(new_eng_url);
}
});
//Ensures dropdown has proper zindex
$('.table-responsive').on('show.bs.dropdown', function () {
$('.table-responsive').css("overflow", "inherit");
});
if (document.referrer.indexOf('simple_search') > 0) {
var terms = '';
if ($.cookie('highlight')) {
terms = $.cookie('highlight').split(' ');

for (var i = 0; i < terms.length; i++) {
$('body').highlight(terms[i]);
}
for (var i = 0; i < terms.length; i++) {
$('body').highlight(terms[i]);
}

$('input#simple_search').val(terms);
}
});
</script>
{% include "dojo/filter_js_snippet.html" %}

$('input#simple_search').val(terms);
}
});
</script>
{% include "dojo/filter_js_snippet.html" %}
{% endblock %}
Loading