-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecf5eba
commit 40809bc
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import pytest | ||
|
||
|
||
@pytest.mark.parametrize("target_attribute", ["enterprise"]) | ||
def test_campaigns(attck_fixture, target_attribute): | ||
""" | ||
All MITRE ATT&CK Frameworks Campaigns should have tools | ||
Args: | ||
attck_fixture ([type]): our default MITRE ATT&CK JSON fixture | ||
""" | ||
campaign_list = set() | ||
for campaign in getattr(attck_fixture, target_attribute).campaigns: | ||
if campaign.name not in campaign_list: | ||
campaign_list.add(campaign.name) | ||
else: | ||
assert False | ||
assert True | ||
|
||
|
||
@pytest.mark.parametrize("target_attribute", ["enterprise"]) | ||
def test_campaigns_have_malwares(attck_fixture, target_attribute): | ||
""" | ||
All MITRE ATT&CK Framework Campaigns should have malwares | ||
Args: | ||
attck_fixture ([type]): our default MITRE ATT&CK JSON fixture | ||
""" | ||
for campaign in getattr(attck_fixture, target_attribute).campaigns: | ||
if campaign.malwares: | ||
assert getattr(campaign, "malwares") | ||
|
||
|
||
@pytest.mark.parametrize("target_attribute", ["enterprise", "mobile", "preattack"]) | ||
def test_campaigns_have_techniques(attck_fixture, target_attribute): | ||
""" | ||
All MITRE ATT&CK Campaigns should have techniques | ||
Args: | ||
attck_fixture ([type]): our default MITRE ATT&CK JSON fixture | ||
""" | ||
for campaign in getattr(attck_fixture, target_attribute).campaigns: | ||
if campaign.techniques: | ||
assert getattr(campaign, "techniques") |