Skip to content

Commit 21f2f90

Browse files
author
idavila
committed
Merge branch 'feature/#288-tactic-links' into release/website-v3.3.0
2 parents 42b4c50 + 82a81a1 commit 21f2f90

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

modules/techniques/techniques.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,13 @@ def generate_data_for_md(technique_dict, technique, tactic_list, is_sub_techniqu
235235
if technique.get('kill_chain_phases'):
236236
technique_dict['tactics'] = []
237237
for elem in technique['kill_chain_phases']:
238-
technique_dict['tactics'].append(elem['phase_name'].title().replace('-', ' '))
238+
# Get tactic from tactic_list
239+
tactic = [x for x in tactic_list if x['x_mitre_shortname'] == elem['phase_name']][0]
240+
tactic_info = {
241+
"name" : tactic['name'],
242+
"id" : util.buildhelpers.get_attack_id(tactic)
243+
}
244+
technique_dict['tactics'].append(tactic_info)
239245

240246
# Get platforms that technique uses
241247
if technique.get('x_mitre_platforms'):

modules/techniques/templates/technique.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ <h5 class="mb-0" id ="sub-techniques">Sub-techniques ({{parsed.subtechniques|len
184184
<div class="col-md-11 pl-0">
185185
<span class="h5 card-title">{{"Tactic" if parsed.tactics | length < 2 else "Tactics"}}:</span>
186186
{% for tactic in parsed.tactics %}
187-
{{tactic}}{% if not loop.last %},{% endif %}
187+
<a href="/tactics/{{tactic.id}}">{{tactic.name}}</a>{% if not loop.last %},{% endif %}
188188
{% endfor %}
189189
</div>
190190
</div>

0 commit comments

Comments
 (0)