Commit Graph

8834 Commits

Author SHA1 Message Date
vakarisz 6b406ef686 Agent: Change configuration to object in control channel 2022-06-23 14:47:08 -04:00
vakarisz e83995d962 UT: Add a new fixture for config object 2022-06-23 14:47:08 -04:00
vakarisz d8ac441c59 Agent: Fix configuration retrieval in _run_simulation 2022-06-23 14:47:08 -04:00
vakarisz 77804caab5 Agent: Add from_dict method to AgentConfiguration
Creating AgentConfiguration object from dictionary makes sense because it doesn't couple the configuration to any specific serialization methods. Also, the json sent from the island doesn't match the config structure because it stores config in a dict under "config" key.
2022-06-23 14:47:08 -04:00
Mike Salvatore d079d74b2c Merge branch '2000-configuration-resource' into 1960-configuration-object
PR #2038
2022-06-23 11:46:13 -04:00
Ilija Lazoroski 1ae3bd4b4f UT: Rename InMemoryFileAgentConfigurationRepository to
InMemoryAgentConfigurationRepository
2022-06-23 17:15:50 +02:00
Ilija Lazoroski 42c4803376 Island: Use schema.loads in AgentConfiguration POST method 2022-06-23 08:12:54 -07:00
Ilija Lazoroski d7329ea839 UT: Add tests for AgentConfiguration resource 2022-06-23 08:12:54 -07:00
Ilija Lazoroski b35832b9dd UT: Add InMemoryFileAgentConfigurationRepository 2022-06-23 08:12:54 -07:00
Ilija Lazoroski 891794d927 Island: Add AgentConfiguration resource to app.py 2022-06-23 08:12:54 -07:00
Ilija Lazoroski 39e4180dfe Island: Use make_response in GET agent_configuration 2022-06-23 08:12:54 -07:00
Ilija Lazoroski 48fab89e11 Island: Rename configuration.py to agent_configuration.py
Per convention it must match class name
2022-06-23 08:12:54 -07:00
Shreya Malviya 452028f221 UT: Replace Hadoop with MSSQL in test data
Previously, in the UT data, Hadoop had only windows in the
"supported_os" field in the config. Now that that field is stripped out
from the config, the supported OSes are picked up from the main code
(from `SUPPORTED_OS` in the master's `Exploiter` class) which has both
winodws and linux for Hadoop. This caused the tests to fail.

This commit changes the UT data to include the MSSQL exploiter (windows
only) instead of the Hadoop exploiter. The tests pass now.
2022-06-23 08:10:56 -07:00
Mike Salvatore 9c154215d2
Merge pull request #2040 from guardicore/1960-use-operating-systems
1960 use operating systems
2022-06-23 09:32:04 -04:00
vakarisz 68c27969d3 Agent: Fix a bug in incompatible os check
web_rce.py checks for incompatible OS on the victim. Bug was that it checked linux twice instead of linux and windows
2022-06-23 16:30:38 +03:00
vakaris_zilius 717801e9ad Agent: Add telemetry json encoder
Telemetry json encoder is needed to encode OperatingSystems enums when sending back telemetries
2022-06-23 11:51:25 +00:00
vakarisz 77f8be523c UT: Use operating systems consts 2022-06-23 11:51:21 +00:00
vakarisz 4c1c8044cd Agent: Use operating systems consts 2022-06-23 11:51:17 +00:00
Shreya Malviya 1fc0eae480 UT: Change import order in conftest.py 2022-06-22 09:35:46 -07:00
Shreya Malviya 104c7ac210 Island: Fix function call to load config in new configuration resource 2022-06-22 09:10:47 -07:00
Shreya Malviya e25eb194a1 UT: Remove `supported_os` for exploiters from all tests 2022-06-22 09:10:47 -07:00
Shreya Malviya fd41d9179e Agent: Add `SUPPORTED_OS` dict for exploiters and change checking logic in master 2022-06-22 09:10:41 -07:00
Shreya Malviya 26ece213a2 Island: Remove logic to add `supported_os` for exploiters to configuration 2022-06-22 09:07:02 -07:00
Shreya Malviya 03037b5662 Common: Remove `supported_os` field for exploiters in configuration 2022-06-22 09:06:35 -07:00
Mike Salvatore 665f7e4adf Merge branch 'fix-depth-logic' into 1960-configuration-object 2022-06-22 11:20:01 -04:00
Shreya Malviya 142eed72ac Island: Remove logic to remove/add config metadata in new configuration resource 2022-06-22 08:12:09 -07:00
Mike Salvatore ada5618958
Merge pull request #2033 from guardicore/fix-depth-logic
Agent: Change the logic of depth to represent current depth
2022-06-22 11:11:24 -04:00
Mike Salvatore eeba0e0616 UT: Add tests for should_propagate 2022-06-22 10:59:46 -04:00
Shreya Malviya ec710d9e5f Island: Get rid of ResponseContents and ImportStatuses in new configuration resource 2022-06-22 07:48:34 -07:00
Mike Salvatore 1199c72f0d Island: Modify skipping propagation log message 2022-06-22 10:44:02 -04:00
vakarisz 8d2078048c Agent: Change the positive_int definition to contain 0 2022-06-22 17:39:25 +03:00
Shreya Malviya d861def86c Island: Add logic to add metadata to config in new configuration resource's GET 2022-06-22 07:35:19 -07:00
Shreya Malviya 922495785c Island: Create class variable for agent config schema in new configuration resource 2022-06-22 07:35:19 -07:00
Shreya Malviya 6b45d62d81 Island: Fix logic to remove metadata from config in new configuration resource's POST 2022-06-22 07:35:19 -07:00
Shreya Malviya 32fe7c6a4b Island: Remove unneeded fields from `ResponseContents` in new configuration resource 2022-06-22 07:35:19 -07:00
Shreya Malviya 63d5330386 Island: Remove unneeded patch function in new configuration resource 2022-06-22 07:35:19 -07:00
Shreya Malviya 00e38391b4 Island: Catch appropriate `marshmallow` error when loading config which could be invalid, in new configuration resource 2022-06-22 07:35:19 -07:00
Shreya Malviya 15615e08c4 Island: Get rid of unsafe config options' check in new configuration resource 2022-06-22 07:35:19 -07:00
Shreya Malviya 8c14423c4e Island: Prepend 'agent' to everything having 'configuration' in new configuration resource 2022-06-22 07:35:19 -07:00
Shreya Malviya 0d8cc713d2 Island: Rename `file_agent_configuration_repository` to `agent_configuration_repository` in new configuration resource 2022-06-22 07:35:19 -07:00
Shreya Malviya 74bc55e077 Island: Remove config type logic from new configuration resource 2022-06-22 07:35:19 -07:00
Ilija Lazoroski 5f253e79b3 Island: Init Configuration resource 2022-06-22 07:35:18 -07:00
Shreya Malviya 138480f021 Island: Roughly implement POST in new Configuration resource
+ lots of questions
2022-06-22 07:35:18 -07:00
Shreya Malviya 5dd27eeea5 Island: Add definition for GET in new Configuration resource 2022-06-22 07:35:18 -07:00
Shreya Malviya 7a28ba4c4d Island: Create new resource `Configuration` 2022-06-22 07:35:18 -07:00
Mike Salvatore 1f00a13649 Island: Pass default agent configuration to repository constructor 2022-06-22 10:27:53 -04:00
Mike Salvatore 8e875143ac Project: Add `monkey/` to PYTHONPATH when running pytest
Without explicitly setting the python path, conftest.py can not find
common.*, monkey_island.*, or infection_monkey.*.
2022-06-22 10:27:53 -04:00
vakaris_zilius 8358253fc7 Agent: Rename depth to current_depth in propagation.py 2022-06-22 13:14:24 +00:00
vakaris_zilius f0029a0d82 Agent: Close inbound tunnel if one was opened 2022-06-22 13:13:32 +00:00
vakaris_zilius 27bff7e41c Island: Remove updating agent configuration with stolen credentials 2022-06-22 12:40:55 +00:00