Skip to content

Commit d63a2dc

Browse files
committed
feat: add description to detection strategy table
1 parent f431815 commit d63a2dc

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

attack-theme/templates/macros/detection_strategies_table.html

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,31 @@
77
<tr>
88
<th class="p-2" scope="col">ID</th>
99
<th class="p-2 nowrap" scope="col">Name</th>
10-
<th class="p-2 nowrap" scope="col">Analytics</th>
10+
<th class="p-2 nowrap" scope="col">Analytic ID</th>
11+
<th class="p-2 nowrap" scope="col">Analytic Description</th>
1112
</tr>
1213
</thead>
1314
<tbody>
1415
{% for detection_strategy in detection_strategies %}
15-
<tr class="detection_strategy" id="uses-{{detection_strategy.id}}">
16-
<td>
17-
<a href="/detectionstrategies/{{detection_strategy.id}}">{{detection_strategy.id}}</a>
18-
</td>
19-
<td class="nowrap">
20-
<a href="/detectionstrategies/{{detection_strategy.id}}">{{detection_strategy.name}}</a>
21-
</td>
22-
<td>
23-
{% if detection_strategy.analytics %}
24-
<ul class="list-unstyled mb-0">
25-
{% for analytic in detection_strategy.analytics %}
26-
<li>
27-
<a href="/analytics/{{analytic.id}}">{{ analytic.id }}</a>
28-
</li>
29-
{% endfor %}
30-
</ul>
31-
{% else %}
32-
<span class="text-muted">None</span>
16+
{% set rowspan = analytics|length if analytics else 1 %}
17+
{% for analytic in detection_strategy.analytics %}
18+
<tr class="detection_strategy" id="uses-{{detection_strategy.id}}">
19+
{% if loop.first %}
20+
<td rowspan="{{ rowspan }}">
21+
<a href="/detectionstrategies/{{detection_strategy.id}}">{{detection_strategy.id}}</a>
22+
</td>
23+
<td class="nowrap" rowspan="{{ rowspan }}">
24+
<a href="/detectionstrategies/{{detection_strategy.id}}">{{detection_strategy.name}}</a>
25+
</td>
3326
{% endif %}
34-
</td>
35-
</tr>
27+
<td>
28+
<a href="/analytics/{{ analytic.id }}">{{ analytic.id }}</a>
29+
</td>
30+
<td>
31+
{{ analytic.description }}</a>
32+
</td>
33+
</tr>
34+
{% endfor %}
3635
{% endfor %}
3736
</tbody>
3837
</table>

modules/techniques/techniques.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def get_assets_table_data(technique, reference_list):
416416
def get_analytic_list(analytics):
417417
analytics_list = []
418418
for keys, values in analytics.items():
419-
analytics_list.append({'id': values["external_references"][0]["external_id"]})
419+
analytics_list.append({'id': values["external_references"][0]["external_id"], 'description': values['description']})
420420
return analytics_list
421421

422422
def get_detection_strategies_table_data(technique, reference_list):

0 commit comments

Comments
 (0)