Remove database initialization during island startup

Database initialization can not be done because island doesn't know the key needed for encrypting collections. Since the key only appears after registration, database setup also should happen only after registration
This commit is contained in:
VakarisZ 2021-10-04 14:23:50 +03:00
parent a2b09a9e7a
commit 3b5dd6ac3e
2 changed files with 0 additions and 7 deletions

View File

@ -54,7 +54,6 @@ from monkey_island.cc.resources.zero_trust.scoutsuite_auth.scoutsuite_auth impor
from monkey_island.cc.resources.zero_trust.zero_trust_report import ZeroTrustReport
from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH
from monkey_island.cc.server_utils.custom_json_encoder import CustomJSONEncoder
from monkey_island.cc.services.database import Database
from monkey_island.cc.services.remote_run_aws import RemoteRunAwsService
from monkey_island.cc.services.representations import output_json
@ -108,7 +107,6 @@ def init_app_services(app):
with app.app_context():
database.init()
Database.init_db()
# If running on AWS, this will initialize the instance data, which is used "later" in the
# execution of the island.

View File

@ -33,11 +33,6 @@ class Database(object):
mongo.db[collection_name].drop()
logger.info("Dropped collection {}".format(collection_name))
@staticmethod
def init_db():
if not mongo.db.collection_names():
Database.reset_db()
@staticmethod
def is_mitigations_missing() -> bool:
return bool(AttackMitigations.COLLECTION_NAME not in mongo.db.list_collection_names())