From ced7097b95cdca08718aa20de69462bbb5261c56 Mon Sep 17 00:00:00 2001 From: Thorsten Sick Date: Fri, 10 Sep 2021 10:03:44 +0200 Subject: [PATCH] small cleanups --- Makefile | 2 +- app/attack_log.py | 1 - app/calderacontrol.py | 22 +++++++++++----------- doc_generator.py | 9 ++++----- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 53014cd..8387a85 100644 --- a/Makefile +++ b/Makefile @@ -19,4 +19,4 @@ pylint: pylint --rcfile=pylint.rc *.py app/*.py plugins/base/*.py mypy: - mypy app/ \ No newline at end of file + mypy --strict-optional app/ \ No newline at end of file diff --git a/app/attack_log.py b/app/attack_log.py index ec4b61e..9aface4 100644 --- a/app/attack_log.py +++ b/app/attack_log.py @@ -572,7 +572,6 @@ class AttackLog(): if "result" in entry: replace_entry["result"] = entry["result"] - def get_dict(self): """ Return logged data in dict format """ diff --git a/app/calderacontrol.py b/app/calderacontrol.py index a1d80a2..b904e58 100644 --- a/app/calderacontrol.py +++ b/app/calderacontrol.py @@ -626,16 +626,16 @@ class CalderaControl(): adid = self.get_adversary(adversary_name)["adversary_id"] logid = self.attack_logger.start_caldera_attack(source=self.url, - paw=paw, - group=group, - ability_id=ability_id, - ttp=self.get_ability(ability_id)[0]["technique_id"], - name=self.get_ability(ability_id)[0]["name"], - description=self.get_ability(ability_id)[0]["description"], - obfuscator=obfuscator, - jitter=jitter, - **kwargs - ) + paw=paw, + group=group, + ability_id=ability_id, + ttp=self.get_ability(ability_id)[0]["technique_id"], + name=self.get_ability(ability_id)[0]["name"], + description=self.get_ability(ability_id)[0]["description"], + obfuscator=obfuscator, + jitter=jitter, + **kwargs + ) # ##### Create / Run Operation @@ -682,7 +682,7 @@ class CalderaControl(): except CalderaError: pass - outp="" + outp = "" if output is None: outp = str(self.get_operation_by_id(opid)) diff --git a/doc_generator.py b/doc_generator.py index 4be9895..1709548 100755 --- a/doc_generator.py +++ b/doc_generator.py @@ -35,11 +35,10 @@ if __name__ == "__main__": # generate("loot/2021_08_30___14_40_23/attack.json", # "tools/human_readable_documentation/contents.rst") # FIN 7 With genereated files added - # generate("removeme/loot/2021_09_07___08_59_42/attack.json", - # "tools/human_readable_documentation/source/contents.rst") # FIN 7 first run on environment - generate("loot/2021_09_07___16_20_48/attack.json", - "tools/human_readable_documentation/source/contents.rst") # FIN 7 locally with extended data (older: loot/2021_09_07___14_38_14) - + generate("removeme/loot/2021_09_08___07_41_35/attack.json", + "tools/human_readable_documentation/source/contents.rst") # FIN 7 first run on environment + # generate("loot/2021_09_07___16_20_48/attack.json", + # "tools/human_readable_documentation/source/contents.rst") # FIN 7 locally with extended data (older: loot/2021_09_07___14_38_14) # generate("loot/2021_07_19___15_10_45/attack.json", "tools/human_readable_documentation/contents.rst") # generate("removeme.json", "tools/human_readable_documentation/contents.rst")