Skip to content

Commit 5731aed

Browse files
authored
Allow creating adversaries from layers without tactics. (#36)
This matches the layer format that can be downloaded from attack.mitre.org
1 parent 0ab1b94 commit 5731aed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/compass_svc.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ async def _build_adversary(self, adversary_techniques):
8888
atomic_order = []
8989
unmatched_techniques = []
9090
for technique_id, tactic in adversary_techniques:
91-
abilities = await self.data_svc.locate('abilities', match=dict(technique_id=technique_id,
92-
tactic=tactic))
91+
if tactic:
92+
abilities = await self.data_svc.locate('abilities', match=dict(technique_id=technique_id,
93+
tactic=tactic))
94+
else:
95+
abilities = await self.data_svc.locate('abilities', match=dict(technique_id=technique_id))
96+
9397
if not abilities:
9498
unmatched_techniques.append(dict(technique_id=technique_id, tactic=tactic))
9599
for ab in abilities:

0 commit comments

Comments
 (0)