Merge pull request #733 from guardicore/feature/pba_linux_bugfixes

Removed unused imports and improved logging in PBA
This commit is contained in:
VakarisZ 2020-07-24 11:24:19 +03:00 committed by GitHub
commit 53707436df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,6 @@ from common.data.post_breach_consts import POST_BREACH_SETUID_SETGID
from infection_monkey.post_breach.pba import PBA
from infection_monkey.post_breach.setuid_setgid.setuid_setgid import \
get_commands_to_change_setuid_setgid
from infection_monkey.utils.environment import is_windows_os
class ChangeSetuidSetgid(PBA):

View File

@ -2,7 +2,6 @@ from common.data.post_breach_consts import POST_BREACH_TRAP_COMMAND
from infection_monkey.post_breach.pba import PBA
from infection_monkey.post_breach.trap_command.trap_command import \
get_trap_commands
from infection_monkey.utils.environment import is_windows_os
class TrapCommand(PBA):

View File

@ -62,8 +62,10 @@ class PBA(Plugin):
exec_funct = self._execute_default
result = exec_funct()
if self.scripts_were_used_successfully(result):
T1064Telem(ScanStatus.USED, "Scripts were used to execute %s post breach action." % self.name).send()
T1064Telem(ScanStatus.USED, f"Scripts were used to execute {self.name} post breach action.").send()
PostBreachTelem(self, result).send()
else:
LOG.debug(f"No command available for PBA '{self.name}' on current OS, skipping.")
def is_script(self):
"""