Island: Remove from_credentials in StolenCredentials model

This commit is contained in:
Ilija Lazoroski 2022-07-11 17:22:55 +02:00
parent e5702032d9
commit 2ad2d94746
1 changed files with 0 additions and 10 deletions

View File

@ -3,7 +3,6 @@ from __future__ import annotations
from mongoengine import Document, ListField, ReferenceField
from monkey_island.cc.models import Monkey
from monkey_island.cc.services.telemetry.processing.credentials import Credentials
class StolenCredentials(Document):
@ -20,12 +19,3 @@ class StolenCredentials(Document):
monkey = ReferenceField(Monkey)
identities = ListField()
secrets = ListField()
@staticmethod
def from_credentials(credentials: Credentials) -> StolenCredentials:
stolen_creds = StolenCredentials()
stolen_creds.secrets = [secret["credential_type"] for secret in credentials.secrets]
stolen_creds.identities = credentials.identities
stolen_creds.monkey = Monkey.get_single_monkey_by_guid(credentials.monkey_guid).id
return stolen_creds