From 889863bb9311cfb3856b6e5a9bc986f1a897c754 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Thu, 11 Aug 2022 16:49:09 +0200 Subject: [PATCH 1/4] Common: Define StolenCredentialsEvent --- .../common/events/stolen_credentials_event.py | 18 ++++++++++++++++++ vulture_allowlist.py | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 monkey/common/events/stolen_credentials_event.py diff --git a/monkey/common/events/stolen_credentials_event.py b/monkey/common/events/stolen_credentials_event.py new file mode 100644 index 000000000..c9a03505a --- /dev/null +++ b/monkey/common/events/stolen_credentials_event.py @@ -0,0 +1,18 @@ +from dataclasses import dataclass +from typing import Sequence + +from common.credentials import Credentials + +from . import AbstractEvent + + +@dataclass(frozen=True) +class StolenCredentialsEvent(AbstractEvent): + """ + An event that was initiated/observed when an agent collects credentials from the victim. + + Attributes: + :param stolen_credentials: The credentials which were stolen by the source agent + """ + + stolen_credentials: Sequence[Credentials] diff --git a/vulture_allowlist.py b/vulture_allowlist.py index 29359dfe9..565cc258a 100644 --- a/vulture_allowlist.py +++ b/vulture_allowlist.py @@ -214,6 +214,9 @@ _make_simulation # unused method (monkey/monkey_island/cc/models/simulation.py: AbstractEvent tags +# TODO DELETE IN #2176 +StolenCredentialsEvent + # TODO DELETE AFTER RESOURCE REFACTORING From f06d53368a6817511f7cfe0ab942945d15b3aaca Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Thu, 11 Aug 2022 16:50:40 +0200 Subject: [PATCH 2/4] Common: Export StolenCredentialsEvent from __init__ --- monkey/common/events/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/monkey/common/events/__init__.py b/monkey/common/events/__init__.py index 65d39de0e..c271af898 100644 --- a/monkey/common/events/__init__.py +++ b/monkey/common/events/__init__.py @@ -1 +1,2 @@ from .abstract_event import AbstractEvent +from .stolen_credentials_event import StolenCredentialsEvent From 743d40ababc765a3ce1087444790d548e254544d Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Fri, 12 Aug 2022 09:39:04 +0200 Subject: [PATCH 3/4] Common: Rename StolenCredentialsEvent to CredentialsStolenEvent --- monkey/common/events/__init__.py | 2 +- ...olen_credentials_event.py => credentials_stolen_events.py} | 4 ++-- vulture_allowlist.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename monkey/common/events/{stolen_credentials_event.py => credentials_stolen_events.py} (70%) diff --git a/monkey/common/events/__init__.py b/monkey/common/events/__init__.py index c271af898..da5b88234 100644 --- a/monkey/common/events/__init__.py +++ b/monkey/common/events/__init__.py @@ -1,2 +1,2 @@ from .abstract_event import AbstractEvent -from .stolen_credentials_event import StolenCredentialsEvent +from .credentials_stolen_events import CredentialsStolenEvent diff --git a/monkey/common/events/stolen_credentials_event.py b/monkey/common/events/credentials_stolen_events.py similarity index 70% rename from monkey/common/events/stolen_credentials_event.py rename to monkey/common/events/credentials_stolen_events.py index c9a03505a..f5b47506c 100644 --- a/monkey/common/events/stolen_credentials_event.py +++ b/monkey/common/events/credentials_stolen_events.py @@ -7,9 +7,9 @@ from . import AbstractEvent @dataclass(frozen=True) -class StolenCredentialsEvent(AbstractEvent): +class CredentialsStolenEvent(AbstractEvent): """ - An event that was initiated/observed when an agent collects credentials from the victim. + An event that occurs when an agent collects credentials from the victim Attributes: :param stolen_credentials: The credentials which were stolen by the source agent diff --git a/vulture_allowlist.py b/vulture_allowlist.py index 565cc258a..7c5f67804 100644 --- a/vulture_allowlist.py +++ b/vulture_allowlist.py @@ -215,7 +215,7 @@ AbstractEvent tags # TODO DELETE IN #2176 -StolenCredentialsEvent +CredentialsStolenEvent # TODO DELETE AFTER RESOURCE REFACTORING From b0b0874be953701eca01171a80225018dd36f586 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 12 Aug 2022 06:47:08 -0400 Subject: [PATCH 4/4] Common: Modify stolen_credentials description in docstring --- monkey/common/events/credentials_stolen_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/common/events/credentials_stolen_events.py b/monkey/common/events/credentials_stolen_events.py index f5b47506c..f1db1c142 100644 --- a/monkey/common/events/credentials_stolen_events.py +++ b/monkey/common/events/credentials_stolen_events.py @@ -12,7 +12,7 @@ class CredentialsStolenEvent(AbstractEvent): An event that occurs when an agent collects credentials from the victim Attributes: - :param stolen_credentials: The credentials which were stolen by the source agent + :param stolen_credentials: The credentials that were stolen by an agent """ stolen_credentials: Sequence[Credentials]