Skip to content

Commit 781c3d2

Browse files
author
Marc Schlaeppi
committed
Promote tested TST Milkdown, collaboration, and MFA changes
2 parents e5ac686 + 91bce72 commit 781c3d2

64 files changed

Lines changed: 1783 additions & 1050 deletions

Some content is hidden

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

docker/nginx/entrypoint.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,18 @@ if [ -n "${SERVER_NAME:-}" ]; then
4646
export SERVER_NAME
4747
fi
4848

49+
# The /collab/ location resolves its upstream at request time so nginx
50+
# doesn't refuse to start when the (optional) collab service is absent.
51+
# The resolver address is container-runtime-specific: Docker's embedded
52+
# DNS is always 127.0.0.11, but podman/netavark's aardvark-dns listens on
53+
# the network gateway instead. Read the real nameserver out of this
54+
# container's own /etc/resolv.conf so both runtimes work.
55+
DNS_RESOLVER=$(awk '/^nameserver/{print $2; exit}' /etc/resolv.conf)
56+
export DNS_RESOLVER="${DNS_RESOLVER:-127.0.0.11}"
57+
4958
# envsubst will make a substitution on every $variable in a file, since the nginx file contains nginx variable like $host, we have to limit the substitution to this set
5059
# otherwise, each nginx variable will be replaced by an empty string
51-
envsubst '${INTERFACE_HTTPS_PORT} ${IRIS_UPSTREAM_SERVER} ${IRIS_UPSTREAM_PORT} ${SERVER_NAME} ${KEY_FILENAME} ${CERT_FILENAME} ${IRIS_FRONTEND_SERVER} ${IRIS_FRONTEND_PORT}' < /etc/nginx/nginx.conf > /tmp/nginx.conf
60+
envsubst '${INTERFACE_HTTPS_PORT} ${IRIS_UPSTREAM_SERVER} ${IRIS_UPSTREAM_PORT} ${SERVER_NAME} ${KEY_FILENAME} ${CERT_FILENAME} ${IRIS_FRONTEND_SERVER} ${IRIS_FRONTEND_PORT} ${DNS_RESOLVER}' < /etc/nginx/nginx.conf > /tmp/nginx.conf
5261
cp /tmp/nginx.conf /etc/nginx/nginx.conf
5362
rm /tmp/nginx.conf
5463

docker/nginx/nginx.conf

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,21 @@ http {
155155
}
156156

157157
location /collab/ {
158-
# Resolve at request time (Docker's embedded DNS) instead of at
159-
# nginx startup: the collab service is a BV-only optional
160-
# feature and isn't present in every compose stack (e.g. the
161-
# upstream-derived dev/CI stack). A static proxy_pass hostname
162-
# would make nginx refuse to start entirely when "collab" can't
163-
# be resolved; this way only /collab/ requests fail if it's absent.
164-
resolver 127.0.0.11 valid=30s;
158+
# Resolve at request time (the container's own DNS resolver)
159+
# instead of at nginx startup: the collab service is a BV-only
160+
# optional feature and isn't present in every compose stack (e.g.
161+
# the upstream-derived dev/CI stack). A static proxy_pass
162+
# hostname would make nginx refuse to start entirely when
163+
# "collab" can't be resolved; this way only /collab/ requests
164+
# fail if it's absent.
165+
#
166+
# ${DNS_RESOLVER} is templated by entrypoint.sh from the
167+
# container's /etc/resolv.conf. It is NOT hardcoded to Docker's
168+
# embedded-DNS address (127.0.0.11) because that address doesn't
169+
# exist under podman/netavark, where aardvark-dns listens on the
170+
# network gateway instead — a hardcoded 127.0.0.11 here silently
171+
# 502s every /collab/ request after a 30s resolver timeout.
172+
resolver ${DNS_RESOLVER} valid=30s;
165173
set $collab_upstream collab;
166174

167175
proxy_set_header Host $http_host;

e2e/tests/administrator/case/ioc.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ test.beforeEach(async({ page }) => {
1313

1414
test('should be able to update IOC', async ({ page }) => {
1515
const iocValue = `IOC value - ${crypto.randomUUID()}`;
16+
const iocDescription = `IOC description - ${crypto.randomUUID()}`;
1617

1718
await page.getByRole('button', { name: 'Add IOC' }).click();
1819
await page.getByRole('button', { name: 'None' }).click();
1920
await page.getByRole('listbox').getByRole('option', { name: 'AS', exact: true }).click();
2021
await page.getByLabel('IOC Value *').fill(iocValue);
22+
await page.locator('#ioc_description .ProseMirror').fill(iocDescription);
2123
await page.getByRole('button', { name: 'Save' }).click();
2224

2325
await page.getByRole('link', { name: iocValue }).click();
26+
await expect(page.locator('#ioc_description .ProseMirror')).toContainText(iocDescription);
2427
const newIocValue = `IOC value - ${crypto.randomUUID()}`;
2528
await page.getByLabel('IOC Value *').fill(newIocValue);
2629
await page.getByRole('button', { name: 'Update' }).click();
@@ -89,4 +92,4 @@ test('should be able to update IOC custom attribute', async ({ page, rest }) =>
8992
partial_overwrite: false
9093
}
9194
})
92-
});
95+
});

