Commit Graph

6884 Commits

Author SHA1 Message Date
VakarisZ e4280660df Island: add semaphores to avoid race condition
If user kills all monkeys during the waking up of a monkey, all monkeys will get flagged as dead except the one that just woke up
2021-12-08 14:48:58 +02:00
VakarisZ 31cdd29edb Island: add "was monkey killed by user" endpoint
Using this endpoint monkey can check if kill command was issues and if it should die
2021-12-08 14:48:57 +02:00
VakarisZ 6dfa34a133 Island: add the ability to check if monkey document has parent and retrieve it from the model 2021-12-08 14:48:57 +02:00
VakarisZ 4fdd3370ca Island, UI: implement the endpoint for stopping all monkeys, change the UI to call this endpoint and send a timestamp of button press 2021-12-08 14:48:57 +02:00
VakarisZ 9d7c7073c3 Monkey, Island: use process start timestamp to track monkey start time instead of datetime string of wakeup call
This change allows us to avoid the issues where agents are on a different timezone than island and process start time is more precise than
2021-12-08 14:48:57 +02:00
VakarisZ 52369f0fae Island: rename "monkey_control" resource folder to "agent_controls" 2021-12-08 14:48:57 +02:00
Mike Salvatore 6a1b6c784e
Merge pull request #1643 from guardicore/1538-propagation-credentials-endpoint
Implement propagation credentials endpoint
2021-12-08 06:42:49 -05:00
Mike Salvatore 416d6734ba
Merge pull request #1644 from guardicore/1635-remove-should-monkey-run-function
1635 remove should monkey run function
2021-12-08 06:42:28 -05:00
Mike Salvatore 5052e21d97 Island: Remove /api/monkey_control/check_remote_port/<string:port> 2021-12-07 13:26:37 -05:00
Mike Salvatore 476b6c3b36 Agent: Remove can_island_see_port() 2021-12-07 13:24:58 -05:00
Mike Salvatore 32c2d744b5 Agent: Remove should_monkey_run() performance check 2021-12-07 13:21:44 -05:00
Shreya Malviya db58b0b27d Agent, UT: Remove --vulnerable-port CLI argument 2021-12-07 13:10:04 -05:00
Mike Salvatore 91a8376df6 Changelog: Add propagation-credentials endpoint entry 2021-12-07 11:59:40 -05:00
Mike Salvatore 0783e236aa Agent: Add agent GUID to /api/propagation-credentials call 2021-12-07 11:51:35 -05:00
Mike Salvatore 8ecf328b4c Island: Reimplement PropagationCredentials resource 2021-12-07 11:27:19 -05:00
Mike Salvatore 703ba4f1c4 Agent: Remove camel case from propagation credentials endpoint 2021-12-07 07:46:37 -05:00
Mike Salvatore 58d55f589d Island: Remove camel case from propagation credentials endpoint 2021-12-07 07:45:59 -05:00
Mike Salvatore 84c6f6ee01
Merge pull request #1639 from guardicore/1597-implement-stubs-in-automated-master
1597 implement stubs in automated master
2021-12-06 19:41:30 -05:00
Mike Salvatore b15612c9ae Island: Add more detail to TODO in Monkey resource 2021-12-06 19:31:50 -05:00
Mike Salvatore e8de38881c Agent: Add _create_daemon_thread() utility function to AutomatedMaster 2021-12-06 19:29:43 -05:00
Mike Salvatore 261826fc78 Agent: Implement PBA thread in AutomatedMaster 2021-12-06 19:29:43 -05:00
Mike Salvatore fecb7342ad Island: Reformat "PBAs" in config before sending to agent
Allow options to be specified for each PBA and consolidate the custom
user PBA options under a "Custom" PBA.
2021-12-06 19:29:41 -05:00
Mike Salvatore 1b04844e5e Agent: Deduplicate stop logic in AutomatedMaster 2021-12-03 11:06:56 -05:00
Mike Salvatore 839157a822 Agent: Implement AutomatedMaster._run_payloads() 2021-12-03 10:53:42 -05:00
Mike Salvatore 44055b32f9 Island: Reformat "payloads" in config before sending to agent
Allow the configuration to contain multiple payloads that can be run by
the agent.
2021-12-03 10:53:34 -05:00
Mike Salvatore 2455d34c7f
Merge pull request #1638 from guardicore/1538-strip-credentials-from-agent-config
1538 strip credentials from agent config
2021-12-03 09:22:38 -05:00
Mike Salvatore 02c725d1f8 Agent: Call get "/api/monkey" endpoint from ControlChannel.get_config() 2021-12-03 09:13:08 -05:00
Mike Salvatore 30afe3cc85 Island: Strip credentials out of config before sending to agent
The credentials for credential reuse attacks will now be retrieved by
the agent via a new endpoint that returns only credentials in order to
reduce unnecessary network traffic (issue #1538).
2021-12-03 09:13:08 -05:00
Mike Salvatore 9ed4f2687e Tests: Add flat monkey config for use in tests 2021-12-03 09:13:08 -05:00
Mike Salvatore 8730b2bbbc Agent: Call /legacy config endpoint from ControlClient 2021-12-03 09:13:08 -05:00
Mike Salvatore 7cda2b8e58 Island: Add "/legacy" config format option to monkey config endpoint
The schema of the configuration that is given to the agent when it
requests configuration from the island is heavily influenced by the GUI
and how configuration options should be displayed to the user. It is not
formatted in a way that is easy for the agent to utilize. This commit
adds a `/api/monkey/<string:guid>/<string:config_format>` endpoint that
allows legacy code to continue to function, while the agent's new
AutomatedMaster component (issue #1597) can receive configuration in a
way that makes sense for the agent.
2021-12-03 09:13:08 -05:00
Mike Salvatore 21a9c4fa14 Island: Remove disused MonkeyConfiguration resource 2021-12-03 09:13:08 -05:00
Mike Salvatore a1601f120f
Merge pull request #1637 from guardicore/1597-implement-automated-master
1597 implement automated master - Part 1
2021-12-03 08:55:41 -05:00
Mike Salvatore 7516505623 Agent: Join on pba_thread to ensure it completes before simulation ends 2021-12-03 08:06:46 -05:00
Mike Salvatore fc88fb948c Agent: Add a few TODOs into AutomatedMaster 2021-12-03 07:18:48 -05:00
Mike Salvatore 23886e2cf7 Agent: Use logger.warning() instead of depricated warn() 2021-12-03 06:51:59 -05:00
Mike Salvatore bf0e5f098b Agent: Make minor code quality improvements to AutomatedMaster 2021-12-02 11:51:29 -05:00
Mike Salvatore 4fc18ae750 Agent: Improve responsiveness of AutomatedMaster shutdown 2021-12-02 11:51:29 -05:00
Mike Salvatore 9279d82adf Agent: Add a Timer class 2021-12-02 11:51:29 -05:00
Mike Salvatore 73bf93050f Agent: Implement _collect_system_info in AutomatedMaster 2021-12-02 11:51:29 -05:00
Mike Salvatore 9809fc2a41 Agent: Implement _run_simulation() that calls stubbed methods 2021-12-02 11:51:29 -05:00
Mike Salvatore a2bba6a025 Agent: Implement _check_for_stop() in AutomatedMaster 2021-12-02 11:51:29 -05:00
Mike Salvatore 0456d695c4 Agent: Add an AutomatedMaster that implements start() and terminate() 2021-12-02 11:51:27 -05:00
Mike Salvatore 418b5ce9ec
Merge pull request #1631 from guardicore/1595-new-agent-setup
Implement Agent setup function
2021-12-02 09:20:05 -05:00
VakarisZ ce7362e278 Agent: add a waiting timer to allow exploited machines to connect to the tunnel (in agent cleanup) 2021-12-02 14:26:10 +02:00
VakarisZ e4bdc96410 Agent: move _set_propagation_depth and _add_default_server_to_config from constructor to start
Moved because these methods don't initialize the parameters, they change the global WormConfiguration object which is logic/behavior
2021-12-02 11:51:14 +02:00
VakarisZ 1e9c9ab823 Agent: move _set_propagation_depth and _add_default_server_to_config from constructor to start
Moved because these methods don't initialize the parameters, they change the global WormConfiguration object which is logic/behavior
2021-12-02 11:25:59 +02:00
Mike Salvatore f074b3e388 Agent: Pass agent_id to ControlChannel constructor 2021-12-01 12:18:32 -05:00
Mike Salvatore 1944040328 Agent: Remove unnecessary control_channel_server() from IControlChannel 2021-12-01 12:14:58 -05:00
Mike Salvatore 13e16b9dea Agent: Revert "legacy" in dropper start() and cleanup() functions 2021-12-01 11:26:05 -05:00