Commit Graph

11166 Commits

Author SHA1 Message Date
Mike Salvatore f9e74d4f03
Merge pull request #2381 from guardicore/2362-add-machines-endpoint
2362 add machines endpoint
2022-09-30 14:24:44 -04:00
Mike Salvatore df1baeebe0 Island: Use list comprehension instead of map() 2022-09-30 14:22:54 -04:00
Kekoa Kaaikala a2a6934a49 Changelog: Add entry for /api/machines 2022-09-30 18:11:21 +00:00
Kekoa Kaaikala 3409234a4d UT: Address mypy errors due to get_url_for_resource 2022-09-30 18:11:21 +00:00
Kekoa Kaaikala a3d2d7f6a1 UT: Add tests for Machines resource 2022-09-30 18:11:21 +00:00
Kekoa Kaaikala f05f247417 Island: Hook up the /api/machines endpoint 2022-09-30 18:11:21 +00:00
Kekoa Kaaikala eeca5fbea2 Island: Add resource for /api/machines endpoint 2022-09-30 18:11:21 +00:00
Kekoa Kaaikala 0516e1e015 Island: Add get_machines to IMachineRepository 2022-09-30 18:11:21 +00:00
Mike Salvatore 63447b759a Island: Add missing @jwt_required to `GET /api/agents` 2022-09-30 13:19:41 -04:00
Mike Salvatore a6d2f45cbb
Merge pull request #2380 from guardicore/2362-get-agents
2362 get agents
2022-09-30 12:37:23 -04:00
Mike Salvatore 521411c7fc Common: Register TCPScanEvent serializer 2022-09-30 12:35:57 -04:00
vakaris_zilius c16c093083 Common: Register PingScanEvent to event serializer 2022-09-30 12:33:22 -04:00
Mike Salvatore 9a6300481c
Merge pull request #2377 from guardicore/2267-publish-tcp-scan-event
Publish TCPScanEvent
2022-09-30 11:59:51 -04:00
Mike Salvatore 4987dddc0c Agent: Use dict comprehension instead of for 2022-09-30 11:53:53 -04:00
Mike Salvatore 68b288e5b3 Island: Add `GET /api/agents/` 2022-09-30 11:07:33 -04:00
Ilija Lazoroski 3f89e50930 UT: Fix tcp_scanner tests to patch the time function 2022-09-30 16:51:53 +02:00
Ilija Lazoroski 9154f6f9dc Agent: Generate timestamp when checking for tcp ports 2022-09-30 16:51:53 +02:00
Shreya Malviya 96af86f766 UT: Move variable to above fixtures in test_tcp_scanner.py 2022-09-30 16:51:53 +02:00
Shreya Malviya 9754b4731c UT: Mock AbstractAgentEvent's timestamp (time.time()) in test_tcp_scanner.py 2022-09-30 16:51:53 +02:00
Mike Salvatore 3b6e4f5313 Island: Simplify cursor to agents 2022-09-30 10:16:17 -04:00
Mike Salvatore 411b027e92 Island: Implement MongoAgentRepository.get_agents() 2022-09-30 10:15:31 -04:00
Mike Salvatore 84f21b0c1d Island: Add IAgentRepository.get_agents() 2022-09-30 10:15:18 -04:00
Mike Salvatore 61bda27d7f UT: Fix bug in test_handle_ping_scan_event test 2022-09-30 09:50:17 -04:00
Mike Salvatore 2142dce97e Island: Don't handle TypeError in handle_ping_scan_event 2022-09-30 09:49:54 -04:00
Shreya Malviya 0a11d34fb7 UT: Assert mock_agent_event_queue.publish's call args in test_tcp_scanner.py 2022-09-30 18:57:29 +05:30
Shreya Malviya 0bf9309e07 UT: Assert mock_agent_event_queue.publish's call counts in test_tcp_scanner.py 2022-09-30 18:57:29 +05:30
Shreya Malviya bab4ebc2bc Agent: Add 'source' field when creating TCPScanEvent in TCP scanner 2022-09-30 18:57:29 +05:30
Shreya Malviya 35d3038bc8 Agent: Create TCPScanEvent and return from _generate_tcp_scan_event() in TCP scanner 2022-09-30 18:57:29 +05:30
Shreya Malviya 58ddd6e47d Agent: Partially implement publishing TCPScanEvent in TCP scanner 2022-09-30 18:57:29 +05:30
Shreya Malviya a3ca21481e Agent: Add missing/fix existing type hints in TCP scanner 2022-09-30 18:57:29 +05:30
Mike Salvatore fa18cb72da Common: Use NetworkPort in ExploitationOptionsConfiguration 2022-09-30 09:15:50 -04:00
Mike Salvatore 1a01b7c5dc Common: Use NetworkPort in TCPScanConfiguration 2022-09-30 09:14:22 -04:00
Mike Salvatore 5fc4d52d9f Common: Allow 0 for NetworkPort
While TCP port 0 is reserved and you're not supposed to use it, it is a
valid port.
2022-09-30 09:12:25 -04:00
Mike Salvatore 9f3aaf970f Island: Remove disused/emtpy monkey_control package 2022-09-30 07:33:48 -04:00
VakarisZ 61d7050594
Merge pull request #2368 from guardicore/2268-update-nodes
2268 update nodes
2022-09-30 13:58:22 +03:00
vakarisz 7ed071b565 Common: Fix imports in ping_scan_event.py 2022-09-30 09:47:20 +03:00
Mike Salvatore 5ab47fbdd3
Merge pull request #2373 from guardicore/2267-tcp-scan-event
2267 tcp scan event
2022-09-29 19:06:32 -04:00
Kekoa Kaaikala a267f02ca9 Island: Move param docstring to __call__ method 2022-09-29 19:47:32 +00:00
Kekoa Kaaikala c1dcb285ae UT: Properly group arrange/assert/act steps 2022-09-29 19:47:23 +00:00
Mike Salvatore f94ef035d6
Merge pull request #2374 from guardicore/2267-island-event-queue-threadsafe
2267 island event queue threadsafe
2022-09-29 15:43:45 -04:00
Mike Salvatore 31c97faf98
Merge pull request #2375 from guardicore/2267-tcp-scanner-accept-iagenteventqueue
2267 tcp scanner accept iagenteventqueue
2022-09-29 15:41:48 -04:00
Mike Salvatore c632b9b77b Island: Rename dest -> target 2022-09-29 15:09:29 -04:00
Mike Salvatore 2aa79331e3 Island: Extract method to improve readablility 2022-09-29 15:05:46 -04:00
Mike Salvatore 052c31e8ff Agent: Modify scan_tcp_ports() to accept an IAgentEventQueue 2022-09-29 14:45:24 -04:00
Kekoa Kaaikala c06d06edc4 UT: Fix storageerror test 2022-09-29 18:34:46 +00:00
Kekoa Kaaikala 783cc06c0d Common: Mitigate mypy errors from DIContainer 2022-09-29 18:34:46 +00:00
Kekoa Kaaikala 9a880123da UT: Fix failing tests 2022-09-29 18:34:46 +00:00
Kekoa Kaaikala d811c6548c Island: Prefer existing OS data to ping OS data
Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2022-09-29 18:34:46 +00:00
vakarisz 9b30770777 Island: Fix ping scan handler to add machines IP 2022-09-29 18:34:46 +00:00
vakarisz ff2b04c703 Common: Override target for PingScanEvent to more specific type hint 2022-09-29 18:34:46 +00:00