Commit Graph

7129 Commits

Author SHA1 Message Date
Mike Salvatore 1a7135e13f Agent: Improve Callback type hint in IPScanner 2021-12-13 09:32:05 -05:00
Mike Salvatore 0c180a455c Agent: Improve "options" handling in IPScanner 2021-12-13 09:32:05 -05:00
Mike Salvatore 5a1e19391d Agent: Make tcp/ping timeouts consistent
* Ping takes a `timeout: float` instead of `options: Dict` the same way
  that `scan_tcp_port()` does.
* Timeouts are floats instead of ints
2021-12-13 09:32:05 -05:00
Mike Salvatore 11e3c5d6e4 UT: Remove superfluous Asserts in test_network_scanner.py 2021-12-13 09:32:05 -05:00
Mike Salvatore 88608c1cf1 Agent: Fix some type hints in automated master 2021-12-13 09:32:05 -05:00
Mike Salvatore 6147d635d6 Agent: Extract propagation logic into Propagator class 2021-12-13 09:32:05 -05:00
Mike Salvatore abec851ed0 Agent: Make minor code cleanliness changes 2021-12-13 09:32:05 -05:00
Mike Salvatore 8091a0c4a5 Agent: Join on system info collector thread
This was mistakenly commented out somewhere along the way.
2021-12-13 09:32:05 -05:00
Mike Salvatore 037d63c9f3 Agent: Move VictimHost construction to AutomatedMaster 2021-12-13 09:32:05 -05:00
Mike Salvatore b3c520f272 Agent: Fix incorrect port status in MockPuppet 2021-12-13 09:32:05 -05:00
Mike Salvatore 8d361777bc Agent: Return PingScanData from IPuppet.ping() 2021-12-13 09:32:05 -05:00
Mike Salvatore 75cfa252c9 Agent: Modify AutomatedMaster to handle propagation config options 2021-12-13 09:32:05 -05:00
Mike Salvatore 80707dac8e Island: Reformat "propagation" config options before sending to Agent 2021-12-13 09:32:05 -05:00
Mike Salvatore 81d4afab52 Agent: Extract network scanner into its own class 2021-12-13 09:32:05 -05:00
Mike Salvatore 3f7dbbccc2 Agent: Move _create_daemon_thread to threading_utils.py 2021-12-13 09:32:05 -05:00
Mike Salvatore 86203c8138 Agent: Add AutomatedMaster to master/__init__.py 2021-12-13 09:32:05 -05:00
Mike Salvatore da8e814b95 Island: Add units TCP and ICMP timeout option
The timeout option for TCP and ICMP scans is in milliseconds. Change
"timeout" -> "timeout_ms" to avoid confusion.
2021-12-13 09:32:05 -05:00
Mike Salvatore 25410716d3 Agent: Integrate scan configuration with network scanning thread 2021-12-13 09:32:05 -05:00
Mike Salvatore 8c47d113c3 Agent: Add "options" parameter to IPuppet.ping() 2021-12-13 09:32:05 -05:00
Mike Salvatore c497962d9e Island: Reformat network scan parameters before sending to agent 2021-12-13 09:32:01 -05:00
Mike Salvatore 56e71f3120 Agent: Remove PingScanner from fingerprinter list
The ping scanner is currently required by the monkey agent in order to
determine the OS of the victim. In the future, scanning can be reworked
to be more configurable under a variety of different scenarios. For the
moment, it's not optional.
2021-12-13 09:30:58 -05:00
Mike Salvatore 7b40996d6a Agent: Implement preliminary network scanning thread 2021-12-13 09:30:58 -05:00
Mike Salvatore 05adf6bae6 Agent: Implement a preliminary propagation thread in AutomatedMaster 2021-12-13 09:30:58 -05:00
Mike Salvatore 5724695181 Agent: Fix incorrect import in ControlChannel 2021-12-13 09:30:58 -05:00
vakarisz 8d325df6d6 Island, UT: fix a bug in "is monkey killed" endpoint
The bug happened because by default there's no kill event so kill event time is None
2021-12-09 14:53:32 -05:00
Mike Salvatore 1c76ea20f2
Merge pull request #1645 from guardicore/1635-remove-should_monkey_run-config-field
Remove started_on_island config field
2021-12-08 12:07:11 -05:00
Shreya Malviya 949b0b78b9 Island: Remove leftover started on island logic after rebase 2021-12-08 22:01:40 +05:30
Shreya Malviya a91d6e1f05 UT: Remove started_on_island from sample configs 2021-12-08 21:52:16 +05:30
Shreya Malviya 03b7be3be1 UI: Remove started_on_island option from UiSchema 2021-12-08 21:52:15 +05:30
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