Commit Graph

5608 Commits

Author SHA1 Message Date
Mike Salvatore 1da6515751 Island: Remove superfluous log statement 2022-06-06 13:26:19 -04:00
Ilija Lazoroski 4e520c135f Island: Add IAgentBinaryRepository
Issue #1974
2022-06-06 11:44:32 -04:00
Mike Salvatore ae78ed7931 Island: Add AgentBinaries to monkey_island.cc.resources package 2022-06-03 10:24:39 -04:00
Shreya Malviya c43bc3a0c1 Island: Change AgentBinaries URL parameter name
Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2022-06-03 13:11:10 +05:30
Shreya Malviya 662fc6b50e Island: Change agent binary download endpoint 2022-06-02 17:32:40 +05:30
Shreya Malviya ed1e152e9c Agent: Change agent binary download endpoint 2022-06-02 17:32:14 +05:30
Shreya Malviya 594d215598 Island: Rename resource MonkeyDownload to AgentBinaries 2022-06-02 17:09:02 +05:30
ilija-lazoroski 0baacf3027
Merge pull request #1973 from guardicore/1961-decouple-dropper-and-wormconfig
1961 decouple dropper and wormconfig
2022-06-02 12:00:20 +02:00
Shreya Malviya a1656a7121
Merge pull request #1976 from guardicore/1962-decouple-should_stop-from-config
Move `should_stop` out of the config
2022-06-02 15:27:15 +05:30
Ilija Lazoroski 09958c21c6 Agent: Make agent target paths a Path objects 2022-06-02 11:01:21 +02:00
Shreya Malviya d9ce5bae37 Island: Move `should_stop` out of the config to a standalone field in the Monkey document 2022-06-01 16:42:06 +05:30
Ilija Lazoroski e4a2a54c71 Agent: Rename get_agent_dest_path to get_agent_dst_path 2022-06-01 13:05:03 +02:00
Ilija Lazoroski 8ef0b44841 Agent: Fix dropper date referencing
* Make dropper date reference path from strings to Path objects
* Fix try/except block logic and indentation
2022-06-01 12:40:00 +02:00
vakarisz 711cab5f38 Agent: Separate dropper path from agent binary path 2022-06-01 13:04:57 +03:00
Mike Salvatore daa6583b08 Island: Refactor IFileRepository imports/exports
Export `IFileRepository` and `LocalStorageFileRepository` from
`repository/file_storage` so that the `repository` package does not
depend on the internal structure of the `file_storage` subpackage.
2022-05-31 13:16:50 -04:00
Mike Salvatore 6cea0c9657
Merge pull request #1972 from guardicore/1966-i-file-storage
1966 renaming repositories
2022-05-31 09:59:59 -04:00
vakarisz 027c53a090 UT: Rename variables and fixtures to file repository 2022-05-31 16:13:00 +03:00
vakarisz 7caba8e399 Island: Rename FileSystemStorage to LocalStorageFileRepository 2022-05-31 15:57:38 +03:00
Shreya Malviya bcbb005ba0 Agent: Remove `should_stop` from configuration 2022-05-31 17:39:15 +05:30
Ilija Lazoroski f7c2e903b8 Island: Remove dropper target paths from the config 2022-05-31 14:00:05 +02:00
Ilija Lazoroski b8e943f7a8 Agent: Decouple dropper target paths from the config
* Dropper target paths are now part of infection_monkey.model
2022-05-31 13:59:08 +02:00
vakarisz 6c1fa80f42 Island: Rename Filesystem to FileSystem 2022-05-31 13:59:47 +03:00
vakarisz faf2259c59 Island: Rename repository file names to snake case 2022-05-31 12:59:38 +03:00
vakarisz 154d59b837 Island: Rename and move file storage classes 2022-05-31 12:45:45 +03:00
Ilija Lazoroski 49654d4dfe Island, Agent: Move dropper option from WormConfiguration to consts
* Remove dropper_set_date, dropper_date_reference_path_windows
  dropper_date_reference_path_linux from internal config in the Island