source/app/blueprints/access_controls.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,17 @@ def wrap(*args, **kwargs):
413413
return redirect(not_authenticated_redirection_url(request.full_path))
414414

415415
chan_id = args[0].get('channel')
416-
if chan_id:
416+
if not chan_id:
417+
return _ac_return_access_denied(caseid=0)
418+
419+
# Clients occasionally join a room before a case is selected
420+
# (e.g. `case-null`), producing a non-numeric id. That's not an
421+
# authorization bypass attempt, just a premature join - deny
422+
# gracefully instead of raising and killing the socketio
423+
# event-handler thread.
424+
try:
417425
case_id = int(chan_id.replace('case-', '').split('-')[0])
418-
else:
426+
except ValueError:
419427
return _ac_return_access_denied(caseid=0)
420428

421429
access = ac_fast_check_user_has_case_access(iris_current_user.id, case_id, access_level)

source/app/blueprints/pages/case/templates/case.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<link rel="stylesheet" href="/static/assets/css/select2.css">
55
<link rel="stylesheet" href="/static/assets/css/bootstrap-multiselect.min.css">
66
<link rel="stylesheet" href="/static/assets/css/bootstrap-select.min.css">
7-
<link rel="stylesheet" href="/static/assets/css/milkdown_editor.css">
87
{% endblock stylesheets %}
98
{% block content %}
109
{% if current_user.is_authenticated %}

source/app/blueprints/pages/case/templates/case_assets.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{% extends "layouts/default_ext.html" %} {% block title %} Case Assets {% endblock title %} {% block stylesheets %}
22
{% include 'includes/header_case.html' %}
33
<link rel="stylesheet" href="/static/assets/css/bootstrap-select.min.css">
4-
<link rel="stylesheet" href="/static/assets/css/milkdown_editor.css">
54
{% endblock stylesheets %}
65
{% block content %}
76
{% include 'includes/navigation_ext.html' %}
@@ -148,4 +147,4 @@ <h5>Upload assets list (CSV format)</h5>
148147
<script type="module" src="/static/assets/js/iris/milkdown_editor.js"></script>
149148
<script type="module" src="/static/assets/js/iris/milkdown_split.js"></script>
150149

151-
{% endblock javascripts %}
150+
{% endblock javascripts %}

