Commit Graph

8858 Commits

Author SHA1 Message Date
Mike Salvatore 858eb2302c Agent: Rename os -> operating_system in caching_agent_repository
The variable name "os" conflicts with the name of Python's `os` library.
2022-06-24 07:23:26 -04:00
Mike Salvatore ffd3464d8a Agent: Move enum to string conversion to _download_binary_from_island() 2022-06-24 07:22:07 -04:00
Ilija Lazoroski e1d5d25e9c Agent: Use OperatingSystem.WINDOWS in Powershell 2022-06-24 11:18:39 +02:00
Ilija Lazoroski b605f16c4f Agent: Use == to compare OperatingSystems enum in Log4Shell 2022-06-24 11:11:19 +02:00
Ilija Lazoroski fb67586a4c Agent: Use OperatingSystems.value for urllib.parse.quote 2022-06-24 10:51:58 +02:00
Ilija Lazoroski d59dd81f43 Agent: Use OperatingSystems in CachingAgentRepository 2022-06-24 10:19:47 +02:00
Ilija Lazoroski f9445a2c76 Agent: Use == to compare OperatingSystems enum 2022-06-24 10:18:51 +02:00
Ilija Lazoroski 2ff2e5f597 Agent: Fix running of payloads 2022-06-24 08:33:21 +02:00
Mike Salvatore 6d156b8fee Island: Return config timeouts in seconds
The old config scheme stored timeouts as milliseconds, whereas the new
one uses seconds. Seconds are more convenient because most python
methods expecting timeouts are expecting floating-point seconds.
2022-06-23 16:55:10 -04:00
Mike Salvatore 05f640d487 Agent: Rename should_propagate -> maximum_depth_reached 2022-06-23 16:36:01 -04:00
Mike Salvatore ad0f6946bd Agent: Decouple should_propagate() and AgentConfiguration 2022-06-23 16:32:55 -04:00
Mike Salvatore afeca66d92 UT: Use AgentConfiguration in test_propagation.py 2022-06-23 16:27:05 -04:00
Mike Salvatore 5a95aef94c Agent: Remove unnecessary parameter 2022-06-23 15:57:11 -04:00
Mike Salvatore bff92ed7ad UT: Fix erroneously abbreviated fixture 2022-06-23 15:57:06 -04:00
Mike Salvatore 81d3300ec7 Agent: Remove print() that was added by mistake 2022-06-23 15:43:34 -04:00
Mike Salvatore 6e951ed65d UT: Remove supported_os from default_config.py
"supported_os" was removed from the schema in d079d74b
2022-06-23 14:56:24 -04:00
Mike Salvatore bba7139be6 Agent: Add missing return type hint to _try_communicate_with_island() 2022-06-23 14:51:35 -04:00
Mike Salvatore aff54232e9 Agent: Remove redundant call to control_channel.get_config() 2022-06-23 14:51:35 -04:00
vakaris_zilius 0f848eb284 Agent: Usa agent config object instead of dict should_propagate 2022-06-23 14:51:35 -04:00
vakaris_zilius ab67853192 Agent: Usa agent config object instead of dict automated_master.py 2022-06-23 14:51:35 -04:00
vakaris_zilius 86ed174d74 Agent: Usa agent config object instead of dict in option_parsing.py 2022-06-23 14:51:35 -04:00
vakarisz 9286e86900 Agent: Use deserialized in exploiter.py and propagator.py 2022-06-23 14:51:31 -04:00
vakarisz 095e49b543 Agent: Use deserialized config in automated_master.py 2022-06-23 14:47:08 -04:00
vakarisz ffe8c3451b Agent: Change scanners to use the config object 2022-06-23 14:47:08 -04:00
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