Island: Remove get_config_{users,passwords} from reporting

This commit is contained in:
Ilija Lazoroski 2022-07-15 11:15:06 +02:00
parent 94419d8141
commit c75ee22c29
1 changed files with 0 additions and 32 deletions

View File

@ -4,7 +4,6 @@ import logging
from itertools import chain, product from itertools import chain, product
from typing import List from typing import List
from common.credentials import CredentialComponentType
from common.network.network_range import NetworkRange from common.network.network_range import NetworkRange
from common.network.segmentation_utils import get_ip_in_src_and_not_in_dst from common.network.segmentation_utils import get_ip_in_src_and_not_in_dst
from monkey_island.cc.database import mongo from monkey_island.cc.database import mongo
@ -375,37 +374,6 @@ class ReportService:
def get_manual_monkey_hostnames(): def get_manual_monkey_hostnames():
return [monkey["hostname"] for monkey in get_manual_monkeys()] return [monkey["hostname"] for monkey in get_manual_monkeys()]
@classmethod
def get_config_users(cls):
usernames = []
configured_credentials = cls._credentials_repository.get_configured_credentials()
for credentials in configured_credentials:
usernames = chain(
usernames,
(
identity
for identity in credentials.identities
if identity.credential_type == CredentialComponentType.USERNAME
),
)
return [u.username for u in usernames]
@classmethod
def get_config_passwords(cls):
passwords = []
configured_credentials = cls._credentials_repository.get_configured_credentials()
for credentials in configured_credentials:
passwords = chain(
passwords,
(
secret
for secret in credentials.secrets
if secret.credential_type == CredentialComponentType.PASSWORD
),
)
return [p.password for p in passwords]
@classmethod @classmethod
def get_config_exploits(cls): def get_config_exploits(cls):
agent_configuration = cls._agent_configuration_repository.get_configuration() agent_configuration = cls._agent_configuration_repository.get_configuration()