source/app/blueprints/pages/case/templates/case_notes_v2.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{% extends "layouts/default_ext.html" %} {% block title %} Case notes {% endblock title %} {% block stylesheets %}
22
{% include 'includes/header_case.html' %}
33
<link rel="stylesheet" href="/static/assets/css/bootstrap-select.min.css">
4-
<link rel="stylesheet" href="/static/assets/css/milkdown_editor.css">
54
{% endblock stylesheets %}
65
{% block content %}
76
{% include 'includes/navigation_ext.html' %}
@@ -88,7 +87,7 @@ <h4 class="page-title mb-0" id="currentNoteTitle"></h4>
8887
<i class="fa-brands fa-markdown mr-2"></i>
8988
</span>
9089
</button>
91-
<button type="button" class="btn bg-transparent btn-xs" onclick="download_note();return false;" title="Download as MD">
90+
<button type="button" class="btn bg-transparent btn-xs" onclick="download_note();return false;" title="Export note as Markdown" aria-label="Export note as Markdown">
9291
<span class="btn-label">
9392
<i class="fa-solid fa-download mr-2"></i>
9493
</span>
@@ -98,13 +97,6 @@ <h4 class="page-title mb-0" id="currentNoteTitle"></h4>
9897
<i class="fa-solid fa-trash mr-2 text-danger"></i>
9998
</span>
10099
</button>
101-
<div class="dropdown">
102-
<button class="btn bg-transparent" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
103-
<span aria-hidden="true"><i class="fas fa-ellipsis-v"></i></span>
104-
</button>
105-
<div class="dropdown-menu pull-right" id="note_quick_actions" aria-labelledby="dropdownMenuButton">
106-
</div>
107-
</div>
108100
</div>
109101
</div>
110102
</div>

source/app/blueprints/pages/case/templates/modal_add_case_event.html

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,7 @@ <h4 class="modal-title mr-4">{% if event.event_id %} Event ID #{{ event.event_i
7979
<div class="row">
8080
<div class="form-group mt-3 col-12">
8181
<label for="event_content" class="placeholder">Event description</label>
82-
<div class="md_description_field">
83-
<div class="form-group mt--2">
84-
<button type="button" class="float-right icon-note btn btn-circle btn-sm mt-2" onclick="edit_in_event_desc();" >
85-
</button>
86-
<button type="button" style="display: none;" class="btn btn-dark btn-sm float-right mr-2 mt-2"
87-
onclick="preview_event_description();" id="event_preview_button"><i class="fa-solid fa-eye"></i></button>
88-
</div>
89-
<div class="row">
90-
<div class="col mb--2 ml--2" id="event_edition_btn" style="display:none;">
91-
</div>
92-
</div>
93-
<div class="row" style="margin-left:0px;">
94-
<div class="col-12" id="container_event_desc_content">
95-
<div id="event_description" contenteditable="true" spellcheck="true" class="mr-2" data-theme="{% if current_user.in_dark_mode %}dark{% else %}light{% endif %}">{% if event.event_content %}{{ event.event_content }}{% endif %}</div>
96-
<textarea id="event_desc_content" rows="10" cols="82" style="display: none"></textarea>
97-
</div>
98-
<div class="col-12" id="container_event_description" style="display:none">
99-
<div id="target_event_desc"></div>
100-
</div>
101-
</div>
82+
<div id="event_description" contenteditable="true" spellcheck="true" data-theme="{% if current_user.in_dark_mode %}dark{% else %}light{% endif %}">{% if event.event_content %}{{ event.event_content }}{% endif %}</div>
10283
</div>
10384
</div>
10485
</div>
@@ -326,4 +307,4 @@ <h4 class="modal-title mr-4">{% if event.event_id %} Event ID #{{ event.event_i
326307
]);
327308
$('#event_iocs').trigger('change');
328309
</script>
329-
{% endif %}
310+
{% endif %}