* Remove all references to these options from data for tests
2022-05-30 15:14:58 +02:00
vakarisz 7310cc0b15 Agent: Improve the commandline argument parsing 2022-05-30 16:04:10 +03:00
Ilija Lazoroski 8d225b5c1b Agent: Remove --config argument 2022-05-30 13:31:02 +02:00
Ilija Lazoroski 1bfffb0bfd Project: Fix travis build 2022-05-30 13:15:31 +02:00
Shreya Malviya 8b1a82814e Island: Update API spec comments after rebase 2022-05-27 23:59:20 +05:30
Shreya Malviya c54b3da86d Island: Minor changes to API spec comments as per CR 2022-05-27 23:46:35 +05:30
Mike Salvatore 8845588ec9 Island: Add a note about removing blackbox endpoints 2022-05-27 23:38:32 +05:30
Shreya Malviya e9f2c9b411 Island: Remove comment about 500 HTTP status code in clear_caches.py 2022-05-27 23:37:32 +05:30
Shreya Malviya dfe93feb0b Island: Update API spec comments after discussion 2022-05-27 23:37:27 +05:30
vakarisz ad7d726b52 Island: Add more comments about URL structure refactoring 2022-05-27 23:33:37 +05:30
Shreya Malviya d49f7c8e3d Island: Add comments about the current API design 2022-05-27 23:30:05 +05:30
ilija-lazoroski f1f2522e7c
Docs: Add initial Sphinx code documentation for the Island (#1964) 2022-05-26 11:20:15 -04:00
VakarisZ be3dd55313
Merge pull request #1955 from guardicore/1943-resource-urls
1943 resource urls
2022-05-25 14:42:46 +03:00
vakarisz 9a6d4ebf4f Island: Add default(empty) url list to AbstractResource 2022-05-25 14:42:28 +03:00
Mike Salvatore e86c63b135 Island: Raise error instead of assert in FlaskDIWrapper.add_resource() 2022-05-25 06:54:04 -04:00
vakarisz 0cdf84cac5 Island: Extract jwt_required decorator into separate file 2022-05-25 11:31:28 +03:00
vakarisz 84c78c4d8f Island: Reduce coupling between resources and flask 2022-05-25 11:19:24 +03:00
Mike Salvatore 2870df40da Island: Add TODO to resources.monkey.Monkey.patch() 2022-05-24 19:15:25 -04:00
Mike Salvatore 0cd6f15fc1 Island Add TODO to resources.monkey.Monkey.post() 2022-05-24 18:18:51 -04:00
Mike Salvatore 49b72e8651 Agent: Remove ControlChannel's dependency on WormConfiguration 2022-05-24 15:59:29 -04:00
vakarisz 87082f058d UT: Improve readability of test_app.py 2022-05-24 17:29:15 +03:00
vakarisz dd2aadb4c1 Island: Improve readability of FlasDIWrapper 2022-05-24 17:29:15 +03:00
vakarisz 0d0f4f63f3 UT: Reduce duplication of mock flask app initialization 2022-05-24 17:29:15 +03:00
Mike Salvatore 0dc1bfc9f5 Use strip() instead of rstrip() when checking duplicate URLs
See
https://github.com/guardicore/monkey/pull/1955#discussion_r879351986
for more details.
2022-05-24 17:29:15 +03:00
Mike Salvatore 4b9fe6a83d Island: Handle duplicate url parameter edge case in FlaskDIWrapper 2022-05-24 17:29:15 +03:00
Mike Salvatore 108c86d56c Island: Simplify logic for checking duplicate URLs 2022-05-24 17:29:15 +03:00
vakarisz 0344ee1a7c UT: Refactor hardcoded URL's to resource references 2022-05-24 17:29:15 +03:00
vakarisz 4069cc8084 UT: Add helper method to form URL's
This method forms url's based on parameters and allows us to avoid hard-coding url's in our unit tests
2022-05-24 17:29:15 +03:00
vakarisz 75318059e4 UT: Remove unnecessary comment in test_aws_command_runner.py 2022-05-24 17:29:15 +03:00
vakarisz f0a613eb75 Island: Move URL definitions to resource classes 2022-05-24 17:29:15 +03:00
vakarisz ce12d46012 Island: Define IResource interface and check for duplicate URL's 2022-05-24 17:29:15 +03:00
Mike Salvatore e0b444a68f Island: Rename IStolenCredentials.py -> IStolenCredentialsRepository.py 2022-05-24 08:30:23 -04:00
VakarisZ 23c2b42d5c
Merge pull request #1950 from guardicore/1940-dal-layer
Island: Define repository interfaces
2022-05-24 14:00:38 +03:00
vakarisz e32689a2b0 Island: Fix IAttackRepository class name 2022-05-24 10:22:16 +03:00
vakarisz f43e76aca5 Island: Remove ITelemStoreRepository.py
Refactoring it is not worth it because we're not sure about the performance solution we'll need after the refactoring
2022-05-20 17:43:48 +03:00
vakarisz cfcb252df3 Island: Improved naming of the network map interface 2022-05-20 17:42:14 +03:00
vakarisz ec4af2cc57 Island: Add INetMapRepository.py and a mock entities for it 2022-05-20 17:24:18 +03:00
vakarisz f2a4be8de0 Island: Rename /dal to /repository 2022-05-19 10:41:01 +03:00
vakarisz 3b0ec975d2 Island: Add comments in services and models
These comments explain/elaborate on changes needed for DAL implementation
2022-05-18 17:31:19 +03:00
vakarisz 4bbd998197 Island: Add remaining repository interfaces 2022-05-18 17:29:38 +03:00
vakarisz 8f048a9b34 Island: Delete IRepository.py, because it's split up 2022-05-18 17:28:26 +03:00
Ilija Lazoroski ca951af5d0 Island: Add ITelemStoreRepository interface 2022-05-18 13:44:23 +02:00
vakarisz e0b4037270 Island: Add notes/explanations/thoughs in the services 2022-05-18 13:03:24 +03:00
vakarisz 6438afbcd5 Island: Add a bunch of IRepository interfaces for data entities 2022-05-18 13:02:48 +03:00
vakarisz aaa3aade20 Island: Define repository interfaces for config and edge 2022-05-17 15:29:55 +03:00
Mike Salvatore ed2efbc0bf
Merge pull request #1947 from guardicore/1924-upgrade-mongodb
Upgrade MongoDB in build scripts
2022-05-12 12:05:02 -04:00
Shreya Malviya 029ff379c1 Island: Add condition for Ubuntu 22.04 in mongo installation script 2022-05-12 19:12:50 +05:30
Shreya Malviya 3b10a91526 Island: Modify temporary mongodb zip path in linux mongo installation script 2022-05-12 19:12:50 +05:30
Shreya Malviya ae500131b9 Build: Update mongo download link for Windows 2022-05-12 17:14:49 +05:30
Shreya Malviya 3e5ae392c9 Build: Create separate mongo installation script for Windows 2022-05-12 17:03:38 +05:30
Mike Salvatore 77702fcfbd Merge branch '1928-aws-service-refactor' into develop
Resolves #1928
2022-05-12 07:23:47 -04:00
Mike Salvatore 95979e6e71
Merge pull request #1944 from guardicore/1928-report-exporter-removal
1928 report exporter removal
2022-05-12 07:17:52 -04:00
Mike Salvatore 592fb1538f Island: Remove disused Exporter class 2022-05-12 07:12:25 -04:00
Mike Salvatore 25cfa58c69 UI: Use single quotes instead of double quotes in AWSInstanceTable.js 2022-05-12 07:08:16 -04:00
vakarisz 499fec2574 Island: Improve _aws_command_results_to_encodable_dict
By calling __dict__ we avoid the need to specify each dictionary key and make it the same as AWSCommandResults. This will allow for easier modification of AWSCommandResults.
2022-05-12 11:21:47 +03:00
vakarisz 70ae745a52 Island: Remove report exporter manager
We only have AWS report exporter, no point to keep this infrastructure
2022-05-12 09:22:03 +03:00
Mike Salvatore 7bb1aeb42c UT: Add __init__.py to avoid test file name collisions
See https://github.com/pytest-dev/pytest/issues/3151 for more details.
2022-05-11 18:30:14 -04:00
Ilija Lazoroski d9046b39a8 Agent: Mark monkey agent for deletion on reboot
Each windows agent which will be runned, we are going to
to mark it for deletion on boot and also try it to delete it using
delayed command.
2022-05-11 23:47:11 +02:00
Mike Salvatore 8fe9b32366 UT: Expect WindowsPath in assert_windows_permissions() 2022-05-11 12:12:24 -04:00
vakarisz 7ed7164a03 Island: Export AWS findings without report_exporter_manager.py 2022-05-11 17:09:48 +03:00
Mike Salvatore f83832dc3c Island: Change method order in RemoteRun 2022-05-11 10:00:35 -04:00
Mike Salvatore ae0e8ddb8e Island: Refactor RemoteRun.post() results encoding 2022-05-11 10:00:04 -04:00
Mike Salvatore 43d8fd87ed UT: Add unit tests for RemoteRun resource 2022-05-11 09:52:21 -04:00
Mike Salvatore cb29c9ed88 Island: Add RemoteRun to resources/__init__.py 2022-05-11 09:51:49 -04:00
Mike Salvatore c865bf3c15 UT: Remove unneeded tmp_path from test_pba_file_download.flask_client() 2022-05-11 09:49:44 -04:00
Mike Salvatore 7c0616eecd Island: Add timeout parameter to start_infection_monkey_agent() 2022-05-11 08:20:48 -04:00
vakarisz 3702ecbc8c UI: Fix AWSInstanceTable.js to show status of run commands 2022-05-11 15:15:15 +03:00
Mike Salvatore d1d960abc2 UT: Fix faulty logic in test_multiple_status_queries
The test is checking that some calls return "in progress" and subsequent
calls return success. Using itertools.repeat allows all future calls to
return success.
2022-05-11 08:09:56 -04:00
Mike Salvatore 825c7b9ecf Island: Refactor logic to start threads in AWSService 2022-05-11 08:04:25 -04:00
Mike Salvatore 680dbca574 UT: Use only Python3.7 features in test_aws_command_runner 2022-05-11 07:56:15 -04:00
vakarisz b8006a6274 Island: Add instance ID to AWSCommandResults
Instance id tells us where the command was launched
2022-05-11 14:32:39 +03:00
Shreya Malviya 36faa9f5a3 Build: Update MongoDB links in install_mongo.sh 2022-05-11 16:21:32 +05:30
vakarisz 0b5a507f38 Island: Make AWSCommandStatus enum json serializable 2022-05-11 13:48:56 +03:00
vakarisz 30fb57c37f Island: Fix a bug where agent run threads won't start 2022-05-11 11:10:45 +03:00
vakarisz aa159a4240 Island: Improve aws_command_runner.py readability a bit 2022-05-11 10:20:27 +03:00
Mike Salvatore 94fd2a26d9 Island: Remove disused AwsCmdResult
This was replaced by monkey_island.services.aws.AWSCommandResults.
2022-05-10 13:37:44 -04:00
Mike Salvatore 60229f4a65 Island: Run multiple AWS commands concurrently 2022-05-10 13:31:14 -04:00
Mike Salvatore 487d1c55af Common: Add queue_to_list() 2022-05-10 13:30:10 -04:00
Mike Salvatore 2804ba9b07 Island: Return AWSCommandResults from start_infection_monkey_agent() 2022-05-10 13:09:56 -04:00
vakarisz e5285f2f78 Island: Add custom error and sketch out AWS command results 2022-05-10 16:57:36 +03:00
Mike Salvatore 109ea87196 Island: Fix negative sleep time bug in aws_command_runner 2022-05-10 09:47:58 -04:00
Mike Salvatore 27f8195be5 UT: Add unit tests for aws_command_runner 2022-05-10 09:47:46 -04:00
Mike Salvatore 79eb584c5d Island: Skip try_add_aws_exporter_to_manager()
This is causing the island to crash at the moment and will be completely
removed later in #1928.
2022-05-10 08:50:47 -04:00
Mike Salvatore bfeea19c88 Island: Fix broken AWS queries in aws_command_runner 2022-05-10 08:50:45 -04:00
Mike Salvatore c655aaffe9 UT: Move test_aws_service.py to services/aws/ 2022-05-10 08:04:33 -04:00
Mike Salvatore 4f3a150f5a Common: Remove disused common.cmd.* 2022-05-09 16:30:24 -04:00
Mike Salvatore fe1e8ccb75 Island: Remove disused RemoteRunAwsService 2022-05-09 16:27:07 -04:00
Mike Salvatore 68f31db03a UT: Add StubDIContainer 2022-05-09 16:23:35 -04:00
Mike Salvatore 528ca76c32 Island: Use AWSService in RemoteRun resource 2022-05-09 15:52:01 -04:00
Mike Salvatore 144506c32d Island: Implement AWSService._run_agent_on_managed_instance() 2022-05-09 15:43:52 -04:00
Mike Salvatore 653bfbd24b Island: Replace AWSCommandRunner with start_infection_monkey_agent()
The AWSCommandRunner is a subclass of CmdRunner, which attempts to make
it easy to run commands on AWS nodes asynchronously. There are some
issues with the implementation, including unnecessary complexity and a
circular dependency between the CmdRunner and Cmd classes. A simple
function that runs a single command on a single instance is a simpler
solution. It can be run with a thread worker pool if asynchronicity is
required.
2022-05-09 15:25:56 -04:00
Mike Salvatore c24bb1024e Agent: Move Timer to common/ 2022-05-09 13:26:42 -04:00
Mike Salvatore a7dcc73a3d Island: Rename AwsCmdRunner -> AWSCommandRunner 2022-05-09 13:26:36 -04:00
Mike Salvatore 83f230c5a1 Island: Move aws_cmd_runner.py -> aws_command_runner.py 2022-05-09 13:00:55 -04:00
Mike Salvatore f11ac5cc2b Island: Move AWSService to service/aws/ 2022-05-09 12:59:28 -04:00
Mike Salvatore cfbe1e5656 Island: Add docstrings to AWSService 2022-05-09 12:45:40 -04:00
Mike Salvatore 2da6e023e1 Island: Construct and register AWSService in the composition root 2022-05-09 10:25:13 -04:00
Mike Salvatore a0660f12e9 Island: Rename _filter_instance_info_from_aws_response 2022-05-09 10:16:46 -04:00
Mike Salvatore 8995eb5d2f Island: Add get_managed_instances() to AWSService 2022-05-09 10:09:17 -04:00
Mike Salvatore acabc835d4 Island: Add run_agent_on_managed_instances() to AWSService 2022-05-09 09:23:35 -04:00
Mike Salvatore 0f4b69a6f7 Island: Add stateful AWSService 2022-05-09 09:13:03 -04:00
Mike Salvatore e83848c8a4 Island: Add AWSInstance to the DIContainer 2022-05-09 08:54:35 -04:00
Mike Salvatore 7864f48e3c Common: Make AWSInstance.is_instance() return boolean 2022-05-09 07:39:05 -04:00
Mike Salvatore 7af03a83f6 Common: Simplify attribute assignment in AWSInstance 2022-05-09 06:44:21 -04:00
Shreya Malviya 28f60d51ff
Island: Use lock when creating an edge in the db
Fixes #1917
PR #1932
2022-05-09 06:28:11 -04:00
Mike Salvatore d861328fbf Common: Use relative import for aws_metadata module 2022-05-06 04:36:50 -04:00
Mike Salvatore 73e7e31a63 UT: Fix names in test_aws_metadata.py 2022-05-06 04:31:10 -04:00
Mike Salvatore 8d24b913df Common: Raise exception if AWS metadata requests fail 2022-05-06 04:22:17 -04:00
Mike Salvatore ca38235b8e Common: Set AWSInstance.is_instance to False if empty string 2022-05-06 04:07:40 -04:00
Mike Salvatore 09218ef3d3 UT: Add tests for AWSInstance 2022-05-06 04:07:16 -04:00
Mike Salvatore 10136a325c Common: Import AWSInstance in common/aws/__init__.py 2022-05-06 03:56:47 -04:00
Mike Salvatore 07f57a83ad Common: Refactor aws_metadata to improve readablility 2022-05-05 15:14:47 -04:00
Mike Salvatore d977d19d9f Common: Lazy-load AWSInstance 2022-05-05 15:01:37 -04:00
Mike Salvatore ab136284dc Common: Remove disused AWSInstance.get_account_id() 2022-05-05 11:39:49 -04:00
Mike Salvatore 64f9bcacb5 Common: Rename AwsInstance -> AWSInstance 2022-05-05 11:29:08 -04:00
Mike Salvatore 17db25b00b Agent: Log MSSQL error when authentication fails 2022-05-03 13:58:13 -04:00
Mike Salvatore 2d685ef44a Agent: Log agent's GUID 2022-05-03 13:58:13 -04:00
Mike Salvatore 0fce4e88a5 Agent: Drop CREDENTIALS_POLL_PERIOD_SEC from 30 to 10 2022-05-03 13:58:13 -04:00
Ilija Lazoroski 86c6a55097 Island, UT: Fix file_utils paths 2022-05-03 10:45:12 -04:00
Mike Salvatore 3a98fdbf52 UT: Use MappingProxyType for defaults in get_test_aws_instance() 2022-05-02 09:50:56 -04:00
Mike Salvatore a466e97cb0 Island: Move AwsCmdRunner to monkey_island/cc/server_utils/ 2022-05-02 09:28:41 -04:00
Mike Salvatore ceebdea3a9 Island: Use aws_service.get_account_id() in AWSExporter 2022-05-02 09:21:02 -04:00
Mike Salvatore 56ea170808 Island: Add get_account_id() to aws_service 2022-05-02 09:20:41 -04:00
Mike Salvatore ae83c2e3e0 Island: Relocate aws_service from common to monkey_island 2022-05-02 09:16:59 -04:00
Mike Salvatore 2714617797 Agent: Use AwsInstance instead of aws_service 2022-05-02 09:10:37 -04:00
vakarisz e89589762e Common: Rever singleton from WeakValueDictionary to simple dictionary 2022-05-02 15:55:12 +03:00
vakarisz f3a5a7090b Agent, Island, Common: Refactor AwsService from class to package
This also changes AwsInstance from singleton and instead the aws_service package is used as one
2022-05-02 15:55:12 +03:00
vakarisz 7b2ff1e159 Common: Remove CloudInstance since aws is the only cloud supported
This change simplifies the codebase by removing unnecessary inheritance and nested directory structure
2022-05-02 15:55:12 +03:00
vakarisz c5a126ff13 UT: Fix AWS instance unit tests 2022-05-02 15:55:12 +03:00
vakarisz e51b760af0 Common: Improve singleton to use WeakValueDictionary 2022-05-02 15:55:12 +03:00
Mike Salvatore 797482a172 Common: Replace protected attributes with read-only properties 2022-05-02 15:55:12 +03:00
vakarisz b58d847e22 Island: Refactor lock to event in remote_run_aws.py 2022-05-02 15:55:12 +03:00
vakarisz fead7f602e Island, Common: Change AwsInstance properties to private, add getter 2022-05-02 15:55:12 +03:00
vakarisz f63bc77df0 Common: Fix aws_instance.py formatting 2022-05-02 15:55:12 +03:00
vakarisz 8535118e4f Island: Add locks to remote_run_aws.py
Locks will avoid the situation where is_running_on_aws is called before this service finished initializing
2022-05-02 15:55:12 +03:00
vakarisz d3c1ff89e9 Island: Run AWS services on separate threads
AWS related services call AWS metadata service which might take a long time to timeout, that's why they are ran on a separate thread
2022-05-02 15:55:11 +03:00
vakarisz 0e1ffb4051 Common: Change AwsInstance to be a Singleton 2022-05-02 15:55:11 +03:00
vakarisz 65eb9b171b Island, Common: Move singleton to code_utils.py in common
Singleton is a common pattern, potentially usable in the Agent so it belongs in common
2022-05-02 15:55:11 +03:00
Ilija Lazoroski 0a145be25d Build: Change BUILD file to include commit hash on dev builds
Issue #1553
2022-04-29 10:52:52 -04:00
Mike Salvatore f65e009db6 Agent: Add comment about slow SMB transfer speeds 2022-04-29 06:58:48 -04:00
Mike Salvatore c4edec80a6
Common: Fix typo touples -> tuples
Co-authored-by: ilija-lazoroski <ilija.la@live.com>
2022-04-27 19:08:37 -04:00
Mike Salvatore 13ca4b6f8c Island: Add comment about seemingly duplicate endpoints 2022-04-27 13:19:16 -04:00
Mike Salvatore 3a5d28cc59 Island: Decouple FileUpload service from FilePond 2022-04-27 13:06:20 -04:00
Mike Salvatore 1476efa383 Island: Change unsafe -> untrusted in log message 2022-04-27 12:44:58 -04:00
Mike Salvatore 08cd631c95 Island: Make PBA_*_FILENAME_PATH tuples 2022-04-27 09:52:02 -04:00
Mike Salvatore 97300376ef
Merge pull request #1915 from guardicore/1904-service-resource-dependency-injection
1904 service resource dependency injection
2022-04-27 09:44:34 -04:00
dependabot[bot] 840f16a634 Bump twisted from 22.2.0 to 22.4.0 in /monkey/infection_monkey
Bumps [twisted](https://github.com/twisted/twisted) from 22.2.0 to 22.4.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst)
- [Commits](https://github.com/twisted/twisted/compare/twisted-22.2.0...twisted-22.4.0)

---
updated-dependencies:
- dependency-name: twisted
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-27 09:33:35 -04:00
Mike Salvatore 3bf0695a66 Island: Add comment/documentation about delete_file()'s idempotence 2022-04-27 09:27:54 -04:00
Mike Salvatore 1e9627470c Common: Check that injected types are subtypes of interfaces 2022-04-27 09:18:55 -04:00
Mike Salvatore 77753aca3f Island: Rename _initialize_globals() -> _initialize_di_container() 2022-04-27 09:07:27 -04:00
Mike Salvatore e8e879091d Island: Add logging to DirectoryFileStorageService 2022-04-26 19:54:12 -04:00
Mike Salvatore 4ddcd5e9a8 Island: Raise FileRetrievalError in DirectoryFileStorageService 2022-04-26 19:49:57 -04:00
Mike Salvatore a0b4dc1bcb Island: Ignore exception in delete_file() if file not found 2022-04-26 19:36:50 -04:00
Mike Salvatore 8f7215034d Island: Add paranoid check to avoid directory traversal attacks 2022-04-26 19:26:27 -04:00
Mike Salvatore 92349d8f8e UT: Remove collection warnings for TestClass{4,5} 2022-04-26 19:21:02 -04:00
Mike Salvatore 54d34d1816 Island: Rename FlaskResourceManager -> FlaskDIWrapper 2022-04-26 19:19:24 -04:00
Mike Salvatore 98033c96c0 UT: Remove unnecessary monkeypatch fixtures from test_pba_file_upload.py 2022-04-26 13:50:22 -04:00
Mike Salvatore fefdd9f024 UT: Remove mocking of private method in test_pba_file_upload.py 2022-04-26 13:49:17 -04:00
Mike Salvatore 55c4f68902 Island: Rename file_type -> target_os in FileUpload resource 2022-04-26 13:41:16 -04:00
Mike Salvatore 1d938e58f8 Island: Prefix private functions with "_" in FileUpload resource 2022-04-26 13:39:21 -04:00
Mike Salvatore e296cd5225 UT: Refactor PBA resource upload/download tests to use DI 2022-04-26 12:58:22 -04:00
Ilija Lazoroski 30e27b4e9a Zoo: Add timeout to zerologon bb test
* Fix log message in smb tools
2022-04-26 11:40:48 -04:00
Mike Salvatore d084b00367 Island: Use DIContainer to construct custom PBA resources 2022-04-26 02:36:17 -04:00
Mike Salvatore 8c3477a000 Common: Raise TypeError if DIContainer.register() called with instance 2022-04-26 02:35:00 -04:00
Mike Salvatore 9b52f3f21b Island: Add missing type hint to LocalMonkeyRunService constructor 2022-04-26 02:19:55 -04:00
Mike Salvatore 3d931b11f9 Island: Fix incorrect type hint in AuthenticationService 2022-04-26 02:18:43 -04:00
Mike Salvatore c16705241a Common: Use a more precise, custom UnregisteredTypeError in DIContainer 2022-04-26 01:42:17 -04:00
Mike Salvatore 7382407be0 Common: Add DIContainer.resolve_dependencies() 2022-04-26 01:37:41 -04:00
Mike Salvatore e78bffb414 Common: Add note about varargs and kwargs to resolve() docstring 2022-04-26 01:27:17 -04:00
Mike Salvatore 7a62434364 Common: Resolve registered instances and types directly 2022-04-26 01:21:36 -04:00
Mike Salvatore 435b619a5d Common: Add recursive resolution to DIContainer 2022-04-25 15:56:59 -04:00
Mike Salvatore 379a71d8e2 Common: Add DIContainer 2022-04-25 14:46:26 -04:00
Mike Salvatore cd8fa699b0 Common: Move get_all_regular_files_in_directory() to utils.file_utils 2022-04-25 12:32:59 -04:00
Mike Salvatore 2f4ffad3f6 Island: Skip directories in DirectoryFileStorageService.delete_all_files 2022-04-25 12:15:57 -04:00
Mike Salvatore a487aa4058 Island: Modify PostBreachFilesService to wrap IFileStorageService 2022-04-25 12:06:23 -04:00
Mike Salvatore d157bf7a40 Island: Use IFileStorageService in FileUpload resource 2022-04-25 12:06:21 -04:00