Skip to content

Commit aaacdb7

Browse files
committed
refactor(core_functions): Update technique info generation
Update generate_technique_info func Rearrage info card generation Update technique not info display Update technique reference info display
1 parent dc197fe commit aaacdb7

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

core/Functions.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,26 @@ def create_azure_trm_info_cards(azure_trm_techniques):
5757
# Get technique information from technique registry
5858
technique = TechniqueRegistry.get_technique(technique_id)()
5959
technique_category = TechniqueRegistry.get_technique_category(technique_id)
60-
60+
6161
# Main technique information card
6262
main_info_card = dbc.Card([
6363
dbc.CardHeader(html.H4(f"Technique: {technique.name}", className="mb-0")),
6464

6565
dbc.CardBody([
6666
html.H5(f"Attack Surface: {technique_category}", className="mb-3"),
6767
html.H5("Technique Description:", className="mb-2"),
68-
html.P(technique.description, className="mb-3"),
69-
html.H5("MITRE ATT&CK Reference:", className="mb-2"),
70-
create_mitre_info_cards(technique.mitre_techniques)
68+
html.P(technique.description, className="mb-3")
7169
])
7270
], className="mb-3")
7371

7472
modal_content = [main_info_card]
7573

74+
modal_content.append(
75+
dbc.Accordion([
76+
dbc.AccordionItem(create_mitre_info_cards(technique.mitre_techniques), title="MITRE ATT&CK Reference")
77+
], start_collapsed=False, className="mb-3")
78+
)
79+
7680
# Display Azure threat research matrix info - only for Azure techniques
7781
if technique_category == "azure":
7882
if technique.azure_trm_techniques:
@@ -81,24 +85,28 @@ def create_azure_trm_info_cards(azure_trm_techniques):
8185
dbc.AccordionItem(create_azure_trm_info_cards(technique.azure_trm_techniques), title="Azure Threat Research Matrix Reference")
8286
], start_collapsed=True, className="mb-3")
8387
)
88+
89+
# Technique notes
90+
if technique.notes:
91+
modal_content.append(
92+
dbc.Accordion([
93+
dbc.AccordionItem(
94+
[html.Li(note.note) for note in technique.notes],
95+
title="Technique Notes"
96+
)
97+
], start_collapsed=True, className="mb-3")
98+
)
99+
84100
# Technique references
85101
if technique.references:
86102
modal_content.append(
87103
dbc.Accordion([
88104
dbc.AccordionItem(
89-
[dcc.Link("Visit Ref", href=ref if ref not in [None, "#"] else "#", target="_blank", className="card-link") for ref in technique.references],
105+
[html.Li(dcc.Link(ref.title, href=ref.link if ref.link not in [None, "#"] else "#", target="_blank", className="card-link")) for ref in technique.references],
90106
title="Technique References"
91107
)
92108
], start_collapsed=True, className="mb-3")
93109
)
94-
95-
# Technique notes
96-
if technique.notes:
97-
modal_content.append(
98-
dbc.Accordion([
99-
dbc.AccordionItem(technique.notes, title="Technique Notes")
100-
], start_collapsed=True, className="mb-3")
101-
)
102110

103111
# Return final modal body content
104112
return modal_content

0 commit comments

Comments
 (0)