Commit Graph

6799 Commits

Author SHA1 Message Date
Shreya Malviya 9fcca7b9a4 Agent: Remove unused get_hop_distance_to_island function 2021-12-08 21:52:15 +05:30
Shreya Malviya 9791af1d47 Island: Remove started_on_island logic 2021-12-08 21:52:07 +05:30
Shreya Malviya 71344bcab0 Agent: Remove started_on_island logic 2021-12-08 21:48:13 +05:30
Shreya Malviya 2d73aeaac6 Common: Remove STARTED_ON_ISLAND config path constant 2021-12-08 21:48:13 +05:30
Mike Salvatore abf274a8d3
Merge pull request #1642 from guardicore/1538-reduce-network-chatter
1538 reduce network chatter
2021-12-08 08:10:04 -05:00
VakarisZ 41f6ddb5b5 UI: remove the broken "force kill" toggle from UI, also remove the react-toggle component since it's not used anywhere else 2021-12-08 14:48:58 +02:00
VakarisZ 8cd8449f12 Agent: small logging improvement 2021-12-08 14:48:58 +02:00
VakarisZ 92c0152b4e Island: renamed MONKEY_KILLING_SEMAPHORE to monkey_killing_mutex, because it better represent the purpose and is not a const 2021-12-08 14:48:58 +02:00
VakarisZ 492334fbd0 UT: add unit tests for monkey killing and monkey parent fetching 2021-12-08 14:48:58 +02:00
VakarisZ 1a583ec035 Agent: remove the "is_monkey_alive_by_configuration" check
Should monkey be alive is now checked on island. Island checks both, the config and whether the user killed it manually
2021-12-08 14:48:58 +02:00
VakarisZ a567041fba Island, UI: bugfixes related to stopping of the agents 2021-12-08 14:48:58 +02:00
VakarisZ 11735b4f89 Island, Agent: small readability and logging improvements related to killing the agents 2021-12-08 14:48:58 +02:00
VakarisZ bbd4dc57f4 Island: remove unused resource binding 2021-12-08 14:48:58 +02:00
VakarisZ 9031bfb888 Island: append should agent die check to also check if monkey is marked dead in configuration 2021-12-08 14:48:58 +02:00
VakarisZ ea621b49d1 Agent: change agent startup to check if agent should run via control channel 2021-12-08 14:48:58 +02:00
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