diff --git a/monkey/infection_monkey/post_breach/actions/modify_shell_startup_files.py b/monkey/infection_monkey/post_breach/actions/modify_shell_startup_files.py index 932007252..5e8208c96 100644 --- a/monkey/infection_monkey/post_breach/actions/modify_shell_startup_files.py +++ b/monkey/infection_monkey/post_breach/actions/modify_shell_startup_files.py @@ -53,7 +53,9 @@ class ModifyShellStartupFiles(PBA): def run(self): if self.command: try: - output = subprocess.check_output(self.command, stderr=subprocess.STDOUT, shell=True).decode() + output = subprocess.check_output(self.command, # noqa: DUO116 + stderr=subprocess.STDOUT, + shell=True).decode() return output, True except subprocess.CalledProcessError as e: # Return error output of the command diff --git a/monkey/monkey_island/cc/services/attack/technique_reports/T1156.py b/monkey/monkey_island/cc/services/attack/technique_reports/T1156.py index a379c3907..a9c0ea338 100644 --- a/monkey/monkey_island/cc/services/attack/technique_reports/T1156.py +++ b/monkey/monkey_island/cc/services/attack/technique_reports/T1156.py @@ -20,8 +20,8 @@ class T1156(AttackTechnique): 'ips': [{'$arrayElemAt': ['$data.ip', 0]}]}, 'result': '$data.result'}}, {'$unwind': '$result'}, - {'$match': {'$or': [{'result': {'$regex': '\.bash'}}, - {'result': {'$regex': '\.profile'}}]}}] + {'$match': {'$or': [{'result': {'$regex': '\.bash'}}, # noqa: W605 + {'result': {'$regex': '\.profile'}}]}}] # noqa: W605 @staticmethod def get_report_data(): diff --git a/monkey/monkey_island/cc/services/attack/technique_reports/T1504.py b/monkey/monkey_island/cc/services/attack/technique_reports/T1504.py index b1013085e..7bfda1d8e 100644 --- a/monkey/monkey_island/cc/services/attack/technique_reports/T1504.py +++ b/monkey/monkey_island/cc/services/attack/technique_reports/T1504.py @@ -20,7 +20,7 @@ class T1504(AttackTechnique): 'ips': [{'$arrayElemAt': ['$data.ip', 0]}]}, 'result': '$data.result'}}, {'$unwind': '$result'}, - {'$match': {'result': {'$regex': 'profile\.ps1'}}}] + {'$match': {'result': {'$regex': 'profile\.ps1'}}}] # noqa: W605 @staticmethod def get_report_data(): diff --git a/monkey/monkey_island/cc/services/attack/technique_reports/technique_report_tools.py b/monkey/monkey_island/cc/services/attack/technique_reports/technique_report_tools.py index 44b2fdd82..80bfb952d 100644 --- a/monkey/monkey_island/cc/services/attack/technique_reports/technique_report_tools.py +++ b/monkey/monkey_island/cc/services/attack/technique_reports/technique_report_tools.py @@ -1,4 +1,3 @@ -from common.utils.attack_utils import ScanStatus from monkey_island.cc.encryptor import encryptor