Island: Add comments in services and models
These comments explain/elaborate on changes needed for DAL implementation
This commit is contained in:
parent
4bbd998197
commit
3b0ec975d2
|
@ -1,6 +1,7 @@
|
|||
from mongoengine import Document, FloatField
|
||||
|
||||
|
||||
# TODO rename to Simulation, add other metadata
|
||||
class AgentControls(Document):
|
||||
|
||||
# Timestamp of the last "kill all agents" command
|
||||
|
|
|
@ -32,6 +32,8 @@ def get_report() -> dict:
|
|||
return _decode_dot_char_before_mongo_insert(decrypt_dict(sensitive_fields, report_dict))
|
||||
|
||||
|
||||
# TODO remove this unnecessary encoding. I think these are legacy methods from back in the day
|
||||
# when usernames were used as keys. If not, we shouldn't use unknown data as keys.
|
||||
def _encode_dot_char_before_mongo_insert(report_dict):
|
||||
"""
|
||||
mongodb doesn't allow for '.' and '$' in a key's name, this function replaces the '.'
|
||||
|
|
|
@ -7,6 +7,7 @@ from mongoengine import Document, EmbeddedDocumentListField
|
|||
from monkey_island.cc.models.zero_trust.event import Event
|
||||
|
||||
|
||||
# TODO just move events to the finding and remove this collection
|
||||
class MonkeyFindingDetails(Document):
|
||||
# SCHEMA
|
||||
events = EmbeddedDocumentListField(document_type=Event, required=False)
|
||||
|
|
|
@ -15,6 +15,7 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def set_stop_all(time: float):
|
||||
# This will use Agent and Simulation repositories
|
||||
for monkey in Monkey.objects():
|
||||
monkey.config.should_stop = True
|
||||
monkey.save()
|
||||
|
|
Loading…
Reference in New Issue