Commit Graph

10297 Commits

Author SHA1 Message Date
Kekoa Kaaikala 3516fa1fec Agent: Fix: Pass port as int 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala d335c4081a Agent: Fix TCPRelay missing _interrupted member 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala 6051cfa29a Agent: Fix log call exhausting iterator 2022-09-09 08:19:56 -04:00
Mike Salvatore 2fadfd1b31 Merge pull request #2257 from guardicore/2216-notify-relay-when-finished
2216 notify relay when finished
2022-09-09 08:19:56 -04:00
Mike Salvatore 1d58ce36e7 Agent: Use a finally clause to ensure singleton is always unlocked 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala 6c2cab9950 Agent: Disconnect from upstream relay 2022-09-09 08:19:41 -04:00
Kekoa Kaaikala baeb0c9460 Agent: Add function to disconnect from relay 2022-09-09 08:18:17 -04:00
Mike Salvatore 5366bba389 Merge branch '2216-modify-controlclient-find-server' into 2216-tcp-relay
PR #2250
2022-09-09 08:18:14 -04:00
Mike Salvatore f3ff4176b2 Merge pull request #2251 from guardicore/2216-use-tcprelay-in-agent
2216 use tcprelay in agent
2022-09-09 08:13:02 -04:00
Shreya Malviya e1759a7906 UT: Simplify parametrize logic in test_find_server() 2022-09-09 08:13:02 -04:00
Mike Salvatore 9f5aa5a055 Agent: Drop DEFAULT_DISCONNECT_TIMEOUT to 2 minutes
Agents should be sending data back to the island very frequently. 2
minutes should be plenty.

Consider adding a heartbeat and reducing this timeout further.
2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 0398b31ece Agent: Use set in get_free_tcp_port() 2022-09-09 08:13:02 -04:00
Shreya Malviya fac179bbda UT: Simplify test logic in test_find_server() 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 0b27e12b0f Merge pull request #2249 from guardicore/2216-wait-for-relay-users-to-disconnect
Agent: Wait for relay users to disconnect
2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 33da121465 Agent: Use 'relay_port' for relay local port 2022-09-09 08:13:02 -04:00
Shreya Malviya 45d1cc78c1 UT: Use requests_mock in test_find_server 2022-09-09 08:13:02 -04:00
Mike Salvatore 5a83401a02 Agent: Add RelayUserHandler._remove_expired_users() 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala b74c42ff07 Agent: Add join timeout for the relay thread 2022-09-09 08:13:02 -04:00
Shreya Malviya 451d2d0694 UT: Use RELAY_CONTROL_MESSAGE_REMOVE_FROM_WAITLIST in place of RELAY_CONTROL_MESSAGE 2022-09-09 08:13:02 -04:00
Mike Salvatore e2736a9273 Agent: Lock RelayUserHandler.has_*_users() 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 33aac19831 Agent: Try well-known ports before other ports 2022-09-09 08:13:02 -04:00
Shreya Malviya aa1c31efb2 Agent: Rename RELAY_CONTROL_MESSAGE -> RELAY_CONTROL_MESSAGE_REMOVE_FROM_WAITLIST 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 90dcb0a91e Agent: Wait for relay users to disconnect 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 4c795343d0 Agent: Fix maximum_depth_reached() 2022-09-09 08:13:02 -04:00
Shreya Malviya cb4af415c1 Agent: Rename _open_socket_to_server -> _send_remove_from_waitlist_control_message_to_relay 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 526139bef1 Agent: Remove connect() 2022-09-09 08:13:02 -04:00
Shreya Malviya 7661027c6c Agent: Don't catch TimeoutError in _open_socket_to_server() since OSError is already being caught 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 28f555498f Agent: No need to check relay existence 2022-09-09 08:13:02 -04:00
Shreya Malviya 6bfe6bc79d Common: Rename SendControlRelayMessageThread -> SendRemoveFromWaitlistControlMessageToRelaysThread 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala aac0bfe90b Agent: Use addres_to_ip_port in connect() 2022-09-09 08:13:02 -04:00
Shreya Malviya 78d32053a2 Agent: Rename send_relay_control_message -> send_remove_from_waitlist_control_message_to_relays 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala f212425842 Agent: Pass server list to connect() 2022-09-09 08:13:02 -04:00
Shreya Malviya f436bf7b8c Agent: Remove irrelevant comment from InfectionMonkey._get_server() 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala bbdc378a0d Agent: Hand TCPRelay build it's own dependencies 2022-09-09 08:13:02 -04:00
Shreya Malviya fb1554840a Agent: Fix log message in InfectionMonkey._get_server() 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 5c7c54e450 Agent: Use timeout in build_tcprelay_deps() 2022-09-09 08:13:02 -04:00
Ilija Lazoroski 6ee15e22b8 Agent: Rework call of find_server in monkey.py 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 732751f007 Project: Fix vulture warnings 2022-09-09 08:13:02 -04:00
Ilija Lazoroski b89ba06fd1 UT: Rename test_find_server__no_available_relays to test_find_server 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala 2fd99318ba Agent: Replace MonkeyTunnel with TCPRelay 2022-09-09 08:13:02 -04:00
Ilija Lazoroski 20172230f1 Agent: Rework send_control_relay_message a bit 2022-09-09 08:13:02 -04:00
Kekoa Kaaikala a0f566ef49 Agent: Add network utilities for connections 2022-09-09 08:13:02 -04:00
Ilija Lazoroski 60f9aa6a4e Agent: Rework relay.utils.find_server a bit 2022-09-09 08:13:02 -04:00
Ilija Lazoroski e539495545 Agent: Find server and send control relay message to all other servers 2022-09-09 08:13:02 -04:00
Ilija Lazoroski 65226d5a9c UT: Move test_find_server under network.relay.utils 2022-09-09 08:13:02 -04:00
Ilija Lazoroski bb2b4aaf6c Agent: Separate responsibilites in network.relay.utils.find_server 2022-09-09 08:13:02 -04:00
Shreya Malviya c6c6cf1e79 Agent: Add TODO about variable naming in `InfectionMonkey` 2022-09-09 08:13:02 -04:00
Shreya Malviya 94dc8cf377 Agent: Use `find_servers` to pass valid server to `ControlClient` 2022-09-09 08:13:02 -04:00
Shreya Malviya 18659b654f Agent: Return server to connect to or None from `find_server` 2022-09-09 08:13:02 -04:00
Ilija Lazoroski 789d6b8441 Agent: Move ControlClient.find_server in network/relay/utls.py 2022-09-09 08:13:02 -04:00