Commit Graph

4856 Commits

Author SHA1 Message Date
Mike Salvatore b5e8d895c8 cc: use data_dir when running monkey agent locally from island 2021-03-31 08:27:41 -04:00
Mike Salvatore e1209dcb4c cc: add data_dir_abs_path property to EnvironmentConfig
EnvironmentConfig needs to handle environment variables and '~' in its
`data_dir` property. Other components that consume `data_dir` need
environment variables and '~' resolved to an absolute path. Add a
property called `data_dir_abs_path` that calculates the absolute path
from `data_dir`. Since `data_dir` remains unchanged, the
EnvironmentConfig can be saved to file without modifying the `data_dir`
option in the file.
2021-03-31 08:27:41 -04:00
Mike Salvatore 20a3d31852 build: add data_dir to standard server config in appimage build 2021-03-31 08:27:41 -04:00
Mike Salvatore 29c9c72ef3 cc: rename server_config_data_dir.json -> server_config_with_data_dir.json 2021-03-31 08:27:41 -04:00
Mike Salvatore 45367bb051 cc: add encrypt/decrypt test 2021-03-31 08:27:41 -04:00
Mike Salvatore fdeec3a634 cc: rename data_dir parameter in encryptor to password_file_dir 2021-03-31 08:27:41 -04:00
Mike Salvatore 115368f83d cc: rename DATA_DIR constant in test to WITH_DATA_DIR 2021-03-31 08:27:41 -04:00
Mike Salvatore 044c656543 cc: rename encryptor() -> get_encryptor() 2021-03-31 08:27:41 -04:00
Mike Salvatore a09cd8f497 cc: expanduser in data_dir path in Encryptor 2021-03-31 08:09:32 -04:00
Mike Salvatore d265238107 cc: format encryptor.py with black 2021-03-31 08:09:32 -04:00
Mike Salvatore 3f6c268f40 cc: allow encryptor to store key file in variable locations 2021-03-31 08:09:32 -04:00
Mike Salvatore 438a2701d4 cc: add `data_dir` property to EnvironmentConfig 2021-03-31 07:50:12 -04:00
Mike Salvatore 2d971d95fc build: select server and logger config at runtime in appimage 2021-03-31 07:37:49 -04:00
VakarisZ 64018eb373 Extracted home environment mocking into a reusable fixture and added a todo, to move it to our fixture list 2021-03-31 07:37:49 -04:00
VakarisZ ef1ef3475b Extracted island argument parsing into a separate file 2021-03-31 07:37:49 -04:00
Mike Salvatore 21e0b5170b cc: explicitly cast tmpdir to str in test_island_logger.py 2021-03-31 07:37:49 -04:00
Mike Salvatore 1f57610005 monkey_island.py: Add TODO to refactor argument handling 2021-03-31 07:37:49 -04:00
Mike Salvatore e6bf085d12 address some flake8 errors 2021-03-31 07:37:49 -04:00
Mike Salvatore 5b781c50a4 cc: rename DEFAULT_LOGGING_CONFIG_PATH -> DEFAULT_LOGGER_CONFIG_PATH 2021-03-31 07:37:49 -04:00
Mike Salvatore 74e0dfddc5 cc: expand "~" in log file configuration 2021-03-31 07:37:49 -04:00
Mike Salvatore 8b3703816d run black to format monkey_island.py 2021-03-31 07:37:49 -04:00
Mike Salvatore e8bb2e6be2 cc: allow logger config to be specified at runtime 2021-03-31 07:37:49 -04:00
Mike Salvatore 4cb28db3bc cc: reformat island_logger.py for readability
1. Adjusted some spacing and indentation
2. Reformatted with Black
2021-03-31 07:36:07 -04:00
Mike Salvatore fef44bcd05 cc: deploy "develop" environment by default 2021-03-31 07:36:07 -04:00
Mike Salvatore fc2f8eca45 cc: remove unnecessary private constants in consts.py 2021-03-31 07:33:47 -04:00
Mike Salvatore ea14bcc2f6 cc: rename DEFAULT_STANDARD_SERVER_CONFIG -> DEFAULT_STANDARD_SERVER_CONFIG_PATH 2021-03-31 07:33:47 -04:00
Mike Salvatore dd9e4bdefa cc: address flake8 issues 2021-03-31 07:32:55 -04:00
Mike Salvatore a057dec1fe cc: use DEFAULT_SERVER_CONFIG_PATH in set_server_config 2021-03-31 07:27:25 -04:00
Mike Salvatore 98b64da896 cc: simplify constructor/factory interface for EnvironmentConfig
The `get_from_json()` and `get_from_dict()` static methods were really
just used for testing. The `EnvironmentConfig` class needs to store its
file path so it can wite to the file if needed. In practical usage,
`EnvironmentConfig` objects are initialized from files, so a simpler
interface is for its constructor to take a file path.
2021-03-31 07:27:25 -04:00
Shreya Malviya c7b3fa67fd
Update Docker docs (#1065)
* Add troubleshooting section to docker setup docs
2021-03-31 07:10:36 -04:00
VakarisZ 54f1d0e49c Made naming of issue methods in UI more consistent 2021-03-31 13:07:19 +03:00
Shreya edb669d00e Pass tests 2021-03-31 15:23:04 +05:30
Shreya 9e3c3c13e4 Merge remote-tracking branch 'upstream/develop' into postgresql-fp 2021-03-31 15:00:30 +05:30
Shreya 0b65a07ec4 Format everything with black 2021-03-31 14:50:48 +05:30
Shreya b0f85f6857 Rewrite tests with pytest 2021-03-31 14:48:13 +05:30
VakarisZ a284467a1a Improved UI by creating distinct functions related to immediate threats report component 2021-03-31 11:55:22 +03:00
VakarisZ 05fda70cd6 Fixed SSH exploiter's report section in UI 2021-03-31 11:54:20 +03:00
VakarisZ e96b8eec38 Refactored zerologon exploiters report part to conform to new report structure 2021-03-31 11:53:50 +03:00
VakarisZ c504b21d33 Fixed trivial bugs like missing imports in issue UI files 2021-03-31 11:50:53 +03:00
Shreya 165b0df195 Testing changes 2021-03-31 13:01:18 +05:30
Shreya 91b858e162 Handle the case where the postgres connection is successful 2021-03-31 12:13:49 +05:30
Mike Salvatore 4b5415ac0b cc: fix server_config_generator behavior 2021-03-30 19:17:30 -04:00
Mike Salvatore 986219bd86 cc: rework EnvironmentConfig test
1. Rewrote in pytest
2. Removed reduntant tests
3. Added tests for add_user() and get_users()
2021-03-30 19:17:30 -04:00
Mike Salvatore 1d73f6e860 cc: move DEFAULT_SERVER_CONFIG_PATH to consts.py 2021-03-30 16:39:07 -04:00
Mike Salvatore 0230c26f19 cc: allow server_config.json to be specified at runtime 2021-03-30 16:34:29 -04:00
Mike Salvatore 12c40c3968 build: scripts for building MonkeyIsland as an appimage
Adds the basic scripts for generating an AppImage. Code changes are
required to allow Monkey Island to operate on a read-only filesystem.
2021-03-30 16:22:30 -04:00
Mike Salvatore 176ad01c14 Merge branch 'release/1.10.0' into develop 2021-03-30 15:59:20 -04:00
Shreya ab33db650f Add timeout to PostgreSQL connection and other testing changes 2021-03-30 17:48:20 +05:30
Shreya 13d03abd37 CR changes 2021-03-30 17:32:21 +05:30
VakarisZ 2b3351baec Created immediate threat counter 2021-03-30 13:00:47 +03:00