Commit Graph

2877 Commits

Author SHA1 Message Date
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 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
VakarisZ 8c210fc21f Improved setup_param_factory.py further, by extracting loading server config file out of the factory 2021-05-20 13:55:51 +03:00
VakarisZ 9055381873 Moved island setup param related code into cc/setup folder 2021-05-20 13:55:51 +03:00
VakarisZ d768d60f9f Extracted island setup parameter extraction into a separate workflow/DTO 2021-05-20 13:55:51 +03:00
VakarisZ 8bb6e2f21f Added mongodb parameters to appimage server config and develop server config 2021-05-20 13:55:51 +03:00
VakarisZ e97882369c Added init files to test directories so that conftest files could import fixtures 2021-05-20 10:30:10 +03:00
VakarisZ 0ab91ef27d Altered mongomock fixture to be a module-scoped, in an attempt to fix fixture import error 2021-05-20 10:22:20 +03:00
VakarisZ 99bbe36c62 Moved a unit test into unit_tests folder 2021-05-20 09:58:58 +03:00
VakarisZ 30008d47a8 Created a separate directory for unit tests and moved them into that directory 2021-05-19 09:42:15 +03:00
VakarisZ 4f25e1b6c8 Refactored to use fixtures without enum, to be consistent with other UT code 2021-05-19 09:42:15 +03:00
VakarisZ c85ac0f610 Moved unit test files and profiling test decorator into test directory away from production code 2021-05-19 09:42:15 +03:00
VakarisZ 832453fdb5
Merge pull request #1177 from guardicore/unit_test_fixture_refactoring
Unit test fixture refactoring
2021-05-19 09:38:17 +03:00
VakarisZ 8bbf4bae36 Renamed mock_data_dir to data_for_tests 2021-05-19 09:27:26 +03:00
VakarisZ 8b438b3a75 Improved tests of environment config: file saving tests no longer coupled with file contents 2021-05-18 15:40:53 +03:00
VakarisZ a4a0aba0fe Refactored UT's fixtures to be on separate files and renamed folders/fixture to be more precise 2021-05-18 15:39:42 +03:00
VakarisZ 58b04ecb91 Added unit test of random password generator 2021-05-18 10:03:59 +03:00
Shreya fc82b2a9dc Replace "remote_user_pwd" with "random_password" 2021-05-17 22:51:14 +05:30
Shreya 636a201d19 Set default password length to 32 in `get_random_password()` 2021-05-17 22:48:01 +05:30
Shreya 51b996ce18 Generate password randomly when creating a new user for Create User PBA and exploit MS08_67 using https://docs.python.org/3.7/library/secrets.html#secrets.token_urlsafe 2021-05-17 19:10:40 +05:30
Mike Salvatore 3205d8344c Merge branch 'environment-config-section' into develop 2021-05-13 08:02:55 -04:00
Mike Salvatore f0bd6e10d3 island: Remove duplicate deployment from server_config.json.develop 2021-05-13 07:59:32 -04:00
VakarisZ c40465d6fd
Merge pull request #1160 from guardicore/no-global-data-dir
No global data dir
2021-05-13 13:02:54 +03:00
Mike Salvatore b8d4452e70 island: Rename RunLocalMonkeyService -> LocalMonkeyRunService 2021-05-12 12:09:46 -04:00
Mike Salvatore 79eb7442ae island: Move the specifics of saving pba files to pba service 2021-05-12 11:53:10 -04:00
Mike Salvatore 253588b3ac island: Move PBA filename paths to config_value_paths.py 2021-05-12 11:53:07 -04:00
Mike Salvatore 2485c85d59 island: Don't use `shell=True` when running local monkey 2021-05-12 08:42:12 -04:00
Mike Salvatore f86bc7f943 island: Move run_local_monkey() to its own service 2021-05-12 08:35:46 -04:00
Mike Salvatore db14285934 island: Add `dir_is_empty()` to clarify intent of `test_remove_pba_files()` 2021-05-12 08:10:01 -04:00
Mike Salvatore e3449d17c7 Remove file that was accidentally added 2021-05-12 08:07:04 -04:00
Mike Salvatore 2d422f157e island: Add `umask 377` to create_certificate.sh
By setting the umask to 377 in create_certificate.sh, we ensure that the
TLS key file that is created is readable only by the user that created
it, and not world readable (as is the default on some linux distros).
2021-05-11 19:22:43 -04:00
Mike Salvatore b4dfba294b island: Pass data_dir to main() 2021-05-11 14:56:50 -04:00
Mike Salvatore c832738a8a island: Remove all references to data_dir in EnvironmentConfig 2021-05-11 14:41:00 -04:00
Mike Salvatore fb3e66f75e island: Add "environment" section to server_config.json
Put the environment config inside its own "environment" object in the
server_config.json to provide a logical separation between the
environment config, logger config, data directory, etc.
2021-05-11 14:41:00 -04:00
Mike Salvatore 9476441526 island: Remove circular dep btw ConfigService and PostBreachFilesService 2021-05-11 14:40:53 -04:00
Mike Salvatore ea82e86df5 island: Add tests for PostBreachFilesService 2021-05-11 14:40:53 -04:00
Mike Salvatore 4364a48561 island: Simplify remove_PBA_files() 2021-05-11 14:40:53 -04:00
Mike Salvatore 5742e85ff5 island: Consolidate duplicate delete post breach file functionality 2021-05-11 14:40:53 -04:00
Mike Salvatore 71029cb7f9 island: Decouple FileUpload resource from environment_singleton 2021-05-11 14:40:53 -04:00
Mike Salvatore ca65330e86 island: Create custom PBA directory on PostBreachFilesService init 2021-05-11 14:40:53 -04:00
Mike Salvatore be0f7ac881 island: Decouple PBAFileDownload from environment_singleton 2021-05-11 14:40:53 -04:00
Mike Salvatore 4190797ca2 island: Add PostBreachFilesService.get_custom_pba_directory() 2021-05-11 14:40:53 -04:00
Mike Salvatore ee19eed596 island: Decouple PostBreachFilesService from environment_singleton 2021-05-11 14:40:53 -04:00
Mike Salvatore a7f2e023b8 island: Wrap services/post_breach_files.py functions in a static class 2021-05-11 14:40:53 -04:00
Mike Salvatore ba86ba0395 island: Decouple Database service from services.post_breach_files
Since Database.reset_db() calls ConfigService.init_config() which calls
ConfigService.reset_config() which calls
services.post_breach_files.remove_PBA_files(), it is redundant to call
remove_PBA_files() from Database.reset_db(). Removing this call has the
added benefit of reducing the coupling between the Database service and
services.post_breach_files
2021-05-11 14:40:53 -04:00