source/app/blueprints/pages/case/templates/modal_add_case_ioc.html

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,7 @@ <h4 class="modal-title mr-4">{% if ioc.ioc_id %}Edit IOC #{{ ioc.ioc_id }}{% els
7272
{% endif %}
7373
<div class="form-group mt-3">
7474
<label for="ioc_description" class="placeholder">Description</label>
75-
<div class="md_description_field">
76-
<div class="form-group mt--2">
77-
<button type="button" class="float-right icon-note btn btn-circle btn-sm mt-2" onclick="edit_in_ioc_desc();">
78-
</button>
79-
<button type="button" style="display: none;" class="btn btn-dark btn-sm float-right mr-2 mt-2"
80-
onclick="preview_ioc_description();" id="ioc_preview_button"><i class="fa-solid fa-eye"></i></button>
81-
</div>
82-
<div class="row">
83-
<div class="col mb--2 ml--2" id="ioc_edition_btn" style="display:none;">
84-
</div>
85-
</div>
86-
<div class="row" style="margin-left:0px;">
87-
<div class="col-12" id="container_ioc_desc_content">
88-
<div id="ioc_description" contenteditable="true" spellcheck="true" class="mr-2" data-theme="{% if current_user.in_dark_mode %}dark{% else %}light{% endif %}">{% if ioc and ioc.ioc_description %}{{ ioc.ioc_description }}{% endif %}</div>
89-
<textarea id="ioc_desc_content" rows="10" cols="82" style="display: none"></textarea>
90-
</div>
91-
<div class="col-12" id="container_ioc_description" style="display:none">
92-
<div id="target_ioc_desc"></div>
93-
</div>
94-
</div>
75+
<div id="ioc_description" contenteditable="true" spellcheck="true" data-theme="{% if current_user.in_dark_mode %}dark{% else %}light{% endif %}">{% if ioc and ioc.ioc_description %}{{ ioc.ioc_description }}{% endif %}</div>
9576
</div>
9677
</div>
9778
<div class="form-group">
@@ -144,4 +125,4 @@ <h4 class="modal-title mr-4">{% if ioc.ioc_id %}Edit IOC #{{ ioc.ioc_id }}{% els
144125
{% else %}
145126
$('#ioc_tlp_id').selectpicker('val', '2');
146127
{% endif %}
147-
</script>
128+
</script>

source/app/blueprints/pages/case/templates/modal_add_case_rfile.html

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,7 @@ <h4 class="modal-title mr-4">{% if rfile.id %}Edit evidence #{{rfile.id}}{% else
100100

101101
<div class="form-group">
102102
<label for="rfile_desc" class="placeholder">Description</label>
103-
<div class="md_description_field">
104-
<div class="form-group mt--2">
105-
<button type="button" class="float-right icon-note btn btn-circle btn-sm mt-2" onclick="edit_in_evidence_desc();" >
106-
</button>
107-
<button type="button" style="display: none;" class="btn btn-dark btn-sm float-right mr-2 mt-2"
108-
onclick="preview_evidence_description();" id="evidence_preview_button"><i class="fa-solid fa-eye"></i></button>
109-
</div>
110-
<div class="row">
111-
<div class="col mb--2 ml--2" id="evidence_edition_btn" style="display:none;">
112-
</div>
113-
</div>
114-
<div class="row" style="margin-left:0px;">
115-
<div class="col-12" id="container_evidence_desc_content">
116-
<div id="evidence_description" contenteditable="true" spellcheck="true" class="mr-2" data-theme="{% if current_user.in_dark_mode %}dark{% else %}light{% endif %}">{% if rfile %}{{ rfile.file_description }}{% endif %}</div>
117-
<textarea id="evidence_desc_content" rows="10" cols="82" style="display: none"></textarea>
118-
</div>
119-
<div class="col-12" id="container_evidence_description" style="display:none">
120-
<div id="target_evidence_desc"></div>
121-
</div>
122-
</div>
103+
<div id="evidence_description" contenteditable="true" spellcheck="true" data-theme="{% if current_user.in_dark_mode %}dark{% else %}light{% endif %}">{% if rfile %}{{ rfile.file_description }}{% endif %}</div>
123104
</div>
124105
</div>
125106
<div class="form-group">
@@ -142,4 +123,4 @@ <h4 class="modal-title mr-4">{% if rfile.id %}Edit evidence #{{rfile.id}}{% else
142123
<button type="button" class="btn btn-outline-success float-right" onclick="add_rfile();">Register</button>
143124
{% endif %}
144125
</div>
145-
</div>
126+
</div>

0 commit comments

Comments
 (0)