Commit Graph

5068 Commits

Author SHA1 Message Date
VakarisZ d273e85858 Fixed bugs in argument parser passing default server config path even though server path is not specified. Island thinks that server config path was specified. 2021-05-24 17:09:14 +03:00
VakarisZ 2b257f0012 Fixed bugs merge bugs where structures are being accessed in an outdated ways 2021-05-24 16:44:43 +03:00
VakarisZ 0a7cf1d5ee Improved readability in the arg_parser.py by extracting defaults to the argparser flag section 2021-05-24 16:42:30 +03:00
VakarisZ 7d1c5dd908 Merged develop into data-dir-on-island-init 2021-05-24 16:00:21 +03:00
VakarisZ d8c1e2be9f
Merge pull request #1181 from guardicore/setup_param_refactoring
Setup param refactoring
2021-05-24 14:32:09 +03:00
VakarisZ 0248a6e281 Refactored IslandConfigOptions tests to be test per option, rather than based on code workflow branches 2021-05-24 14:25:22 +03:00
VakarisZ d52e80a3f3 Improved the readability IslandConfigOptions test 2021-05-24 14:03:49 +03:00
VakarisZ 2afdfa297b Improved IslandConfigOptions readability by removing defaults and added a unit test for constructor 2021-05-24 13:37:02 +03:00
Shreya Malviya f500ca8b06
Merge pull request #1184 from guardicore/data-dir-on-island-refactor
Data dir on island refactor
2021-05-24 15:24:21 +05:30
Shreya d33c5d68d8 Use `os.path.expandvars()` on server config argument 2021-05-24 15:17:22 +05:30
VakarisZ 3098ac1459 Fixed a failing environment setup in unit tests 2021-05-24 12:25:10 +03:00
VakarisZ 5f88f6f04b Moved a comment to a proper place 2021-05-24 12:13:33 +03:00
VakarisZ 0f49579148 Added typehints to IslandConfigOptions 2021-05-24 11:34:55 +03:00
VakarisZ 8afe93747f Improved monkey_island.py setup readability by extracting workflows of server_config setup by cmd_arguments and setup of server_config using defaults 2021-05-24 11:10:16 +03:00
VakarisZ 70b9a9f6b7 Refactored config_loader.py and server_config_handler.py into a single file, with server config write/read operations 2021-05-24 11:05:15 +03:00
Shreya 43d919a3eb Create default server_config.json when running unit tests 2021-05-21 20:09:17 +05:30
Shreya 23b04920b2 Remove unit test related to code removed in the previous commit 2021-05-21 19:18:08 +05:30
Shreya 9705c73978 Remove code in environment_config.py which was calling `write_default_server_config_to_file()`
This was causing an error in the unit tests, and is handled in monkey_island.py (commit 3de620e3).
2021-05-21 18:57:40 +05:30
VakarisZ 7b02cebbaf
Merge pull request #1180 from guardicore/bb_test_gcp_authentication_fix
BB tests: automatic registration
2021-05-21 13:14:16 +03:00
shreyamalviya b4708fc2cb Import Windows specific modules only on Windows systems 2021-05-21 14:56:14 +05:30
shreyamalviya 4640a760ff Update CHANGELOG (create data dir on island init) 2021-05-21 14:56:12 +05:30
shreyamalviya dc129c017b Fix unit test in test_consts.py 2021-05-21 14:55:04 +05:30
shreyamalviya 37b7815e00 Move `is_windows_os()` to separate file 2021-05-21 14:55:04 +05:30
shreyamalviya 2fb77fcb39 Get default directory depending on OS 2021-05-21 14:55:04 +05:30
VakarisZ 409a3c5234 Refactored code duplication by adding a parameter for create_data_dir 2021-05-21 14:55:04 +05:30
VakarisZ 8ce506ac6f Refactored windows permission handling into a separate file 2021-05-21 14:55:04 +05:30
shreyamalviya 8c575b9d35 Import Windows specific modules only on Windows 2021-05-21 14:55:04 +05:30
shreyamalviya e7a26aa2d1 Rename `set_data_dir_security_to_read_by_owner()` to
`set_data_dir_security_to_read_and_write_by_owner`
2021-05-21 14:55:04 +05:30
shreyamalviya 3201672248 Move `is_windows_os` to data_dir_generator.py and add user write
permissions to newly created data directory
2021-05-21 14:55:04 +05:30
shreyamalviya a1beee95f3 Change data_dir permissions on Windows 2021-05-21 14:55:04 +05:30
Shreya ff1e6bdb2c Remove logic for creating default server config in appimage script 2021-05-21 14:55:04 +05:30
Shreya af42c01aa9 Replace missed out function name 2021-05-21 14:55:04 +05:30
Shreya d8927a5c55 Create constant SERVER_CONFIG_FILENAME 2021-05-21 14:55:04 +05:30
Shreya 805e5e6c22 Restructure code for creating default data directory and server config 2021-05-21 14:55:04 +05:30
Shreya 9eedac4eb2 Move `create_data_dir()` from monkey_island.py to monkey_island/cc/setup.py 2021-05-21 14:55:04 +05:30
Shreya 808e86df1a Create data_dir before logger is set up 2021-05-21 14:55:04 +05:30
Shreya 82463416f8 Create data dir if `--server-config` is passed, "data_dir" field exists, but the dir doesn't exist 2021-05-21 14:55:04 +05:30
Shreya 76d82cecea Create `data_dir` if no `--server-config` is passed during Monkey Island initialisation 2021-05-21 14:55:04 +05:30
VakarisZ 66b3fb1d47 Added boilerplate methods for mongodb launch. 2021-05-21 12:10:24 +03:00
VakarisZ 2621458b37 Refactored tests to test config file parsing and IslandConfig param extraction 2021-05-21 11:49:33 +03:00
VakarisZ 9cffb9e9d1 Refactored `SetupParams` into IslandConfigOptions and altered setup workflow to use it 2021-05-21 11:26:02 +03:00
VakarisZ a17c01c7ee Improved readability in arg_parser.py 2021-05-21 11:20:54 +03:00
VakarisZ 49e63fcf1b Improve exception message, thrown when trying to establish connection to island in BB tests 2021-05-21 08:41:28 +03:00
VakarisZ cc365a74c5 Added a CHANGELOG.md entry about BB tests being able to self-register 2021-05-20 16:47:13 +03:00
VakarisZ af049b468b BB tests: removed island connectivity test. Now the connection is tested in fixture and if anything goes wrong tests are not launched 2021-05-20 16:47:00 +03:00
VakarisZ 488143b1d3 BB tests: added the ability for BB tests to "register". If they need registration to run monkeys, BB tests selects passwordless option 2021-05-20 16:47:00 +03:00
VakarisZ 6eb377858d Added unit test refactoring into the CHANGELOG.md 2021-05-20 17:39:00 +05:30
VakarisZ 411345d603 Refactored "main" method in island to use setup params 2021-05-20 14:02:47 +03:00
VakarisZ df5cec6323 Added a simple unit test for setup_param_factory.py 2021-05-20 13:55:51 +03:00
VakarisZ 9f469a8ec0 Added tests for refactored config file parser 2021-05-20 13:55:51 +03:00