Ilija Lazoroski
28ca462ce5
Common: Add TCPScanEvent to agent events
2022-09-29 13:19:25 -04:00
Ilija Lazoroski
f62ab10d1c
Common: Add NetworkPort type
2022-09-29 13:17:50 -04:00
Mike Salvatore
8ae11e9faa
Common,Agent: Move PortStatus to common.types
2022-09-29 13:15:03 -04:00
Ilija Lazoroski
18f8594deb
Agent: Use common.PortStatus instead of i_puppet.PortStatus
2022-09-29 13:13:36 -04:00
Ilija Lazoroski
c32013bf87
Common: Add PortStatus enum
2022-09-29 13:13:25 -04:00
Ilija Lazoroski
725c6d9419
UT: Make string ports to be integers
...
Pydantic converts strings to integer but if we enter
integers is safer.
2022-09-29 13:12:04 -04:00
Mike Salvatore
1b7c3be65b
Island: Add missing return types
2022-09-29 12:43:23 -04:00
Mike Salvatore
82e08ba157
Island: Pass the same lock to agent and island event queues
...
Subscribers to the Agent and Island event queues manipulate some of the
same data structures. Sharing the same lock between the queues allows
this to happen in a thread-safe manner.
2022-09-29 12:40:18 -04:00
Mike Salvatore
00d72390ff
Common: Accept a lock in LockingIslandEventQueueDecorator's constructor
2022-09-29 12:39:57 -04:00
Mike Salvatore
3344300f84
Common: Accept a lock in LockingAgentEventQueueDecorator's constructor
2022-09-29 12:39:17 -04:00
Mike Salvatore
91375cdff2
Island: Register a thread-safe IAgentEventQueue
2022-09-29 12:21:28 -04:00
Mike Salvatore
5d893d64cd
Common: Add LockingAgentEventQueueDecorator
2022-09-29 12:16:00 -04:00
Mike Salvatore
cb7add7e59
Island: Register a thread-safe IIslandEventQueue
2022-09-29 12:12:20 -04:00
Mike Salvatore
8ee14c4564
Island: Add LockingIslandEventQueueDecorator
2022-09-29 12:12:19 -04:00
Mike Salvatore
67c78abee1
Island: Add docstring to PyPubSubIslandEventQueue
2022-09-29 11:50:43 -04:00
Mike Salvatore
17017d6962
UT: Add missing SocketAddress tests for invalid ports
2022-09-29 11:37:54 -04:00
Mike Salvatore
64b9432bb9
UI: Capitalize "Agent" in info_box_scan_my_metworks
2022-09-29 09:21:12 -04:00
Ilija Lazoroski
66e8032ef3
UT: Replace call_args comparison with assert_called_with in test_ping_scanner
2022-09-29 13:45:59 +02:00
Mike Salvatore
2ab86fa428
UT: Remove patch_get_agent_id()
...
1. This fixture was never actually executing
2. get_agent_id() always returns the same value (per process). This
means that _get_ping_scan_event() and the ping scanner will receive
the same value for any given test. In other words, mocking it is
unnecessary.
2022-09-29 07:39:57 -04:00
Shreya Malviya
03ebdd461f
UT: Check that correct events are published in test_ping_scanner.py
2022-09-29 15:34:07 +05:30
Shreya Malviya
d78615fa92
UT: Add _get_ping_scan_event()to test_ping_scanner.py
2022-09-29 15:30:12 +05:30
Shreya Malviya
9f15bea5bd
UT: Extract data to variables HOST_IP and TIMEOUT in test_ping_scanner.py
2022-09-29 15:27:55 +05:30
Shreya Malviya
a65bbc592d
UT: Check that publish is being called with expected event in test_linux_ping_success
2022-09-29 15:23:57 +05:30
Mike Salvatore
2eee427901
Agent: Generate PingScanEvent timestamp closer to ping command
2022-09-29 14:29:53 +05:30
Mike Salvatore
0cd8cd577d
UT: Remove unnecessary tests from test_ping_scan_event.py
...
These tests are unnecessary because we will not use json() to convert to
JSON.
2022-09-29 14:29:53 +05:30
Mike Salvatore
6390993875
UT: Handle ValueError in test_construct_invalid_field__value_error()
2022-09-29 14:29:53 +05:30
Mike Salvatore
d3c9691dfe
UT: Add assertion to PingScanEvent serialization tests
2022-09-29 14:29:53 +05:30
Ilija Lazoroski
14f8014709
Agent: Save correct event timestamp in ping_scanner
2022-09-29 14:29:53 +05:30
Ilija Lazoroski
d235e7a19e
UT: Add unit tests for PingScanEvent
2022-09-29 14:29:53 +05:30
Ilija Lazoroski
478ea05fa9
Common: Override target in PingScanEvent
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
aa2b49bc66
Agent: Seperate the generation of PingScanEvents
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
3202bfa2c1
Common: Flatten out PingScanEvent
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
228ce9bae1
Agent: Publish PingScanEvent from ping_scanner
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
0357d43d33
Agent: Accept IAgentEventQueue in Puppet constructor
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
ec56b15219
Agent: Pass IAgentEventQueue to the Puppet
2022-09-29 14:29:52 +05:30
Mike Salvatore
ba0ffeacce
Agent: Change method order
2022-09-29 14:29:52 +05:30
Mike Salvatore
082bb3bb6f
Agent: Return a sequence from InfectionMonkey._build_server_list()
2022-09-29 14:29:52 +05:30
Mike Salvatore
5e129fd137
Agent: Use set comprehension instead of set(list())
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
acf877f3d8
Common: Remove default from PingScanEvent
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
a44f763fab
Common: Remove default from AbstractAgentEvent source field
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
9ada95c126
Agent: Return set when building server list
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
799aae4498
Common: Add default to PingScanEvent
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
b1b9eb394e
Common: Add default to source in AbstractAgentEvent
2022-09-29 14:29:52 +05:30
Ilija Lazoroski
89397d8cbd
Agent: Rename event_queue to agent_event_queue
2022-09-29 14:29:52 +05:30
Mike Salvatore
83f0ebfda4
Merge pull request #2356 from guardicore/2299-local-network-scan-ui-tooltip
...
Info box in UI for Scan Agent's networks
2022-09-28 15:41:09 -04:00
Mike Salvatore
e8449817ad
Island: Reword Scan Agent's networks tool tip wording
2022-09-28 15:38:05 -04:00
Mike Salvatore
ff8c8bd0a0
Agent: Use PUT instead of POST to send agent logs
2022-09-28 15:24:46 -04:00
Kekoa Kaaikala
ab919f6d57
UI: Use colors from existing warning theme
2022-09-28 19:21:09 +00:00
Mike Salvatore
87d25d2ac8
Agent: Remove disused send_log() from ControlClient
2022-09-28 15:15:32 -04:00
Mike Salvatore
fab67d893f
Agent: Call IIslandAPIClient.send_log() directly
...
ControlClient is going away. It's been replaced by IIslandAPIClient.
Now is a good time to remove ControlClient.send_log()
2022-09-28 15:11:42 -04:00
Mike Salvatore
a1516535f9
Agent: Add InfectionMonkey._agent_id attribute
2022-09-28 15:08:59 -04:00
Shreya Malviya
21f01292f7
Agent: Fix type hint in IIslandAPIClient.send_log()
2022-09-28 15:03:32 -04:00
Shreya Malviya
8dc8a516d5
Agent: Fix type hint in HTTPIslandAPIClient.send_log()
2022-09-28 15:03:32 -04:00
Shreya Malviya
29c08ff40c
Agent: Simplify logic for sending logs in ControlClient
2022-09-28 15:03:32 -04:00
Shreya Malviya
8e3918cebe
UT: Fix island_api_client.send_log() calls in test_http_island_api_client.py
2022-09-28 15:03:32 -04:00
Shreya Malviya
539f4e1c82
Agent: Fix self._island_api_client.send_log() call in ControlClient
2022-09-28 15:03:32 -04:00
Shreya Malviya
74e30a2f88
Agent: Update API endpoint in HTTPIslandAPIClient.send_log()
2022-09-28 15:03:32 -04:00
Shreya Malviya
a9e1b99f2f
Agent: Add agent_id parameter to IIslandAPIClient.send_log()
2022-09-28 15:03:32 -04:00
Mike Salvatore
4f3fd6987e
Merge branch '2274-implement-new-agent-logs-endpoint' into develop
...
PR #2365
2022-09-28 14:19:21 -04:00
Kekoa Kaaikala
2f7f4fef9c
UI: Fix warning icon spacing
2022-09-28 18:18:35 +00:00
Mike Salvatore
05b8f2bb4b
Agent: Fix typo occured -> occurred
2022-09-28 14:17:04 -04:00
Mike Salvatore
f7f4440b61
Island: Fix typo occured -> occurred
2022-09-28 14:15:41 -04:00
Mike Salvatore
93b0fe0f6e
UT: Fix UnknownRecordError message in InMemoryAgentLogRepository
2022-09-28 14:10:30 -04:00
Kekoa Kaaikala
09cf2762f9
UI: Use yellow warning icon
2022-09-28 18:07:31 +00:00
Mike Salvatore
c69a414a4d
Island: Fix typo occured -> occurred
2022-09-28 14:06:09 -04:00
Mike Salvatore
2e8afe218e
UT: Add test of multiple agent logs
2022-09-28 14:00:16 -04:00
Kekoa Kaaikala
4038622e83
UI: Remove redundant info from info box
2022-09-28 17:55:53 +00:00
Kekoa Kaaikala
05e9c2af62
UI: Add WarningBox
2022-09-28 17:40:56 +00:00
Mike Salvatore
412a58f1f2
UT: Use InMemoryFileRepository in test_file_agent_log_repository.py
2022-09-28 13:30:01 -04:00
Mike Salvatore
bddee026fe
UT: Add InMemoryFileRepository
2022-09-28 13:29:34 -04:00
Mike Salvatore
20d5fb3748
Island: Use re.Pattern for IFileRepository.delete_files_by_regex()
2022-09-28 13:29:07 -04:00
Mike Salvatore
0e2d82a7ad
UT: Add comment
2022-09-28 12:57:21 -04:00
Mike Salvatore
35d0cbc3b0
UT: Add type hints to test_file_agent_log_repository.py
2022-09-28 12:55:58 -04:00
Mike Salvatore
d49d16bc37
Island: Allow RepositoryErrors to be reraised
...
Previously, FileAgentLogRepository.get_agent_log() wrapped all errors as
RetrievalError, which is not necessarily correct. This commit allows all
repository errors raised by IFileRepository to be reraised, and all
other, unexpected errors to be reraised as RetrievalError.
2022-09-28 12:54:45 -04:00
Mike Salvatore
3c2ee32bdf
Island: Add RepositoryError
2022-09-28 12:21:41 -04:00
Ilija Lazoroski
10954e0a6e
Island: Use UUID for AgentSignals endpoint parameter
2022-09-28 16:45:28 +02:00
Ilija Lazoroski
1a8306af1b
Island: Change log level in AgentLogs endpoint
2022-09-28 16:43:33 +02:00
Ilija Lazoroski
d0293b4edc
UT: Move and rename StubAgentLogRepository to InMemoryAgentLogRepository
2022-09-28 16:42:23 +02:00
Ilija Lazoroski
e4d45b25cb
Island: AgentLogs.GET to return 404 if not agent log is found
2022-09-28 16:42:23 +02:00
Ilija Lazoroski
96662f3f66
UT: Fix AgentLogs tests
2022-09-28 16:41:30 +02:00
Ilija Lazoroski
b705e33af3
Island: Add AgentID type for agent_id to AgentLogs endpoint
2022-09-28 16:41:30 +02:00
Shreya Malviya
e374341ce1
UT: Fix tests in test_file_agent_log_repository.py
2022-09-28 20:01:13 +05:30
Shreya Malviya
8f46b3b9fd
Island: Make FileNotFoundError inherit UnknownRecordError instead of RetrievalError + add TODO for updating the rest of the code
2022-09-28 19:55:52 +05:30
Shreya Malviya
64990eea0e
UT: Update tests as per changes to file repositories
2022-09-28 19:50:17 +05:30
Shreya Malviya
7823759cf8
Island: delete_files_by_pattern -> delete_files_by_regex
2022-09-28 19:50:17 +05:30
Shreya Malviya
2707605622
Island: Add AGENT_LOG_FILE_NAME_REGEX and modify some logic in FileAgentLogRepository
2022-09-28 19:50:13 +05:30
Shreya Malviya
1c486c6571
Island: Modify delete_files_by_pattern -> delete_files_by_regex in LocalStorageFileRepository
2022-09-28 19:27:25 +05:30
Mike Salvatore
fa13ca8df8
Island: Rename agent_log -> log_contents
2022-09-28 09:31:38 -04:00
Shreya Malviya
c5d26749b7
Island: Change agent log file name in FileAgentLogRepository
2022-09-28 18:29:53 +05:30
Shreya Malviya
30d3124cb4
UT: Fix assert logic in test_delete_files_by_pattern()
2022-09-28 18:28:05 +05:30
Ilija Lazoroski
546c44f501
UT: Add tests for AgentLogs endpoint
2022-09-28 14:55:37 +02:00
Ilija Lazoroski
89ae9824d0
Island: Add the new AgentLogs endpoint to the island
2022-09-28 14:53:24 +02:00
Ilija Lazoroski
543c063f7b
Island: Add AgentLogs endpoint
2022-09-28 14:52:19 +02:00
Shreya Malviya
f61e734d29
Island: Subscribe IAgentLogRepository.reset() to IslandEventTopic.CLEAR_SIMULATION_DATA
2022-09-28 17:53:30 +05:30
Shreya Malviya
cadf0d61d0
Island: Implement delete_files_by_pattern() in FileRepositoryCachingDecorator
2022-09-28 16:26:37 +05:30
Shreya Malviya
5f11008b40
Island: Implement delete_files_by_pattern() in FileRepositoryLockingDecorator
2022-09-28 16:25:13 +05:30
Shreya Malviya
d5b62651a0
Island: Implement delete_files_by_pattern() in FileRepositoryLoggingDecorator
2022-09-28 16:23:47 +05:30
Shreya Malviya
885a907287
UT: Add tests for delete_files_by_pattern() in LocalStorageFileRepository
2022-09-28 16:21:09 +05:30
Shreya Malviya
6aae63f9fc
UT: Add tests for FileAgentLogRepository
2022-09-28 16:10:55 +05:30
Shreya Malviya
c1a4641ffe
UT: Add delete_files_by_pattern() to SingleFileRepository and MockFileRepository
2022-09-28 16:10:30 +05:30
Shreya Malviya
e1d139fde4
Island: Add FileAgentLogRepository to cc/repository/__init__.py
2022-09-28 16:03:08 +05:30
Shreya Malviya
01d8875f22
Island: Register FileAgentLogRegister in DI container
2022-09-28 15:42:07 +05:30
Shreya Malviya
1c6cfa1ce6
Island: Add FileAgentLogRepository
2022-09-28 15:39:57 +05:30
Shreya Malviya
ce0affb1ed
Island: Implement delete_files_by_pattern() in LocalStorageFileRepository
2022-09-28 15:39:14 +05:30
Shreya Malviya
d9b55a5c21
Island: Add delete_files_by_pattern() to IFileRepository
2022-09-28 15:35:58 +05:30
Shreya Malviya
8a96598d10
UI: Remove trailing comma in SCAN_TARGET_CONFIGURATION_SCHEMA
2022-09-28 13:08:03 +05:30
Shreya Malviya
98d01b5324
UI: Reword in SCAN_TARGET_CONFIGURATION_SCHEMA's info_box_scan_my_networks
2022-09-28 12:52:49 +05:30
Shreya Malviya
793a401a33
UI: Move and reword description in SCAN_TARGET_CONFIGURATION_SCHEMA
2022-09-28 12:43:01 +05:30
Shreya Malviya
e32d5555fb
UI: Move segmentation section in network configuration to the end
2022-09-28 12:36:12 +05:30
Ilija Lazoroski
d7be8e2bc0
Island: Remove `log_contents` from Agent model
2022-09-27 12:52:24 -04:00
Kekoa Kaaikala
bf7544c47a
Common: Disable scan_my_networks by default
2022-09-27 15:43:43 +00:00
Kekoa Kaaikala
036a382e95
Merge pull request #2354 from guardicore/2323-use-socketaddress-in-running_on_island
...
2323 use socketaddress in running on island
2022-09-27 09:44:04 -04:00
VakarisZ
9823301c3b
Merge pull request #2348 from guardicore/2299-rename-local-network-scan
...
Island: Rename local_network_scan
2022-09-27 16:00:36 +03:00
Shreya Malviya
085883d3a6
UI: Add info box for "Scan Agent's networks" option in configuration
2022-09-27 18:08:36 +05:30
Shreya Malviya
4f3a8a5b2f
Agent: Simplify logic in _build_server_list() in monkey/infection_monkey/monkey.py
...
Co-authored-by: VakarisZ <36815064+VakarisZ@users.noreply.github.com>
2022-09-27 17:17:09 +05:30
Shreya Malviya
3accaccceb
Agent: Simplify logic to set self._island_address in InfectionMonkey
2022-09-27 17:06:42 +05:30
Kekoa Kaaikala
c33189725d
Agent: Update ControlClient to use SocketAddress
2022-09-27 17:01:47 +05:30
Kekoa Kaaikala
19dbf81fa3
Agent: Fix mypy issue
2022-09-27 17:01:39 +05:30
Shreya Malviya
80328159f0
Agent: Change return type hint of _get_segmentation_check_targets() to be more specific
2022-09-27 16:30:28 +05:30
Shreya Malviya
01f1d62272
UT: Simplify logic in test data in test_http_island_api_client.py
2022-09-27 16:19:23 +05:30
Shreya Malviya
6d63f3c378
Agent: Fix some logic caused by rebase
2022-09-27 16:17:04 +05:30
Kekoa Kaaikala
aeef2cdcbe
Agent: Update send_remove_from_waitlist_control_message_to_relays
...
Update send_remove_from_waitlist_control_message_to_relays to use
SocketAddress
2022-09-27 15:37:57 +05:30
Kekoa Kaaikala
af8d3937be
Agent: Use correct return type for _connect_to_island_api
2022-09-27 15:37:36 +05:30
Kekoa Kaaikala
110542eeb8
Common: Make SocketAddress hashable
2022-09-27 15:34:13 +05:30
Kekoa Kaaikala
c4804f06a9
Agent: Use SocketAddress in IIslandAPIClient
2022-09-27 15:33:28 +05:30
ilija-lazoroski
90890106f7
Merge pull request #2355 from guardicore/2268-pingscanevent
...
2268 pingscanevent
2022-09-27 10:58:20 +02:00
vakarisz
e2f0a2dfc0
Common: Improve comment's readability in agent_sub_configurations.py
2022-09-27 11:51:27 +03:00
vakarisz
b9cf200832
Agent: Change return typehint to be more specific
2022-09-27 11:50:20 +03:00
Ilija Lazoroski
7bb7ef7dce
Common: Export PingScanEvent from __init__
2022-09-27 10:49:40 +02:00
vakarisz
182a566087
Agent: Simplify scan_target_generator.py
...
The responsibility of type-hints are not to implement logic. Implementing logic via type-hints diminishes readability, because it forces you to cross-reference a class instead of just exposing the logic where it's used
2022-09-27 11:33:30 +03:00
Shreya Malviya
9b4de6bab8
UT: Use SocketAddress.from_string() in test_handle_agent_registration.py
2022-09-27 13:11:13 +05:30
Shreya Malviya
d1199fdab2
Agent: Simplify relay disconnect logic in network/relay/utils.py
2022-09-27 13:06:29 +05:30
Shreya Malviya
441c14f15d
Use SocketAddress.from_string() in network/relay/utils.py
2022-09-27 12:56:10 +05:30
Shreya Malviya
1f80eac4b6
island: Remove unused import in cc/island_event_handlers/handle_agent_registration.py
2022-09-27 12:51:49 +05:30
Shreya Malviya
8b0ebfc3a7
UT: Add/modify tests as per SocketAddress related changes
2022-09-27 12:51:49 +05:30
Shreya Malviya
3b192a869e
UT: Replace test data with SocketAddress wherever required
2022-09-27 12:51:49 +05:30
Shreya Malviya
0ae653fb72
Agent: Let InfectionMonkey._cmd_island_port stay a str
...
No part of the code in InfectionMonkey requires _cmd_island_port to be an int now
2022-09-27 12:51:49 +05:30
Shreya Malviya
8a609e0871
Agent: Simplify logic in SocketAddress object creation in monkey.py and network/relay/utils.py
2022-09-27 12:51:49 +05:30
Shreya Malviya
6a29702846
Island: Modify cc_server type in Agent pydantic model
2022-09-27 12:51:49 +05:30
Shreya Malviya
284ec3d119
Agent: Use SocketAddress type in handle_agent_registration._get_or_create_cc_machine()
2022-09-27 12:51:49 +05:30
Shreya Malviya
ac633a6e75
Agent: Change argument in InfectionMonkey._register_agent() to type SocketAddress
2022-09-27 12:51:49 +05:30
Shreya Malviya
6df2c29e30
Common: Update cc_server's type in AgentRegistrationData to SocketAddress
2022-09-27 12:51:49 +05:30
Kekoa Kaaikala
311c294033
Agent: Fix mypy issues in scan_target_generator.py
2022-09-26 20:20:24 +00:00
Kekoa Kaaikala
1bf610a4a8
Agent: Fix missing names
2022-09-26 19:51:14 +00:00
Kekoa Kaaikala
87ca11962e
Common: Create PingScanEvent
2022-09-26 19:04:06 +00:00
Kekoa Kaaikala
d87cf5a9f5
Agent: Fix mypy issues in test_propagator.py
2022-09-26 18:54:26 +00:00
Kekoa Kaaikala
aeb6630ebc
Agent: Move PingScanData to common
2022-09-26 18:52:23 +00:00
Kekoa Kaaikala
dd5b796bfe
Agent: Convert PingScanData to dataclass
2022-09-26 17:48:27 +00:00
Kekoa Kaaikala
6f095eb0c1
Merge pull request #2350 from guardicore/2323-parse-servers-as-socketaddress
...
2323 parse servers as socketaddress
2022-09-26 10:44:18 -04:00
vakarisz
9728d22250
Agent, Island: Rename scan_local_interfaces to scan_my_networks
...
"scan_my_networks" is the shortest way to convey that networks the machine belongs to will get scanned
2022-09-26 16:14:47 +03:00
Kekoa Kaaikala
8b8ef79e0a
Common: Move SocketAddress function into the class
...
Moved socketaddress_from_string into SocketAddress.from_string
2022-09-26 12:32:00 +00:00
Shreya Malviya
a093a3e527
Agent: Use default str representation of SocketAddress in log message in notify_disconnect()
2022-09-26 16:49:42 +05:30
Shreya Malviya
4c76543a28
Agent: Use SocketAddress in notify_disconnect() in network relay utils
2022-09-26 13:44:40 +05:30
Shreya Malviya
105a2b39cf
Agent: Add SocketAddress type variable in _send_remove_from_waitlist_control_message_to_relay()
2022-09-26 13:38:13 +05:30
Shreya Malviya
0db0347008
Agent: Use SocketAddress in TCPPipeSpawner
2022-09-26 13:30:30 +05:30
Shreya Malviya
426647c5b9
Agent: Use SocketAddress in TCPRelay
2022-09-26 13:07:47 +05:30
Kekoa Kaaikala
53a9c62245
Agent: Parse --servers to SocketAddress
2022-09-23 17:57:53 +00:00
Kekoa Kaaikala
4982999b99
Common: Add function to parse SocketAddress
2022-09-23 17:54:49 +00:00
Mike Salvatore
6c63d4edbd
Agent: Remove unused "Option" from i_island_api_client.py
2022-09-23 12:57:09 -04:00
vakarisz
b11cd9c5f1
Island: Remove agent controls
...
Agent controls are being replaced by agent signal events
2022-09-23 12:56:13 -04:00
Mike Salvatore
a49ddf7a4a
Merge pull request #2347 from guardicore/2261-move-agent-signals-to-common
...
2261 move agent signals to common
2022-09-23 12:56:13 -04:00
Mike Salvatore
feb8288c98
Agent: Pass the correct agent ID to ControlChannel
2022-09-23 12:56:13 -04:00
Mike Salvatore
f7198ea98a
UT: Add proper test for ControlChannel.should_agent_stop()
2022-09-23 12:56:13 -04:00
Mike Salvatore
a5f1117ce3
Island: Fix grammar in docstring
...
Co-authored-by: Kekoa Kaaikala <kekoa.kaaikala@gmail.com>
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
a314efb8d9
Agent: Reword get_agent_signals docstring
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
e5c5cce94e
Agent: Modify should_agent_stop to use AgentSignals model
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
d1fc4fa7f4
UT: Parametrize HTTPIslandAPIClient get_agent_signals test
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
6299529f4a
Island: Modify HTTPIslandAPIClient.get_agent_signals to return
...
AgentSignals
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
edf0593d4a
Agent: Remove should_agent_stop from HTTPIslandAPIClient
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
a2be330d16
Island: IIslandAPIClient.get_agent_signals to return AgentSignals
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
67956358bd
Agent: Remove shoudl_agent_stop from IIslandAPIClient
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
7a9ac1a6ba
UT: Fix AgentSignals endpoint tests to use common.agent_signals
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
3da90223fc
Agent: Use IIslandAPIClient.get_agent_signals in ControlChannel
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
ffa5f90cbd
Island: Use common.agent_signals in AgentSignalsService
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
88c011e883
Agent: Implement IIslandAPIClient.get_agent_signals in
...
HTTPIslandAPIClient
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
296f4e55df
Common, Island: Move AgentSignals model to Common
2022-09-23 12:56:13 -04:00
Ilija Lazoroski
a3d94d7a49
Agent: Add get_agent_signals to IIslandAPIClient
2022-09-23 12:56:11 -04:00
Shreya Malviya
dee2884144
UT: Move test_agent_signals.py and test_terminate_all_agents.py under cc/resources/agent_signals/
2022-09-23 12:54:49 -04:00
Shreya Malviya
1dc72e45e7
UT: Remove unnecessary wrapper around pytest fixture flask_client in test_terminate_all_agents.py and test_agent_signals.py
2022-09-23 12:54:49 -04:00
Shreya Malviya
c4642141f0
Island: Move terminate_all_agents.py and terminate_all_agents.py under cc/resources/agent_signals/
2022-09-23 12:54:49 -04:00
Shreya Malviya
850857c8a1
UI: '/api/terminate-all-agents' -> '/api/agent-signals/terminate-all-agents'
2022-09-23 12:54:49 -04:00
Shreya Malviya
b666078e7d
Island: '/api/terminate-all-agents' -> '/api/agent-signals/terminate-all-agents'
2022-09-23 12:54:49 -04:00
Shreya Malviya
066f106882
UT: Move relevant tests from test_agent_signals.py to test_terminate_all_agents.py
2022-09-23 12:54:49 -04:00
Shreya Malviya
645e03e46f
Island: Import TerminateAllAgents in cc/resources/__init__.py
2022-09-23 12:54:49 -04:00
Shreya Malviya
105cc60f4b
Island: Remove POST method from AgentSignals resource
2022-09-23 12:54:49 -04:00
Shreya Malviya
7527eca861
UI: '/api/agent-signals/terminate-all' -> '/api/terminate-all-agents'
2022-09-23 12:54:49 -04:00
Shreya Malviya
2864286a29
Island: Add TerminateAllAgents resource
2022-09-23 12:54:49 -04:00
Shreya Malviya
28c3cf581f
UT: Add test cases for AgentSignal resource's POST
2022-09-23 12:54:49 -04:00
Shreya Malviya
24210d4f6f
Island: Add check that terminate timestamp is > 0 in AgentSignals resource
2022-09-23 12:54:49 -04:00
Shreya Malviya
11f443e641
UT: 'kill_time' -> 'terminate_time'
2022-09-23 12:54:49 -04:00
Shreya Malviya
489ead31d2
Island: 'kill_time' -> 'terminate_time'
2022-09-23 12:54:49 -04:00
Shreya Malviya
fbfebc6167
UI: 'kill_time' -> 'terminate_time'
2022-09-23 12:54:49 -04:00
Shreya Malviya
14c615e238
Island: Rename some variables in test_agent_signals.py
2022-09-23 12:54:49 -04:00
Ilija Lazoroski
2d42355e2c
UT: Add tests for GET AgentSignals endpoint
2022-09-23 12:54:49 -04:00
Ilija Lazoroski
41951511d0
Island: Add simplify=true when returning AgentSignals in endpoint
2022-09-23 12:54:49 -04:00
Shreya Malviya
ef273bc1cf
Island: Remove set_stop_all()
2022-09-23 12:54:49 -04:00
Shreya Malviya
637978648a
Island: Remove StopAllAgents resource
2022-09-23 12:54:49 -04:00
Shreya Malviya
bc43f81a11
UI: Use /api/agent-signals/terminate-all instead of /api/monkey-control/stop-all-agents
2022-09-23 12:54:49 -04:00
Shreya Malviya
5bf63c1221
UT: Fix POST tests in test_agent_signals.py
2022-09-23 12:54:49 -04:00
Shreya Malviya
1afe625395
Island: Catch KeyError in AgentSignals resource's POST
2022-09-23 12:54:49 -04:00