Commit Graph

8300 Commits

Author SHA1 Message Date
Ilija Lazoroski 86c6a55097 Island, UT: Fix file_utils paths 2022-05-03 10:45:12 -04:00
Mike Salvatore 8d65fa36f2
Merge pull request #1919 from guardicore/1636-long-aws-check
1636 long aws check
2022-05-02 09:53:46 -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
vakarisz cea49b6d50 Docs: Improve running on AWS ec2 documentation
Update the IAM role change screenshot and add a note about firewall rules
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 946c394c74 Changelog: Add entry about fixed long AWS check on island startup 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
Mike Salvatore fdf8198e7f Build: Use `pipenv requirements` in appimage build
As of pipenv 2022.04.30, `pipenv lock -r` is deprecated in favor of the
new `pipenv requirements` command.
2022-05-02 08:52:17 -04: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 9b1857a3d9
Merge pull request #1918 from guardicore/1904-pba-file-upload-resource-improvements
1904 pba file upload resource improvements
2022-04-27 19:08:46 -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