Merge pull request #890 from guardicore/custom_pba_bugfix

Fixed custom post breach action path bug.
This commit is contained in:
VakarisZ 2020-12-17 14:14:23 +02:00 committed by GitHub
commit 99d73be0d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import flask_restful
from flask import send_from_directory
from monkey_island.cc.services.post_breach_files import UPLOADS_DIR
from monkey_island.cc.services.post_breach_files import UPLOADS_DIR_NAME
__author__ = 'VakarisZ'
@ -13,4 +13,4 @@ class PBAFileDownload(flask_restful.Resource):
# Used by monkey. can't secure.
def get(self, path):
return send_from_directory(UPLOADS_DIR, path)
return send_from_directory(UPLOADS_DIR_NAME, path)

View File

@ -11,7 +11,8 @@ logger = logging.getLogger(__name__)
# Where to find file names in config
PBA_WINDOWS_FILENAME_PATH = ['monkey', 'post_breach', 'PBA_windows_filename']
PBA_LINUX_FILENAME_PATH = ['monkey', 'post_breach', 'PBA_linux_filename']
PBA_UPLOAD_PATH = ['monkey_island', 'cc', 'userUploads']
UPLOADS_DIR_NAME = 'userUploads'
PBA_UPLOAD_PATH = ['monkey_island', 'cc', UPLOADS_DIR_NAME]
UPLOADS_DIR = Path(*PBA_UPLOAD_PATH)