From a84c91739a37a72eb3320857c952e31d35a4eea1 Mon Sep 17 00:00:00 2001 From: Charissa Miller <48832936+clemiller@users.noreply.github.com> Date: Thu, 19 Oct 2023 09:27:37 -0400 Subject: [PATCH] formatting --- mitreattack/stix20/MitreAttackData.py | 14 ++++++-------- mitreattack/stix20/custom_attack_objects.py | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mitreattack/stix20/MitreAttackData.py b/mitreattack/stix20/MitreAttackData.py index 09dfca91..f04901fd 100644 --- a/mitreattack/stix20/MitreAttackData.py +++ b/mitreattack/stix20/MitreAttackData.py @@ -23,7 +23,7 @@ class MitreAttackData: "x-mitre-tactic", "x-mitre-data-source", "x-mitre-data-component", - "x-mitre-asset" + "x-mitre-asset", ] # software:group @@ -267,7 +267,7 @@ def get_campaigns(self, remove_revoked_deprecated=False) -> list: a list of Campaign objects """ return self.get_objects_by_type("campaign", remove_revoked_deprecated) - + def get_assets(self, remove_revoked_deprecated=False) -> list: """Retrieve all asset objects. @@ -1715,7 +1715,9 @@ def get_all_techniques_targeting_all_assets(self) -> dict: if self.all_techniques_targeting_all_assets: return self.all_techniques_targeting_all_assets - self.all_techniques_targeting_all_assets = self.get_related("attack-pattern", "targets", "x-mitre-asset", reverse=True) + self.all_techniques_targeting_all_assets = self.get_related( + "attack-pattern", "targets", "x-mitre-asset", reverse=True + ) return self.all_techniques_targeting_all_assets @@ -1733,11 +1735,7 @@ def get_techniques_targeting_asset(self, asset_stix_id: str) -> list: a list of {"object": AttackPattern, "relationships": Relationship[]} for each technique targeting the asset """ techniques_targeting_assets = self.get_all_techniques_targeting_all_assets() - return ( - techniques_targeting_assets[asset_stix_id] - if asset_stix_id in techniques_targeting_assets - else [] - ) + return techniques_targeting_assets[asset_stix_id] if asset_stix_id in techniques_targeting_assets else [] def get_all_assets_targeted_by_all_techniques(self) -> dict: """Get all assets targeted by all techniques. diff --git a/mitreattack/stix20/custom_attack_objects.py b/mitreattack/stix20/custom_attack_objects.py index 51fd64f4..27bba253 100644 --- a/mitreattack/stix20/custom_attack_objects.py +++ b/mitreattack/stix20/custom_attack_objects.py @@ -9,7 +9,7 @@ ReferenceProperty, TimestampProperty, BooleanProperty, - DictionaryProperty + DictionaryProperty, ) @@ -220,7 +220,7 @@ class DataComponent(CustomStixObject, object): ("sectors", ListProperty(StringProperty())), ("x_mitre_related_assets", ListProperty(DictionaryProperty())), ("x_mitre_platforms", ListProperty(StringProperty())), - ] + ], ) class Asset(CustomStixObject, object): """Custom Asset object of type stix2.CustomObject.