p34709852
994f7de8e3
Update README.md
2022-10-12 13:27:11 +08:00
wutao
dedde27c8c
11222223333
2022-10-11 15:35:25 +08:00
wutao
1d0f3c8e50
测试1111111111
2022-10-11 14:38:05 +08:00
wutao
25054d8479
Merge branch 'develop' of http://111.8.36.180:3000/p15670423/monkey into develop
2022-10-11 14:37:24 +08:00
wutao
5273769ca7
测试
2022-10-11 14:37:03 +08:00
p15670423
c4b2f4d171
Delete 'test_dumps03.py'
2022-10-11 14:01:23 +08:00
p15670423
bfe3e6da58
Delete 'test_dumps01.py'
2022-10-11 14:01:10 +08:00
p15670423
dbab067af5
Delete 'test03.txt'
2022-10-11 14:00:54 +08:00
p15670423
453dd67e03
Delete 'requirements.txt'
2022-10-11 14:00:45 +08:00
p15670423
386bbf84b2
ddfyas
...
ysdf
Co-authored-by: p15670423 <p15670423@example.org>
Co-committed-by: p15670423 <p15670423@example.org>
2022-10-11 14:00:25 +08:00
p15670423
4cd9fd289e
Delete 'test_dumps03.py'
2022-10-11 13:59:36 +08:00
p15670423
ffdf699f32
Delete 'test_dumps01.py'
2022-10-11 13:59:26 +08:00
p15670423
036742925c
Delete 'test03.txt'
2022-10-11 13:59:16 +08:00
p15670423
017d109a77
Delete 'requirements.txt'
2022-10-11 13:58:46 +08:00
p15670423
14ea13c6ee
ces
...
ceees
Co-authored-by: p15670423 <p15670423@example.org>
Co-committed-by: p15670423 <p15670423@example.org>
2022-10-11 13:56:30 +08:00
p15670423
00034313b1
Delete 'test03.txt'
2022-10-11 13:55:26 +08:00
p34709852
bef6e2c37f
ADD file via upload
2022-10-11 13:50:14 +08:00
p34709852
f10c9f7e29
Delete 'requirements.txt'
2022-10-11 13:48:45 +08:00
p34709852
b0d3201186
Delete 'test_dumps03.py'
2022-10-11 13:47:11 +08:00
p15670423
73cc1994d9
Update test_dumps03.py
2022-10-11 13:42:14 +08:00
p15670423
9208f6691d
Update requirements.txt
2022-10-11 13:41:56 +08:00
p15670423
73a326a3e3
no-ff
...
no-ff方式。。。。。。。。。。。
2022-10-11 13:30:17 +08:00
p15670423
4188bb507c
Update test_dumps03.py
2022-10-11 13:30:17 +08:00
p34709852
7985a6b07f
Add requirements.txt
2022-10-11 13:30:17 +08:00
p34709852
c8859701c8
ADD file via upload
2022-10-11 13:30:17 +08:00
p34709852
880a2d68e8
Delete 'test_dumps01.py'
2022-10-11 13:28:20 +08:00
p34709852
a47ca4dac8
ADD file via upload
2022-10-11 11:36:11 +08:00
p15670423
f803f88afc
确认合并
...
测试,,,,,,,,,,,,,,,,,,
2022-10-11 09:55:06 +08:00
p34709852
09b3b42dc5
ADD file via upload
2022-10-10 14:48:05 +08:00
p31829507
de18b55417
Add test_dumps.py
2022-10-10 14:39:32 +08:00
p31829507
9071fc90aa
Add test_dumps
2022-10-10 14:38:31 +08:00
wutao
4505399049
测试:重复提交代码
2022-10-10 13:40:54 +08:00
wutao
f5bfdc430c
测试:提交代码
2022-10-10 13:36:32 +08:00
wutao
0382831701
测试:提交代码
2022-10-10 13:34:44 +08:00
Mike Salvatore
04fec93c39
Merge branch '2269-publish-events-from-hadoop-exploiter' into develop
...
PR #2396
2022-10-07 09:37:37 -04:00
Ilija Lazoroski
7a664218bd
Agent: Check all potential urls in Hadoop
2022-10-07 15:13:04 +02:00
Mike Salvatore
6d60e33c1e
Merge branch '2269-publish-events-for-mssql-exploiter' into develop
...
PR #2401
2022-10-07 08:46:40 -04:00
Mike Salvatore
a558948c5d
Agent: Remove unnecessary `pass` from MSSQLExploiter
2022-10-07 08:43:05 -04:00
Mike Salvatore
66f5d7a86a
Agent: Remove errant exploitation event from hadoop
...
If no potential URLs are found, then no exploit is attempted, so there's
no reason to publish an ExploitationEvent.
2022-10-07 08:35:24 -04:00
Shreya Malviya
3b225a9c7d
Merge pull request #2376 from guardicore/dependabot/npm_and_yarn/monkey/monkey_island/cc/ui/d3-color-and-d3-3.1.0
...
Bump d3-color and d3 in /monkey/monkey_island/cc/ui
2022-10-07 18:01:53 +05:30
Mike Salvatore
79e8ce5f79
Island: Pass tuple, not set to upsert_tcp_connections()
...
pydantic can probably handle the set -> tuple conversion itself, but
mypy complains.
2022-10-07 07:44:49 -04:00
Mike Salvatore
0965b97d45
Island: Use ScanEvent for typehint in ScanEventHandler
...
`event` gets passed to `_get_source_machine()`, which expects
`ScanEvent`, not `AbstractAgentEvent`
2022-10-07 07:43:50 -04:00
Mike Salvatore
4c026241ea
Island: Change method order in ScanEventHandler
2022-10-07 07:41:50 -04:00
Ilija Lazoroski
25073be9f3
Agent: Remove adding vulnerable urls in Hadoop
...
Adding vulnerable ulrs causes check to see if the target is exploitable
which calls self.exploit
2022-10-07 11:46:35 +02:00
Ilija Lazoroski
c02d43556a
Agent: Make Hadoop tags uppercase
2022-10-07 11:46:35 +02:00
Ilija Lazoroski
8bdb30dcfb
Agent: Rename stamp to timestamp in Hadoop
2022-10-07 11:46:35 +02:00
Ilija Lazoroski
8f6df12d9c
Agent: Modify HadoopExploiter tags to be properties
2022-10-07 11:46:35 +02:00
Kekoa Kaaikala
76a3cb0ba0
Agent: Stamp time before exploit executes
2022-10-07 11:46:35 +02:00
Kekoa Kaaikala
de5d365bb0
Agent: Publish events sooner
2022-10-07 11:46:35 +02:00
Kekoa Kaaikala
3e592cfa69
Agent: Use exploiter tag properties
2022-10-07 11:46:35 +02:00
Kekoa Kaaikala
4a0a24dde2
Agent: Update hadoop exploiter tags T1570 -> T1105
2022-10-07 11:46:35 +02:00
Kekoa Kaaikala
76ae57281d
Agent: Use EXPLOIT_TAGS for exploitation event
2022-10-07 11:46:35 +02:00
Kekoa Kaaikala
54b551b728
Agent: Update tags for hadoop events
2022-10-07 11:46:35 +02:00
Kekoa Kaaikala
c31aed94ea
Agent: Move successful explotiation event publish
2022-10-07 11:46:35 +02:00
Kekoa Kaaikala
bee1047024
Agent: Update hadoop failed event publishing
2022-10-07 11:46:34 +02:00
Kekoa Kaaikala
57af640317
Agent: Use correct publish method names
2022-10-07 11:46:34 +02:00
Ilija Lazoroski
9c185a3a78
Agent: Add tags and error messages in Hadoop
2022-10-07 11:46:34 +02:00
Ilija Lazoroski
fe864792f3
Agent: Publish Propagation and Exploitation events from Hadoop
2022-10-07 11:46:34 +02:00
VakarisZ
4709ae771b
Merge pull request #2400 from guardicore/2267-add-tcp-connections
...
2267 add tcp connections
2022-10-07 12:15:39 +03:00
vakarisz
be4ecccdcd
Island: Refactor get_node_by_id to raise UnknownRecordError
2022-10-07 10:05:06 +03:00
Mike Salvatore
77d37bdb21
Merge branch '2269-publish-events-from-log4shell-exploiter' into develop
...
PR #2397
2022-10-06 17:26:06 -04:00
Mike Salvatore
9c2cdf15e2
Agent: Add TODO in Log4ShellExploiter
2022-10-06 17:01:06 -04:00
Mike Salvatore
ead979c6ca
Agent: Add T1110 to Log4Shell exploiter tags
2022-10-06 16:54:02 -04:00
Mike Salvatore
03c6c5ea4b
Agent: Remove unnecessary Path -> str in Log4ShellExploiter
2022-10-06 16:51:14 -04:00
Mike Salvatore
eac3076828
Agent: Change typehint for build_monkey_commandline's location
...
The function can handle str, PurePath, or None. This typehint change
reflects that capability
2022-10-06 16:50:41 -04:00
Mike Salvatore
7bc9993c6f
Agent: Reduce VICTIM_WAIT_SLEEP_TIME_SEC to 0.050 seconds
...
1 second is a long time to wait, and we want our event timestamps to be
more accurate. 0.050 is 10 x sys.getswitchinterval(). It's reasonably
accurate but will also share the CPU nicely.
2022-10-06 16:46:41 -04:00
Mike Salvatore
6bd7042444
Agent: Add VICTIM_WAIT_SLEEP_TIME_SEC constant in log4shell exlpoiter
2022-10-06 16:42:33 -04:00
Mike Salvatore
d8fca72f28
Agent: Publish all prop/exploit events from _wait_for_victim()
2022-10-06 16:41:20 -04:00
Mike Salvatore
b2c5b22128
Merge branch '2269-publish-events-from-powershell-exploiter' into develop
...
PR #2402
2022-10-06 12:45:13 -04:00
Mike Salvatore
8e3bf96589
Agent: Convert plaintext to str()
...
get_plaintext() can return bytes. Convert the output to a str in
PowershellClient to avoid potential issues.
2022-10-06 12:40:50 -04:00
Mike Salvatore
65dd386603
Agent: Collect timestamp before powershell connect
2022-10-06 12:39:37 -04:00
Mike Salvatore
c4573673ce
Agent: Rename timestamp -> execute_agent_timestamp
2022-10-06 12:39:11 -04:00
Ilija Lazoroski
ac11d159fe
Agent: Revise Powershell publishing of events
2022-10-06 16:03:15 +02:00
Mike Salvatore
de9b5601d8
Merge branch 2269-publish-events-from-sshexec-exploiter into develop
...
PR #2395
2022-10-06 10:00:35 -04:00
Mike Salvatore
c980bfd915
Agent: Move timestamp closer to ssh.exec_command()
2022-10-06 09:57:11 -04:00
Mike Salvatore
52380a2513
Agent: Publish exploitation event on unexpected SSH exception
2022-10-06 09:55:53 -04:00
Mike Salvatore
39bada5bb1
Agent: Move assignment outside of try/except
2022-10-06 15:50:46 +02:00
Kekoa Kaaikala
3bca02af59
Agent: Fix powershell tests
2022-10-06 15:50:46 +02:00
Kekoa Kaaikala
7d535c72d9
Agent: Publish powershell exploitation events
2022-10-06 15:50:46 +02:00
Kekoa Kaaikala
3bede2f9d1
Agent: Publish propagation events
2022-10-06 15:50:46 +02:00
Kekoa Kaaikala
bb6716df18
Common: Add attack technique T1059
2022-10-06 15:50:46 +02:00
vakarisz
8503e0f499
UT: Remove unused test data structures
2022-10-06 15:02:13 +03:00
Ilija Lazoroski
ec617df06a
Agent: Fix LocketHTTPServer mypy error in MSSQLExploiter
2022-10-06 13:53:17 +02:00
vakarisz
0d246a0479
Island: Rename add_tcp_connections to upsert_tcp_connections
2022-10-06 14:49:11 +03:00
Ilija Lazoroski
47846628e6
Agent: Modify MSSQL tags to be properties
2022-10-06 13:47:11 +02:00
vakarisz
3bc2e4876f
Island: Handle missing node in add_tcp_connections
2022-10-06 14:45:56 +03:00
Kekoa Kaaikala
15974ff21c
Agent: Stamp time before running exploit
2022-10-06 13:37:26 +02:00
Kekoa Kaaikala
66f8471f24
Agent: Remove "summary" event
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
e404416363
Agent: Use exploit tag properties
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
5c6b1e3910
Common: Remove unused technique T1071
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
9269c8579c
Agent: Remove unneccessary technique
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
8317c03686
Agent: Add tags to MSSQL propagation events
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
aab965bad7
Common: Add attack technique T1071
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
fa8b721abe
Common: Add attack technique T1059
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
183bd1145f
Agent: Add tags to MSSQL exploitation events
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
33230e85f7
Agent: Use updated publish methods
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
2cd9d0086b
Agent: Fix mypy error in http_tools.py
2022-10-06 13:35:18 +02:00
Kekoa Kaaikala
8dd196122b
Agent: Publish events from MSSQLExploiter
2022-10-06 13:35:18 +02:00
vakarisz
b0ec035909
Island: Move tcp_connection addition to node repository
2022-10-06 14:31:12 +03:00
Ilija Lazoroski
0f3f45e92f
Agent: Modify Log4Shell tags to be properties
2022-10-06 13:26:48 +02:00
Kekoa Kaaikala
016bf5c795
Agent: Stamp times before the exploit runs
2022-10-06 13:24:03 +02:00
Kekoa Kaaikala
48e6e95271
Agent: Update propagation tags for log4shell
2022-10-06 13:22:38 +02:00
Kekoa Kaaikala
ac69064dec
Agent: Send failed exploitation event
2022-10-06 13:22:38 +02:00
Kekoa Kaaikala
0c4b90beb5
Agent: Fix typo
2022-10-06 13:22:38 +02:00
Ilija Lazoroski
c5d5418af4
Agent: Fix typo in t1203 attack technique in Log4Shell
2022-10-06 13:22:38 +02:00
Ilija Lazoroski
ef4a465515
Agent: Add tags to exploitation and propagation events in Log4Shell
2022-10-06 13:22:38 +02:00
Ilija Lazoroski
c5506f98e8
Agent: Publish Propagation and Exploitation events from Log4Shell
2022-10-06 13:22:38 +02:00
vakarisz
c90044074d
Island: Remove storage error when node wasn't modified
...
Upserting should throw an error when updating or inserting went wrong, not when a node is already up to date.
2022-10-06 14:21:13 +03:00
Ilija Lazoroski
95f1e3cb7b
Agent: Modify tags methods to be properties in SSHExploiter
2022-10-06 13:16:49 +02:00
Ilija Lazoroski
dcb08b2881
Agent: Convert IPv4Address to str when connecting to socket
2022-10-06 13:15:42 +02:00
Ilija Lazoroski
f0112410c9
Agent: Rename stamp to timestamp in SSHExploiter
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
e11bd2c7f2
Agent: Stamp start time prior to running exploit
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
aba886624e
Agent: Send propagation events sooner
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
e8f48085a4
Agent: Use the tag properties
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
79f72dda55
Agent: Stop sending PropagationEvent before attempt
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
72378f4e53
Agent: Publish scan event when checking ssh port
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
431d6ae775
Agent: Extract method _get_ssh_port
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
0a1901b9a1
Agent: Use error to propagate failure
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
a2534391a6
Agent: Extract method _propagate
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
1cb88e029a
Agent: Extract method _exploit
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
b31eb885f0
Agent: Extract method _get_victim_os
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
dc8a0ac2ad
Agent: Extract method _upload_agent_binary
2022-10-06 13:15:42 +02:00
Kekoa Kaaikala
9dac64b60e
Agent: Update ssh exploiter tags
2022-10-06 13:15:42 +02:00
Ilija Lazoroski
5d9416c385
Agent: Use common.tags to publish events in SSHExploiter
2022-10-06 13:15:42 +02:00
Ilija Lazoroski
5948537d4a
Agent: Add tags to SSHExploiter
2022-10-06 13:15:42 +02:00
Ilija Lazoroski
ddaada1f09
Agent: Revise event publishing in SSHExploiter
2022-10-06 13:15:42 +02:00
vakarisz
2248bdcd67
Island: Add _get_node_by_id method to mongo_node_repository.py
2022-10-06 14:10:47 +03:00
Shreya Malviya
e2453e481c
Agent: Rename variables in HostExploiter
2022-10-06 16:38:42 +05:30
Kekoa Kaaikala
254b4e1c6c
Agent: Update publish methods to accept timestamp
2022-10-05 19:43:25 +00:00
Kekoa Kaaikala
12e9aaf42e
Agent: Add abstract properties for exploiter tags
2022-10-05 17:32:48 +00:00
Kekoa Kaaikala
95b1d9c62d
Agent: Remove target from publish methods
2022-10-05 15:57:15 +00:00
vakarisz
249950d602
Island: Improve tcp handler code and coverage
2022-10-05 17:07:19 +03:00
vakarisz
6c913895c5
Island: Add TCP connections to nodes based on TCP scan event
2022-10-05 15:33:16 +03:00
vakarisz
bbcdc1bef4
Island: Make upsert_node method public
...
Updating/inserting the node into the repository is required outside of repository itself.
2022-10-05 15:33:11 +03:00
Mike Salvatore
73a8c14397
Merge branch '2269-add-attack-technique-tags' into develop
...
PR #2394
2022-10-05 08:25:51 -04:00
Ilija Lazoroski
63f869d296
Project: Add common.tags and HostExploiter publish functions to Vulture
2022-10-05 14:21:23 +02:00
Mike Salvatore
82217b4094
Merge branch 2267-add-network-services into develop
...
PR #2398
2022-10-05 08:20:13 -04:00
Mike Salvatore
10e3c97489
Island: Use Tuple[SocketAddress] for tcp_connections
...
There are serialization issues when using FrozenSet because pydantic
converts the SocketAddress to a dict, which is not hashable. There are
probably ways to work around this, but it's not worth the effort at thsi
time. If performance becomes an issue (doubtful) we can revisit using a
frozenset instead.
2022-10-05 14:51:31 +03:00
Mike Salvatore
8799a60f47
Island: Fix serialization/deserialization of Machine.network_services
2022-10-05 14:51:30 +03:00
Mike Salvatore
d8cf5d33dd
Common: Extract MutableInfectionMonkeyModelConfig
2022-10-05 14:51:30 +03:00
Mike Salvatore
eb3daf84f1
Common: Use strings for NetworkService Enum values
2022-10-05 14:51:30 +03:00
Mike Salvatore
f6ed8a997c
Common: Rename NetworkServiceNameEnum -> NetworkService
...
"Name" and "Enum" are redundant in this case
2022-10-05 14:51:25 +03:00
vakarisz
8bf1d1f46f
Island, Common: Add services to machine.py
2022-10-05 14:51:01 +03:00
vakarisz
a390c97b70
Island: Add tcp_connections to node
2022-10-05 14:50:02 +03:00
vakarisz
80a095b657
Agent: Use NetworkPort instead of Port
2022-10-05 14:50:02 +03:00
Ilija Lazoroski
2ece91b9df
Agent: Rename event_queue to agent_event_queue in SSHCredentialCollector
2022-10-05 11:37:58 +02:00
Ilija Lazoroski
c7e2b91735
Agent: Rename event_queue to agent_event_queue in
...
MimikatzCredentialCollector
2022-10-05 11:34:50 +02:00
Ilija Lazoroski
19fcf8d053
Agent: Import attack technique tags from common in MimikatzCollector
2022-10-05 11:30:09 +02:00
Ilija Lazoroski
c8aee645fa
Agent: Import attack technique tags from common in SSHCollector
2022-10-05 11:24:52 +02:00
Ilija Lazoroski
491612f9e8
Common: Add T1005 and T1145 attack technique tags
2022-10-05 11:21:28 +02:00
Ilija Lazoroski
0ed167fb48
Agent: Import attack technique tags from common in Zerologon
2022-10-05 11:13:39 +02:00
Ilija Lazoroski
e46bb8964d
Common: Add T1003 and T1098 attack technique tags
2022-10-05 11:11:18 +02:00
Mike Salvatore
fd8ea53e8b
Merge branch '2269-remove-find_monkeys_in_db' into develop
...
PR #2391
2022-10-04 18:21:00 -04:00
Mike Salvatore
bbbb1ac773
Island: Remove disused LogBlackboxEndpoint
2022-10-04 16:30:13 -04:00
Mike Salvatore
6ae7676322
BB: Pass generator instead of list comprehension to all()
...
This will allow a short-circuit.
2022-10-04 16:30:13 -04:00
Mike Salvatore
b713cce893
Island: Remove /api/test/monkey endpoint
2022-10-04 16:30:13 -04:00
Kekoa Kaaikala
2bea619786
BB: Removed unused method and endpoint
2022-10-04 16:30:13 -04:00
Kekoa Kaaikala
e0c9717da9
BB: Update test_compabitiblity to use new api
2022-10-04 16:30:13 -04:00
Kekoa Kaaikala
73fbc22e3d
BB: Remove find_monkeys_in_db
2022-10-04 16:30:13 -04:00
Mike Salvatore
a691a16625
Merge pull request #2393 from guardicore/2269-update-hostexploiter
...
2269 update hostexploiter
2022-10-04 15:34:08 -04:00
Mike Salvatore
3172433410
Agent: Swap order of _publish_{propagation,exploitation}_event()
...
Putting _publish_exploitation_event() first puts the methods in both
alphabetical and chronological order.
2022-10-04 15:20:14 -04:00
Mike Salvatore
8e6a098a2e
Project: Add HostExploiter methods to vulture_allowlist.py
2022-10-04 15:18:12 -04:00
Kekoa Kaaikala
a07eadce60
Common: Add T1570 attack technique
2022-10-04 18:00:41 +00:00
Kekoa Kaaikala
d1a8ce2082
Common: Add T1210 tag
2022-10-04 17:58:33 +00:00
Kekoa Kaaikala
6a100105be
Common: Order attack tags alphanumerically
2022-10-04 17:58:23 +00:00
Ilija Lazoroski
8b4af5c349
Common: Fix typo in attack tags
2022-10-04 17:57:57 +00:00
Ilija Lazoroski
dd35bebb3e
Common: Add T1203 attack technique tag
2022-10-04 17:57:16 +00:00
Ilija Lazoroski
bb11ea7857
Common: Add attack tags
2022-10-04 17:56:49 +00:00
Kekoa Kaaikala
ee77eddaab
Agent: Fix tuple type hint
2022-10-04 17:50:39 +00:00
Kekoa Kaaikala
116ae90f3d
UT: Remove host exploiter tests
2022-10-04 17:45:30 +00:00
Kekoa Kaaikala
b94002a984
Agent: Make publish methods private
2022-10-04 17:44:37 +00:00
Ilija Lazoroski
8e161f0fd9
Agent: Accept tuple as tags to HostExploiter publish events methods
2022-10-04 17:36:27 +00:00
Ilija Lazoroski
95b3556cd0
Agent: Exploiter name when publishing events to be __class__.__name__
2022-10-04 17:36:05 +00:00
Kekoa Kaaikala
a79d40b42e
UT: Fix powershell tests
2022-10-04 17:35:33 +00:00
Kekoa Kaaikala
3e86766aaf
Agent: Use default value for exploiter name
2022-10-04 17:35:05 +00:00
Ilija Lazoroski
0b72e4ef9a
Agent: Add publish methods to HostExploiter
2022-10-04 17:34:41 +00:00
Ilija Lazoroski
bf4fecf464
Agent: Rename event_queue to agent_event_queue in HostExploiter
2022-10-04 17:34:31 +00:00
Mike Salvatore
4ace93e417
Merge branch 'consolidate-agent-event-handlers' into develop
...
PR #2390
2022-10-03 15:19:16 -04:00
Mike Salvatore
adee0b4063
Agent: Move add_credentials_from_event to agent_event_handlers package
2022-10-03 14:47:03 -04:00
Mike Salvatore
37b884a5b8
Agent: Move agent_event_forwarder.py to agent_event_handlers package
2022-10-03 14:47:03 -04:00
Mike Salvatore
a3ce870b64
Merge pull request #2389 from guardicore/2269-notify-relay-on-propagation
...
2269 notify relay on propagation
2022-10-03 14:46:14 -04:00
Mike Salvatore
399fedfba5
UT: Rename test_relay_not_notified_if_none
2022-10-03 14:45:44 -04:00
Kekoa Kaaikala
57b4ec4117
BB: Refactor agent communication check
...
Updated CommunicationAnalyzer to use the /api/agents and /api/machines
endpoints to determine whether or not an agent communicated back to the
island.
Resolves PR #2388
2022-10-03 14:28:22 -04:00
Mike Salvatore
a8383f4a79
Agent: Add docstrings to notify_relay_on_propagation
2022-10-03 13:25:30 -04:00
Mike Salvatore
d3ff56138f
Agent: Remove disused ExploitInterceptingTelemetryMessenger
2022-10-03 13:15:55 -04:00
Mike Salvatore
2ad972548b
Agent: Remove ExploitInterceptingTelemetryMessenger decoration
2022-10-03 13:15:55 -04:00
Mike Salvatore
fb7d62e318
Agent: Subscribe notify_relay_on_propagation to PropagationEvent events
2022-10-03 13:15:55 -04:00
Mike Salvatore
0466eb7239
Agent: Add notify_relay_on_propagation agent event handler
2022-10-03 13:15:55 -04:00
Mike Salvatore
368ddde20f
Common: Register serializers for {Exploitation,Propagation}Event
2022-10-03 13:15:12 -04:00
Mike Salvatore
eb16969a56
Merge branch '2362-bb-get-agent-logs' into develop
...
PR #2384
2022-10-03 10:41:30 -04:00
Mike Salvatore
a8627aed48
Merge branch '2269-exploitation-event' into develop
...
PR #2387
2022-10-03 10:36:25 -04:00
Mike Salvatore
07839a46ae
Merge pull request #2385 from guardicore/2269-propagation-event
...
Define Propagation Event
2022-10-03 10:34:33 -04:00
Ilija Lazoroski
779fc63edc
Common: Add param docstring in TCPScanEvent
2022-10-03 16:26:55 +02:00
Ilija Lazoroski
d1af356e19
UT: Add tests for PropagationEvent
2022-10-03 16:25:47 +02:00
Ilija Lazoroski
3389915399
Common: Add PropagationEvent to agent_events
2022-10-03 16:25:45 +02:00
Ilija Lazoroski
fa2ac64b16
UT: Add ExploitationEvent tests
2022-10-03 16:24:09 +02:00
Ilija Lazoroski
a7872d69cf
Common: Add ExploitationEvent to agent_events
2022-10-03 16:24:07 +02:00
Mike Salvatore
82c81c2a4b
Common: Move JSONSerializable to common.types
2022-10-03 10:19:16 -04:00
Mike Salvatore
cfd49db8d2
Island: Use logger.exception()
2022-10-03 10:16:40 -04:00
Mike Salvatore
d922d71081
BB: Add error message when machine is missing interfaces
2022-10-03 10:14:48 -04:00
Ilija Lazoroski
5b9811f089
UT: Add tests for PropagationEvent
2022-10-03 15:00:27 +02:00
Ilija Lazoroski
3d22e49ccc
Common: Add PropagationEvent to agent_events
2022-10-03 15:00:25 +02:00
Mike Salvatore
378e8d55ff
BB: Add type hints to MonkeyLogsDownloader.__init__()
2022-10-03 07:54:36 -04:00
Mike Salvatore
477e80bfba
BB: Remove disused MonkeyIslandClient.find_log_in_db()
2022-10-03 07:52:40 -04:00
Mike Salvatore
fc24d80410
BB: Change agent log file name
...
Use underscores to improve readability
2022-10-03 07:51:40 -04:00
Mike Salvatore
e369ef2933
BB: Remove disused MonkeyLog
2022-10-02 16:57:58 -04:00
Mike Salvatore
6a783d9c3e
BB: Use threading to download logs
...
Reduces time to download logs by approx. 40%, but may be unnecessary
after resolving https://github.com/guardicore/monkey/issues/2383
2022-10-02 16:57:56 -04:00
Mike Salvatore
e4155648c1
BB: Download agent logs from new endpoints
2022-10-02 14:23:01 -04:00
Mike Salvatore
07a6f49e8b
Island: Return empty str, not dict on 404 in AgentLogs.get()
2022-10-02 14:23:00 -04:00
Mike Salvatore
c706466cdd
BB: Add MonkeyIslandClient.get_agent_log()
2022-10-02 14:21:05 -04:00
Mike Salvatore
99c2c5c6ef
BB: Add MonkeyIslandClient.get_machines()
2022-10-02 14:20:49 -04:00
Mike Salvatore
b335601a05
BB: Add MonkeyIslandClient.get_agents()
2022-10-02 14:20:30 -04:00
Mike Salvatore
3db3df8bae
BB: Add a TODO about parse_log()
2022-10-01 19:21:54 -04:00
Mike Salvatore
25f12305f5
Merge pull request #2379 from guardicore/2267-update-nodes-with-tcp-scan-events
...
2267 update nodes with tcp scan events
2022-10-01 19:16:54 -04:00
Kekoa Kaaikala
3b6a0cd6af
UT: Split test_target_machine_not_exists
2022-09-30 19:54:52 +00:00
Kekoa Kaaikala
28560bd65d
UT: Remove more unused `request` parameters
2022-09-30 19:49:16 +00:00
Kekoa Kaaikala
24684bf904
UT: Split scan event StorageError test
2022-09-30 19:46:36 +00:00
Kekoa Kaaikala
978a2a57a9
UT: Add default mocks for fixture methods
...
Update machine_repository fixture to use:
- machine_from_id for get_machine_by_id()
- machines_from_ip for get_machines_by_ip()
2022-09-30 19:36:19 +00:00
Kekoa Kaaikala
da5d7b7357
UT: Removed unsed 'request' parameter
2022-09-30 19:32:08 +00:00
Kekoa Kaaikala
cf13481865
UT: Remove unused constant
2022-09-30 19:29:27 +00:00
Kekoa Kaaikala
1dbfca567a
UT: Give constants uppercase names
2022-09-30 19:28:26 +00:00
Mike Salvatore
de435e27ad
Merge branch '2268-update-reporting' into develop
...
PR #2367
2022-09-30 14:50:54 -04:00
Mike Salvatore
cefc90034f
UT: Add missing __init__.py files
2022-09-30 14:47:58 -04:00
Mike Salvatore
3cde0919e7
Common: Ignore valid-type on con{int,float}
...
mypy can't handle pydantic's conint and confloat. See
https://github.com/pydantic/pydantic/issues/239 and
https://github.com/pydantic/pydantic/issues/156 for more details.
2022-09-30 14:39:35 -04:00
Mike Salvatore
c29d90aa5f
Island: Use list comprehension instead of list(map())
2022-09-30 14:35:30 -04:00
Mike Salvatore
807193ece5
Island: Use list comprehension instead of map()
2022-09-30 14:29:31 -04:00
Kekoa Kaaikala
519f48b6d8
Island: Use ip address in scan report
2022-09-30 18:26:11 +00:00
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
Mike Salvatore
b7566a805b
Island: Use list comprehension instead of map()
2022-09-30 14:22:32 -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
vakarisz
1bf4407b20
UI: Remove temporarily unused import in SecurityReport.js
2022-09-30 18:08:23 +00:00
vakarisz
e8ed30660e
UT: Fix report test
2022-09-30 18:08:23 +00:00
vakaris_zilius
d0d08f7649
UI: Fix the rendering of scanned machines in UI
2022-09-30 18:08:23 +00:00
vakaris_zilius
9048f72030
Island: Convert scanned machines to json serializable data
2022-09-30 18:08:23 +00:00
vakaris_zilius
d974b03ab0
Common: Register PingScanEvent to event serializer
2022-09-30 18:08:23 +00:00
vakaris_zilius
550c375abc
Agent: Fix exception handling for failed delivery of agent events
...
If there's an exception while sending the event to the island it should be logged as exception, not warning (events are not being stored, that's a big no-no). Also, the log should contain proper information of stack trace, not event type
2022-09-30 18:08:23 +00:00
vakarisz
3d27e42ff3
Island: Simplify the report of scanned machines
2022-09-30 18:08:23 +00:00
vakarisz
9a82e46799
Island: Make machine model hashable
...
Machines can be hashed based on their ID. This allows us to add them to set for example and make sure no duplicate entries are there
2022-09-30 18:08:23 +00:00
Kekoa Kaaikala
f0f858eba5
UT: Fix bad values in test_report
2022-09-30 18:08:23 +00:00
Kekoa Kaaikala
f7a30e4608
Island: Raise errors if repositories do not exist
2022-09-30 18:08:23 +00:00
vakarisz
dd0c504743
UT: Add machines and node to report tests
2022-09-30 18:08:23 +00:00
Kekoa Kaaikala
bbd606501e
Island: Fix bug in reporting
2022-09-30 18:08:23 +00:00
Kekoa Kaaikala
2740100621
Island: Connect new ReportService dependencies
2022-09-30 18:08:23 +00:00
Kekoa Kaaikala
520b212c69
Island: Remove ReportService.get_all_displayed_nodes
2022-09-30 18:08:22 +00:00
Kekoa Kaaikala
8acf2d9e91
Island: Refactor ReportService.get_scanned
...
Update ReportService.get_scanned to use repositories instead of services
2022-09-30 18:08:22 +00:00
Kekoa Kaaikala
49c6839c10
Island: Add ReportService.get_accessible_machines
2022-09-30 18:08:22 +00:00
Kekoa Kaaikala
85a5cb3209
Island: Add ReportService.get_all_machines
2022-09-30 18:08:22 +00:00
Kekoa Kaaikala
8537f1fcb7
Island: Add get_machines to IMachineRepository
2022-09-30 18:08:13 +00:00
Mike Salvatore
63447b759a
Island: Add missing @jwt_required to `GET /api/agents`
2022-09-30 13:19:41 -04:00
Mike Salvatore
067a143f2c
UT: Fix bug in test mock
2022-09-30 13:16:04 -04:00
Mike Salvatore
2811009019
UT: Deparametrize a test
...
TCP scan events do not contain OS information.
2022-09-30 13:10:57 -04:00
Mike Salvatore
97061ea61c
UT: Remove redundant "test_scan_event_handler" from test names
2022-09-30 13:04:57 -04:00
Mike Salvatore
029c101643
UT: Remove disused scan event fixtures
2022-09-30 12:54:27 -04:00
Mike Salvatore
79f56e0789
UT: Use constants for TCP and ping scan method names
2022-09-30 12:54:03 -04:00
Mike Salvatore
20b84aa1a4
UT: Use indirect instead of get_fixture_value()
2022-09-30 12:48:03 -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
f89068ae00
Common: Register TCPScanEvent serializer
2022-09-30 12:36:32 -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
vakaris_zilius
e2c86d3d7a
Common: Register PingScanEvent to event serializer
2022-09-30 12:33:13 -04:00
Mike Salvatore
07fa283ce1
Island: Use container.resolve(ScanEventHandler)
2022-09-30 12:28:22 -04:00
Mike Salvatore
0c786dfd94
Island: Change method order in ScanEventHandler
2022-09-30 12:08:32 -04:00
Mike Salvatore
f6e5462ad3
Island: Use sum() to count open ports
2022-09-30 12:06:09 -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
Ilija Lazoroski
326b07e5c1
Island: Fix typo in ScanEventHandler docstring
2022-09-30 16:26:00 +02:00
Ilija Lazoroski
d42a353aaa
Island: Remove TypeError exception from ScanEventHandler
2022-09-30 16:23:04 +02:00
Ilija Lazoroski
f23093dc78
Island: Remove handle_ping_scan_event callable class
2022-09-30 16:20:23 +02:00
Ilija Lazoroski
8002080c8b
Island: Subscribe to Ping and TCP scan events with ScanEventHandlers
2022-09-30 16:18:49 +02:00
Ilija Lazoroski
2686a7a4ee
UT: Add tests for ScanEventHandler
2022-09-30 16:18:49 +02:00
Ilija Lazoroski
e4aec8b9a3
Island: Add ScanEventHandler to agent_event_handlers
2022-09-30 16:18:49 +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
dependabot[bot]
21656dabb4
Bump d3-color and d3 in /monkey/monkey_island/cc/ui
...
Bumps [d3-color](https://github.com/d3/d3-color ) to 3.1.0 and updates ancestor dependency [d3](https://github.com/d3/d3 ). These dependencies need to be updated together.
Updates `d3-color` from 1.4.1 to 3.1.0
- [Release notes](https://github.com/d3/d3-color/releases )
- [Commits](https://github.com/d3/d3-color/compare/v1.4.1...v3.1.0 )
Updates `d3` from 5.16.0 to 7.6.1
- [Release notes](https://github.com/d3/d3/releases )
- [Changelog](https://github.com/d3/d3/blob/main/CHANGES.md )
- [Commits](https://github.com/d3/d3/compare/v5.16.0...v7.6.1 )
---
updated-dependencies:
- dependency-name: d3-color
dependency-type: indirect
- dependency-name: d3
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 01:20:57 +00: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
vakarisz
4d2a6083a1
Island: Fix a bug where failed ping scan created machines
2022-09-29 18:34:46 +00:00
vakarisz
3d80adbcd5
Common: Flatten the ping scan event
2022-09-29 18:34:46 +00:00
vakarisz
6aa69a10b6
Island: Setup ping scan event listener/handler
2022-09-29 18:32:51 +00:00
Kekoa Kaaikala
65d43575d1
UT: Make tests pass
2022-09-29 18:32:51 +00:00
vakarisz
168a5845fd
UT: Fix and rename unit tests in test_handle_ping_scan_event.py
2022-09-29 18:32:51 +00:00
vakarisz
b6d9f88dee
Island: Style improvements in handle_ping_scan_event.py
2022-09-29 18:32:50 +00:00
vakarisz
c807f97d18
Island: Rename handle_scan_data to handle_ping_scan_event
2022-09-29 18:32:50 +00:00
vakarisz
ecb7ca0d8d
Island: Subscribe ping scan events
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
799f08e383
UT: Implement test_handle_scan_data__upserts_machine_if_not_existed
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
29355e9d14
UT: Implement test_handle_scan_data__node_not_upserted_if_no_matching_machine
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
18ca84a247
UT: Implement test_handle_scan_data__node_not_upserted_if_no_matching_agent
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
ce8219aa6d
UT: Implement test_handle_scan_data__upserts_node
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
ab32daa0e0
Common: Fix AbstractAgentEvent union
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
1c127781ca
UT: Implement test_handle_scan_data__upserts_machine
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
a0d6565c4a
UT: Stub out unit tests for handle_scan_data
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
371ca12dfb
Island: Add handle_scan_data to __init__.py
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
89c6e2b7bc
Island: Extract methods in handle_scan_data
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
eacd426969
Island: Handle StorageError in handle_scan_data
2022-09-29 18:32:50 +00:00
Kekoa Kaaikala
304dfbd21f
Island: Add callable to handle PingScanEvent
2022-09-29 18:32:50 +00:00
Mike Salvatore
4b3402f7a8
UT: Move mock_agent_event_queue into conftest.py
2022-09-29 14:32:20 -04:00
Mike Salvatore
b95baaba87
UT: Add tests for TCPScanEvent
2022-09-29 13:59:55 -04:00
Mike Salvatore
208ba1c2ab
Common: Use lower-case member name for PortStatus values
2022-09-29 13:49:50 -04:00
Mike Salvatore
28026716db
Project: Import NetworkPort in vulture_allowlist.py
2022-09-29 13:41:19 -04:00
Mike Salvatore
349b183e5d
Common: Represent multiple ports in TCPScanEvent
2022-09-29 13:39:59 -04:00
Mike Salvatore
ccaf0b63c6
Common: Remove banner from TCPScanEvent
2022-09-29 13:38:33 -04:00
Mike Salvatore
34ca127c6c
Common: Capitalize TCP
2022-09-29 13:31:06 -04:00
Mike Salvatore
ba7e44038c
Common: Remove "service" from TCPScanEvent
...
It's not the responsibility of the agent to format this information for
display.
2022-09-29 13:29:43 -04:00
Mike Salvatore
edaa7ec34d
Common: Reword TCPScanEvent summary
2022-09-29 13:29:21 -04:00
Mike Salvatore
3dc6eba2da
Common: Remove disused common/port_status.py
...
This was moved to common.types and should have been removed in
8ae11e94aa
2022-09-29 13:22:25 -04:00
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
0207519343
Merge branch '2267-common-port-status' into develop
2022-09-29 13:15:38 -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
Mike Salvatore
5a0251c442
Merge pull request #2358 from guardicore/2268-modify-ping-scanner-with-agent-queue
...
2268 modify ping scanner with agent queue
2022-09-29 07:57:29 -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
56ead43c11
Changelog: Add entry for #2299
2022-09-28 15:43:07 -04:00
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
1b4f72e5e3
Merge pull request #2364 from guardicore/2274-agent-logs-endpoint
...
Use new agent logs endpoint
2022-09-28 15:28:40 -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
078574998a
Merge pull request #2363 from guardicore/2274-file-agent-log-repo
...
FileAgentLogRepository
2022-09-28 14:11:31 -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
3202404e46
Changelog: Update agent-logs to use uuid instead of str
...
This was missed in 10954e0a6e
.
2022-09-28 14:06:50 -04: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
08bc43e0c4
Changelog: Add entry for adding new AgentLogs endpoint
2022-09-28 14:57:09 +02:00
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
Mike Salvatore
699f2210f4
Merge pull request #2359 from guardicore/2318-powershell-bb-fix
...
2318 powershell bb fix
2022-09-27 19:37:46 -04:00
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
ea94da9725
Merge pull request #2357 from guardicore/2299-update-network-config-docs
...
Docs: Update network scanning documentation
2022-09-27 11:10:12 -04:00
Kekoa Kaaikala
e63409d1ad
Docs: Update paths for custom-scenario
2022-09-27 14:39:15 +00:00
vakarisz
26a5b4cf4d
BB: Delete "skip_powershell_reuse" mark
...
Not sure why we would want to skip this test specifically
2022-09-27 17:28:12 +03:00
vakarisz
164c0d6127
BB: Add network diagram for powershell credential reuse test
2022-09-27 17:11:08 +03:00
vakarisz
85c101aff9
BB: Remove 46 from depth 3 test suite as it's reserved for credential reuse
2022-09-27 17:06:39 +03:00
vakarisz
031a0ab426
BB: Change powershell credential reuse test to a dedicated machine
...
Island shouldn't be part of the test, so powershell credential reuse was moved to powershell 46(exploited via log4shell) and powershell 44(exploited via credential reuse from powershell 46)
2022-09-27 17:06:39 +03: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
Kekoa Kaaikala
21cbf8d38b
Merge pull request #2351 from guardicore/2323-update-iislandapiclient-with-socketaddress
...
2323 update iislandapiclient with socketaddress
2022-09-27 08:17:17 -04:00
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
688a41a11e
BB: Rename local_network_scan -> scan_my_networks in test_configurations/noop.py
2022-09-27 16:32:09 +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
Ilija Lazoroski
c119406b2d
Project: Add import for PingScanEvent
2022-09-27 10:50:23 +02: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
14999fba4e
Merge pull request #2353 from guardicore/2323-SocketAddress-in-AgentRegistrationData
...
SocketAddress in AgentRegistrationData
2022-09-27 13:56:16 +05:30
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
ef053ea017
Docs: Update network scanning documentation
2022-09-26 15:13:45 +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
aec9cbb4b1
Merge pull request #2352 from guardicore/2323-SocketAddress-in-TCPRelay
...
SocketAddress in TCPRelay
2022-09-26 17:10:30 +05:30
Shreya Malviya
3de18d5f1c
Project: Remove stale Vulture allowlist entry
2022-09-26 16:50:01 +05:30
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
dbaa56c39d
Merge pull request #2349 from guardicore/2261-refactor-manual-agent-logic
...
2261 refactor manual agent logic
2022-09-23 13:45:55 -04:00
Mike Salvatore
73841fb04e
Project: Update vulture_allowlist.py
2022-09-23 13:04:21 -04:00
Mike Salvatore
6c63d4edbd
Agent: Remove unused "Option" from i_island_api_client.py
2022-09-23 12:57:09 -04:00
Mike Salvatore
3fbbc01861
Changelog: Add entries for #2261
2022-09-23 12:56:13 -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
ilija-lazoroski
5ec0f2dbd2
Merge pull request #2343 from guardicore/2261-modify-agent-to-use-signals
...
2261 modify agent to use signals
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
Mike Salvatore
6ae0e6f715
Merge pull request #2336 from guardicore/2261-add-agent-signals-resource
...
2261 add agent signals resource
2022-09-23 12:54:49 -04:00
ilija-lazoroski
dd88745536
Merge pull request #2337 from guardicore/2261-on-terminate-agents-signal
...
2261 on terminate agents signal
2022-09-23 12:54:49 -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
Mike Salvatore
a04a6a3cea
Island: Implement AgentSignalsService.get_signals()
2022-09-23 12:54:49 -04:00
Ilija Lazoroski
f9306cf8f1
Island: Keep naming consistency in island_event_handlers
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
Mike Salvatore
8e45a71a15
Island: Change agent parameter to agent_id in get_signals()
2022-09-23 12:54:49 -04:00
Kekoa Kaaikala
275efb2ab1
UT: Test on_terminate_agents_signal
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
Mike Salvatore
f7997a6a50
Island: Fix tenses in repository docstrings
2022-09-23 12:54:49 -04:00
Ilija Lazoroski
9d3be7e1d3
Island: Implement AgentSignalsService.on_terminate_agents_signal
2022-09-23 12:54:49 -04:00
Shreya Malviya
6174e8dfcb
BB: '/api/terminate-all-agents' -> '/api/agent-signals/terminate-all-agents'
2022-09-23 12:54:49 -04:00
Mike Salvatore
92dd564299
Merge pull request #2333 from guardicore/2261-get-progenitor
...
2261 get progenitor
2022-09-23 12:54:49 -04:00
Ilija Lazoroski
5eeee2a60d
Island: Subscribe AgentSignalsService.on_terminate_agents_signal to
...
TERMINATE_AGENTS events
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
Mike Salvatore
60198ec879
Merge pull request #2332 from guardicore/2261-agent-signals-model
...
2261 agent signals model
2022-09-23 12:54:49 -04:00
Ilija Lazoroski
c25e245a8e
Island: Implement `get_progenitor` in MongoAgentRepository
2022-09-23 12:54:49 -04:00
Ilija Lazoroski
f12e839878
Island: Register AgentSignalsSerivce in DI Container
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
Ilija Lazoroski
d10c148533
Island: Add `get_progenitor` to IAgentRepository
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
c586623b8b
BB: '/api/agent-signals/terminate-all' -> '/api/terminate-all-agents'
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
1632d8b3e9
BB: 'kill_time' -> 'terminate_time'
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
263fff28f3
BB: Use /api/agent-signals/terminate-all instead of /api/monkey-control/stop-all-agents
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
Shreya Malviya
cca4cf9df2
Island: Implement AgentSignals resource's GET
2022-09-23 12:54:49 -04:00
Shreya Malviya
cfe31f8dee
Island: Use terminate signal's timestamp directly instead of creating an AgentSignals object in AgentSignals resource
2022-09-23 12:54:49 -04:00
Shreya Malviya
f23a6c8fa4
Island: Add message to ValueError in AgentSignals resource
2022-09-23 12:54:49 -04:00
Shreya Malviya
58ad44366a
Island: Remove comment in cc/resources/agent_signals.py
2022-09-23 12:54:49 -04:00
Shreya Malviya
dccef0efa5
Island: Rename Signal -> Signals in cc/resources/agent_signals.py
2022-09-23 12:54:49 -04:00
Kekoa Kaaikala
0775449fa9
Island: Add AgentSignals resource
2022-09-23 12:54:49 -04:00
Ilija Lazoroski
c0afae6dfa
Island: Add stubbed AgentSignalsService
2022-09-23 12:54:48 -04:00
Ilija Lazoroski
721cc29559
Island: Add AgentSignals model
2022-09-23 12:51:30 -04:00
Ilija Lazoroski
560d941885
Island: Add terminate field to Simulation model
2022-09-23 12:50:48 -04:00
Ilija Lazoroski
be30db885b
Island: Add TERMINATE_AGENTS to IslandEventTopic
2022-09-23 12:49:41 -04:00
Kekoa Kaaikala
8ff817eed2
Island: Rename local_network_scan
...
local_network_scan -> scan_local_interfaces
2022-09-23 15:43:30 +00:00
Kekoa Kaaikala
4f4eea3d66
Agent: Use get_my_ip_address() to build master
2022-09-23 10:46:47 -04:00
Ilija Lazoroski
49e434d754
Common: Add SocketAddress type
2022-09-23 09:21:34 -04:00
Mike Salvatore
1716a2dddd
Merge pull request #2344 from guardicore/2325-ipv4address-in-island
...
2325 ipv4address in island
2022-09-23 09:09:07 -04:00
Mike Salvatore
0ca004795a
Island: Remove Sequence[str] convention for "ip_addresses"
2022-09-23 08:46:16 -04:00
Mike Salvatore
0592e0a790
Island: Use IPv4Address in LocalMonkeyRunService
2022-09-23 08:45:48 -04:00
Mike Salvatore
c2f3def33b
Island: Use IPv4Address in resources.IPAddresses
2022-09-23 08:42:32 -04:00
Mike Salvatore
526fd6f941
Island: Use IPv4Address instead of str in server_setup.py
2022-09-23 08:35:29 -04:00
Mike Salvatore
fc4c05405b
Common: Add get_my_ip_addresses() -> Sequence[IPv4Address]
2022-09-23 08:16:11 -04:00
Mike Salvatore
a89d76a4c5
Merge pull request #2339 from guardicore/2260-more-mypy-fixes
...
2260 more mypy fixes
2022-09-23 08:05:02 -04:00
vakarisz
52d0e6f655
Agent, Island: Rename get_my_ip_address to legacy
2022-09-23 14:03:10 +03:00
vakarisz
6ced730b53
UT: Remove monkey. part from imports in unit tests
...
No part of the codebase import with this longer syntax of `monkey.infection_monkey.something`, because `infection_monkey.something` is shorter and enough
2022-09-23 12:40:41 +03:00
vakarisz
d48e8b3f3e
Agent, Island: Add mypy to dev dependencies
2022-09-23 12:40:41 +03:00
vakarisz
39191d3344
Project: Remove __init__.py in monkey folder
...
Monkey is not a python package, it's a collection of packages. This also prevents mypy from searching monkey.infection_monkey... imports
2022-09-23 10:47:16 +03:00
vakarisz
978daf973b
Agent: Fix mypy errors related to puppet
2022-09-23 10:45:23 +03:00
vakarisz
0d08ce467e
Agent: Fix mypy issues in ransomware and encryption
2022-09-23 09:42:25 +03:00
vakarisz
3d7e9be150
Agent: Fix type hints mypy found in relay/utils.py
2022-09-22 17:33:00 +03:00
vakarisz
9749984640
Agent: Fix type hints mypy found in propagator.py
2022-09-22 17:09:32 +03:00
Mike Salvatore
2c4625eb1c
Island: Add IAgentLogRepository
2022-09-22 09:59:01 -04:00
Kekoa Kaaikala
9c0ea39b6d
Merge pull request #2330 from guardicore/2260-fix-mypy-issues
...
2260 fix mypy issues
2022-09-22 09:49:42 -04:00
Kekoa Kaaikala
4226d9029f
Island: Simplify T1065.get_tunnel_ports()
2022-09-22 13:38:45 +00:00
Kekoa Kaaikala
38d9ccc9f0
Agent: Remove stale comment
2022-09-22 13:11:08 +00:00
Shreya Malviya
7d996c100e
Agent: Remove repeated code in http_island_api_client.handle_island_errors()
2022-09-22 17:47:50 +05:30
Mike Salvatore
444bf99e41
Merge pull request #2328 from guardicore/2290-import-config-bug
...
UI: Get derived state from props in AdvancedMultiSelect
2022-09-22 08:03:28 -04:00
Mike Salvatore
fe2c1f29fa
Agent: Catch requests.JSONDecodeError
2022-09-22 08:02:52 -04:00
Mike Salvatore
823829c001
Merge pull request #2331 from guardicore/2256-publish-agent-registration-data
...
2256 publish agent registration data
2022-09-22 07:46:19 -04:00
vakarisz
56af6fd2c4
UI: Don't use derived state for selected plugin names
2022-09-22 12:16:11 +03:00
Mike Salvatore
13f7301db9
Island: Add types-python-dateutil as dev dependency
2022-09-21 20:43:50 -04:00
Mike Salvatore
f591f150fc
Revert "Island: Fix mypy issues in exploit.py"
...
This reverts commit 9c49cdafa3
.
2022-09-21 20:43:09 -04:00
Mike Salvatore
284f58afaf
UT: Sort updated_machine.network_interfaces
2022-09-21 20:37:30 -04:00
Mike Salvatore
5b61767575
Project: Remove IslandEventTopics from vulture_allowlist
2022-09-21 20:34:30 -04:00
Kekoa Kaaikala
5e7689345f
Island: Remove i_log_repository.py
2022-09-21 22:25:42 +00:00
Kekoa Kaaikala
06965abe5d
Island: Remove networkmap.py
2022-09-21 22:25:42 +00:00
Kekoa Kaaikala
bba6386efa
Island: Fix mypy issues in segmentation.py
2022-09-21 22:25:42 +00:00
Kekoa Kaaikala
1defad72fd
Island: Fix mypy issues in networkmap.py
2022-09-21 22:25:42 +00:00
Kekoa Kaaikala
e478ba80e0
Island: Fix mypy issues in version.py
2022-09-21 22:25:42 +00:00
Kekoa Kaaikala
c0e98bc0d1
Island: Fix mypy issues in T1065.py
2022-09-21 22:25:42 +00:00
Kekoa Kaaikala
5f3d757965
Island: Fix mypy issues in mongo_db_process.py
2022-09-21 22:25:42 +00:00
Kekoa Kaaikala
0578219549
Island: Fix mypy issues in finding_service.py
2022-09-21 22:25:42 +00:00
Kekoa Kaaikala
85dbda8ba9
Island: Fix mypy issues in cred_exploit.py
2022-09-21 22:25:24 +00:00
Kekoa Kaaikala
22b12080b6
Island: Fix mypy issues in ransomware_report.py
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
9c49cdafa3
Island: Fix mypy issues in exploit.py
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
b8230ffb73
Island: Fix mypy issues for encryptors
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
421ed942fe
Island: Fix mypy issues in AbstractResource.py
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
ecd2cbbe6e
Island: Fix mypy issues in i_log_repository.py
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
3e95ec6ee4
Island: Fix mypy issues in server_setup.py
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
95839caf9c
Island: Fix mypy issues in app.py
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
97d53dba3c
Agent: Fix mypy issues in ransomware_options.py
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
c78e6333f8
Agent: Fix mypy issues in pba.py
2022-09-21 22:23:14 +00:00
Kekoa Kaaikala
1621b494f4
Agent: Fix mypy issues in capture_output.py
2022-09-21 22:23:03 +00:00
Mike Salvatore
bed684d7d0
Island: Rename IslandEventTopic.AGENT_{CONNECTED,REGISTERED}
2022-09-21 15:42:28 -04:00
Mike Salvatore
371e495f17
Island: Fix call to IIslandEventQueue.publish()
2022-09-21 15:42:12 -04:00
Mike Salvatore
71da0a559a
Island: Register handle_agent_registration for AGENT_CONNECTED events
2022-09-21 15:05:47 -04:00
Mike Salvatore
271475570d
Island: Modify machine with AgentRegistrationData
...
Since the Machine is passed to other methods, it should have the most up
to date data.
2022-09-21 15:05:47 -04:00
Mike Salvatore
4101f7509a
Island: Handle IP address collisions when updating Machine on agent reg
2022-09-21 15:05:47 -04:00
Mike Salvatore
c0870e6696
Island: Add new node communication on agent registration
2022-09-21 15:05:47 -04:00
Mike Salvatore
1e8a60c890
Island: Add new agent to repository on agent registration
2022-09-21 15:05:47 -04:00
Mike Salvatore
c95c2ffdf9
Island: Add handle_agent_registration event handler
...
- Add handle_agent_registration callable class
- Add/Update machine to the repository
2022-09-21 15:05:47 -04:00
Mike Salvatore
41dbb92eef
UT: Remove debug print statement
2022-09-21 15:05:47 -04:00
Mike Salvatore
d514ac283c
Island: Publish AgentRegistrationData from Agents resource
2022-09-21 15:05:47 -04:00
Mike Salvatore
f811f91d73
Agent: Add missing `return` to convert_json_error_to_island_api_error()
2022-09-21 15:05:19 -04:00
Mike Salvatore
388b9fe4ed
Agent: Add missing `return` to handle_island_api_errors()
2022-09-21 15:05:16 -04:00
Mike Salvatore
69c8d3a667
Agent: Remove errant line that sets `self._control_client = None`
2022-09-21 15:04:07 -04:00
Mike Salvatore
fbb8e85b46
Agent: Pass server to InfectionMonkey._register_agent()
2022-09-21 14:56:53 -04:00
Kekoa Kaaikala
ccfc41fc2f
Agent: Fix mypy issues in IslandAPIClient
2022-09-21 17:54:33 +00:00
Kekoa Kaaikala
fc82715262
Agent: Fix mypy issues in vuln_assessment.py
2022-09-21 17:49:04 +00:00
Kekoa Kaaikala
2fab84636e
Agent: Fix mypy issues in exploit/tools/helpers.py
2022-09-21 17:47:56 +00:00
Kekoa Kaaikala
0a9d221ad8
Agent: Fix mypy issues in HostExploiter.py
2022-09-21 17:47:11 +00:00
Kekoa Kaaikala
be4c5e7312
Agent: Fix mypy issues in propagation credentials
...
Updated aggregating_propagation_credentials_repository.py
2022-09-21 17:42:52 +00:00
Kekoa Kaaikala
60c1eb9cc1
Agent: Fix mypy errors in monkey.py
2022-09-21 17:09:06 +00:00
Kekoa Kaaikala
4f04cf1c18
Common: Fix mypy error in encoding.py
2022-09-21 17:07:11 +00:00
Mike Salvatore
b4c8ac7242
Island: Accept any kwargs in IIslandEventQueue.publish()
2022-09-21 12:53:39 -04:00
Ilija Lazoroski
320364a7a2
UI: Get derived state from props in AdvancedMultiSelect
2022-09-21 16:48:47 +02:00
Mike Salvatore
a76273fa0d
Merge pull request #2327 from guardicore/2266-replace-IslandModeService
...
Replace IslandModeService with event
2022-09-21 09:25:29 -04:00
Shreya Malviya
a8fb05f2b8
Island: Simplify logic in test_island_mode.py with fixtures
2022-09-21 18:53:12 +05:30
Shreya Malviya
60db495cee
UT: Use MagicMock to simulate internal server error in test_island_mode_post__invalid_mode()
2022-09-21 18:43:26 +05:30
Shreya Malviya
1afafd20dd
UT: Simplify some logic in test_island_mode.py's flask_client fixture
2022-09-21 18:09:13 +05:30
Shreya Malviya
10e1177ef6
Island: Remove set_simulation_mode
2022-09-21 18:08:06 +05:30
Shreya Malviya
547637d151
Island: Subscribe ISimulationRepository.set_mode to IslandEventTopic.SET_ISLAND_MODE
2022-09-21 18:08:06 +05:30
Shreya Malviya
add31fe397
Island: Rename IslandModeEnum.SET_ISLAND_MODE's subscribers' arguments from 'event' to 'mode'
2022-09-21 18:07:54 +05:30
Shreya Malviya
c1e15f8be5
Island: Fix docstring in set_agent_configuration_per_island_mode
2022-09-21 17:41:54 +05:30
ilija-lazoroski
18ceb6c279
Merge pull request #2322 from guardicore/2181-credential-reuse-ete
...
2181 credential reuse ete
2022-09-21 13:58:12 +02:00
Shreya Malviya
fb2165b2e8
UT: Fix broken IslandMode tests
2022-09-21 17:20:32 +05:30
Shreya Malviya
4e0f2c89ec
UT: Remove test_island_mode_service.py
2022-09-21 16:39:24 +05:30
Shreya Malviya
6933d25768
Island: Remove IslandModeService
2022-09-21 16:38:57 +05:30
Shreya Malviya
bc630e86e9
Island: Remove IslandModeService from IslandMode resource
2022-09-21 16:36:44 +05:30
Shreya Malviya
d9d388d41c
Island: Get Island mode from simulation repository in IslandMode's GET
2022-09-21 16:32:30 +05:30
Shreya Malviya
1f96ab5ea9
Island: Extract event topic to a variable in all Island event handler subscribe functions
2022-09-21 16:26:04 +05:30
Shreya Malviya
5a96d5b570
Island: Subscribe set_simulation_mode to IslandEventTopic.SET_ISLAND_MODE
2022-09-21 16:21:59 +05:30
Shreya Malviya
b4c1879bf9
Island: Add set_simulation_mode Island event handler
2022-09-21 16:20:05 +05:30
Shreya Malviya
9ce652f1a5
Island: Rename IslandEventTopic.SET_MODE -> IslandEventTopic.SET_ISLAND_MODE
2022-09-21 16:15:33 +05:30
Shreya Malviya
822d9d6eec
Island: Rename set_island_mode -> set_agent_configuration_per_island_mode
2022-09-21 16:13:33 +05:30
Shreya Malviya
8b87783998
Island: Subscribe set_island_mode to IslandEventTopic.SET_MODE
2022-09-21 16:07:00 +05:30
Shreya Malviya
f20f11265b
Island: Add set_island_mode Island event handler
2022-09-21 16:03:03 +05:30
Shreya Malviya
67e280fd7a
Island: Publish SET_MODE event in IslandMode's PUT
2022-09-21 14:38:08 +05:30
Shreya Malviya
5675724843
Island: Add SET_MODE to IslandEventTopic
2022-09-21 14:33:16 +05:30
Mike Salvatore
f8777cd37d
Merge pull request #2326 from guardicore/2256-initialize-i-machine-repository
...
2256 initialize i machine repository
2022-09-20 15:26:37 -04:00
Mike Salvatore
183b065ae6
Island: Set island=True on IMachineRepository initialization
2022-09-20 15:11:33 -04:00
Mike Salvatore
a323441ffe
Island: Add Machine.island field
2022-09-20 15:09:43 -04:00
Mike Salvatore
f472963b78
Merge pull request #2324 from guardicore/2292-control-channel-client-api-client
...
2292 control channel client api client
2022-09-20 14:47:51 -04:00
Mike Salvatore
897d1e39ac
Agent: Remove debug print from handle_island_api_errors()
2022-09-20 14:45:17 -04:00
Mike Salvatore
aed9022a7a
Island: Register reset_machine_repository for CLEAR_SIMULATION_DATA
2022-09-20 14:34:25 -04:00
Kekoa Kaaikala
53dc34f895
Agent: Fix typo in IIslandAPIClient
2022-09-20 18:34:04 +00:00
Mike Salvatore
35025ead18
Island: Add reset_machine_repository
2022-09-20 14:33:44 -04:00
Kekoa Kaaikala
2a1396c82d
Agent: Use response.json() in HTTPIslandAPIClient
2022-09-20 18:33:05 +00:00
Kekoa Kaaikala
022630ddc1
Agent: Simplify error handling in ControlChannel
2022-09-20 18:32:20 +00:00
Mike Salvatore
36142774dd
Island: Initialize IMachineRepository on Island start
2022-09-20 14:27:58 -04:00
Mike Salvatore
ff0a57aa93
Island: Add initialize_machine_repository()
2022-09-20 14:27:32 -04:00
Kekoa Kaaikala
417d167026
Agent: Simplify error handling in HTTPIslandAPIClient
2022-09-20 18:27:17 +00:00
Kekoa Kaaikala
1c6ca24a47
Agent: Move register_agent out of ControlChannel
2022-09-20 18:21:55 +00:00
Kekoa Kaaikala
2f5bcff631
UT: Use island_api_client fixture
2022-09-20 18:04:16 +00:00
Mike Salvatore
fca3a1357e
Island: Add missing return type to _build_agent_binary_repository()
2022-09-20 13:48:50 -04:00
Kekoa Kaaikala
605e6ae496
UT: Add test for get_credentials_for_propagation
2022-09-20 17:47:10 +00:00
Kekoa Kaaikala
4c3a1ba89a
UT: Add test for get_config
2022-09-20 17:47:10 +00:00
Kekoa Kaaikala
fd08212763
UT: Add test for should_agent_stop
2022-09-20 17:47:10 +00:00
Kekoa Kaaikala
44d8dbeb5c
Island: Get rid of server param in IslandAPIClient
2022-09-20 17:46:03 +00:00
Kekoa Kaaikala
8ebcd2ea33
Island: Update register_agent errors
2022-09-20 17:46:03 +00:00
Kekoa Kaaikala
2dc4871a7d
Agent: Pass IslandAPIClient to the ControlChannel
2022-09-20 17:38:53 +00:00
Kekoa Kaaikala
3e96a30a09
UT: Parametrize errors in tests
2022-09-20 17:35:57 +00:00
Kekoa Kaaikala
51ce974c43
Agent: Reduce duplication due to error handling
2022-09-20 17:35:57 +00:00
Kekoa Kaaikala
42633c066f
Agent: Reduce duplication due to error handling
2022-09-20 17:35:57 +00:00
Kekoa Kaaikala
b260dcc5cb
Agent: Add get_credentials_for_propagation to IslandAPIClient
2022-09-20 17:33:20 +00:00
Kekoa Kaaikala
d6795492a4
Agent: Add get_config to IslandAPIClient
2022-09-20 17:32:10 +00:00
Kekoa Kaaikala
92e793c2cd
Agent: Add should_agent_stop to IslandAPIClient
2022-09-20 17:30:13 +00:00
Kekoa Kaaikala
54ef77698c
Agent: Add register_agent to IslandAPIClient
2022-09-20 17:28:36 +00:00
Ilija Lazoroski
3af38d7841
BB: Fix some minor configuration issue in CredentialsReuse
2022-09-20 18:06:12 +02:00
Ilija Lazoroski
a2b8fceb28
BB: Add new CredentialReuse machines info to the Docs
2022-09-20 17:52:24 +02:00
Ilija Lazoroski
246c78e8c1
BB: Add the new machine to the Terraform scripts
2022-09-20 17:52:00 +02:00
Ilija Lazoroski
07d1062b80
BB: Add CredentialsReuse machines to test_machine_list
2022-09-20 17:51:39 +02:00
Ilija Lazoroski
6c11eb2a6b
BB: Add new EtE test that reuses stolen ssh key to exploit a machine
...
Island --(password)--> A --(password)--> B --(A's SSH key)--> C
2022-09-20 17:49:55 +02:00
Ilija Lazoroski
c13dcf464c
BB: Export Credentials reuse with ssh key test configuration from
...
__init__
2022-09-20 17:49:01 +02:00
Ilija Lazoroski
a9bec168b1
BB: Add Credentials Reuse with ssh key test configuration
2022-09-20 17:48:30 +02:00
Mike Salvatore
dfa1709064
Merge pull request #2315 from guardicore/2180-encrypt-event-data
...
2180 encrypt event data
2022-09-20 11:46:53 -04:00
Kekoa Kaaikala
b27dea54e7
Island: Fix typo in docstring
2022-09-20 15:32:59 +00:00
Kekoa Kaaikala
a83186f532
UT: Test that stored events are encrypted
2022-09-20 15:32:59 +00:00
Kekoa Kaaikala
dea7b4f74a
UT: Use encryptor fixture in agent encryption tests
2022-09-20 15:32:59 +00:00
Kekoa Kaaikala
c0869aebba
Island: Simplify agent encryption calls
2022-09-20 15:32:59 +00:00
Kekoa Kaaikala
644f3628a5
UT: Move mongo functions into a module
2022-09-20 15:32:59 +00:00
Kekoa Kaaikala
2d03e497e9
UT: Show seq and dict are encrypted in events
2022-09-20 15:32:59 +00:00
Kekoa Kaaikala
e0cebd144a
UT: Use mock encryptor
2022-09-20 15:32:59 +00:00
Kekoa Kaaikala
875a54aa8f
Island: Remove stale comment
2022-09-20 15:32:59 +00:00
Kekoa Kaaikala
7038179711
UT: Add tests for event encryption exceptions
2022-09-20 15:32:18 +00:00
Kekoa Kaaikala
ccadfccf5e
Island: Remove duplicate encryption code
2022-09-20 15:32:18 +00:00
Kekoa Kaaikala
f635c2cd5f
BB: Removed unneccessary logs from ZerologonAnalyzer
2022-09-20 15:32:18 +00:00
Kekoa Kaaikala
aa0d5f2e19
Island: Fix import ordering
2022-09-20 15:32:18 +00:00
Kekoa Kaaikala
a9f7262582
UT: Fix formatting
2022-09-20 15:32:18 +00:00
Kekoa Kaaikala
2e63f47606
Island: Copy dict when encrypting event data
2022-09-20 15:32:18 +00:00
Mike Salvatore
7634e00737
Project: Remove MongoAgentEventRepository from vulture_allowlist.py
2022-09-20 15:32:18 +00:00
Mike Salvatore
3f8c40a92c
Island: Rename MongoEventRepository -> MongoAgentEventRepository
2022-09-20 15:32:18 +00:00
Kekoa Kaaikala
c704d4a37b
Island: Remove StubbedEventRepository
2022-09-20 15:30:39 +00:00
Kekoa Kaaikala
dc1eeefbc1
Island: Add MongoEventRepository to DI container
2022-09-20 15:30:39 +00:00
Kekoa Kaaikala
71110c61a7
Island: Add docstrings to agent event encryption
2022-09-20 15:28:00 +00:00
Kekoa Kaaikala
c19e50b7f1
UT: Fix tests for event encryption
2022-09-20 15:28:00 +00:00
Kekoa Kaaikala
54fe2a6dca
Island: Add encryption to MongoEventRepository
2022-09-20 15:28:00 +00:00
Kekoa Kaaikala
0d959e891a
Island: Add functions to encrypt agent events
2022-09-20 15:28:00 +00:00
Mike Salvatore
930256f581
Agent: Take OperatingSystem in IIslandAPIClient.get_agent_binary()
2022-09-20 11:07:09 -04:00
Mike Salvatore
741d192eab
Merge branch '2292-modify-agent-forwarder' into develop
...
PR #2320
2022-09-20 11:03:42 -04:00
Mike Salvatore
2281dde795
Merge pull request #2319 from guardicore/2292-HTTPIslandAPIClient-in-CachingAgentBinaryRepository
...
HTTPIslandAPIClient in CachingAgentBinaryRepository
2022-09-20 10:47:43 -04:00
Mike Salvatore
9807c23571
Agent: Add IIslandAPIClient.connect()
...
Different clients may have different dependencies in their constructors.
Use connect() instead of __init__() to connect to the Island. Add an
AbstractIslandAPIClientFactory and HTTPIslandAPIClientFactory to
facilitate this.
2022-09-20 10:23:21 -04:00
Mike Salvatore
e9433ad23b
Agent: Initialize _agent_event_serializer_registry in __init__()
2022-09-20 10:05:47 -04:00
Mike Salvatore
eea7fc1ee2
Agent: Add AbstractIslandAPIClientFactory
2022-09-20 09:58:15 -04:00
Mike Salvatore
17cb77cfdd
Agent: Move AbstractAgentEvent serialization to HTTPIslandAPIClient
2022-09-20 09:45:00 -04:00
Mike Salvatore
34a4d81336
Agent: Reraise IslandAPIError in handle_island_errors()
2022-09-20 09:39:20 -04:00
Shreya Malviya
7884f96a9c
UT: Fix broken HTTPIslandAPIClient.get_agent_binary() tests
2022-09-20 18:45:39 +05:30
Shreya Malviya
2bd64a3175
Agent: Make variable `island_api_client` protected in InfectionMonkey
2022-09-20 18:38:09 +05:30
Shreya Malviya
9b3950e8eb
Agent: Accept OperatingSystem instead of str in HTTPIslandAPIClientget_agent_binary()
2022-09-20 18:36:22 +05:30
Shreya Malviya
088e020fee
Agent: Catch IslandAPIError and raise RetrievalError in CachingAgentBinaryRepository._download_binary_from_island()
2022-09-20 18:36:22 +05:30
Shreya Malviya
0e9397b283
Agent: Add RetrievalError to i_agent_binary_repository.py
2022-09-20 18:36:22 +05:30
Shreya Malviya
e8ecaa2169
UT: Add tests for HTTPIslandAPIClient.get_agent_binary()
2022-09-20 18:36:22 +05:30
Shreya Malviya
30cf360e98
Agent: Fix URL in HTTPIslandAPIClient.get_agent_binary()
2022-09-20 18:36:22 +05:30
Shreya Malviya
2cebc19843
Agent: Add get_agent_binary() to the IIslandAPIClient interface
2022-09-20 18:36:22 +05:30
Shreya Malviya
d84550ba23
Agent: Fix return type hint in CachingAgentBinaryRepository._download_binary_from_island()
2022-09-20 18:36:21 +05:30
Shreya Malviya
4605722874
Agent: Add logging in CachingAgentBinaryRepository._download_binary_from_island()
2022-09-20 18:36:21 +05:30
Shreya Malviya
3b3f39065d
Agent: Remove comment no longer relevant from monkey.py
2022-09-20 18:36:19 +05:30
Shreya Malviya
8b52ba0686
Agent: Modify docstring in IIslandAPIClient.send_events()
2022-09-20 18:01:17 +05:30
Mike Salvatore
e3adae03b0
Merge pull request #2321 from guardicore/2294-clear-repositories-on-clear-simulation
...
Clear repositories on CLEAR_SIMULATION_DATA event
2022-09-20 07:56:31 -04:00
Mike Salvatore
e5a1a5dc67
Merge pull request #2316 from guardicore/2292-IslandAPIClient-in-ControlClient
...
Use HTTPIslandAPIClient in ControlClient
2022-09-20 07:53:14 -04:00
Shreya Malviya
5032588c23
Island: Initialize MongoDB connection before DI container so that repositories using mongo can be registered and subscribed
2022-09-20 17:07:28 +05:30
Shreya Malviya
638e4cd7ed
Island: Simplify logic in island_event_handlers._subscribe_clear_simulation_data_events
2022-09-20 17:05:53 +05:30
Ilija Lazoroski
14592d964e
Agent: Pass island_api_client when constructing AgentEventForwarder
2022-09-20 13:13:01 +02:00
Ilija Lazoroski
b320fba2c8
Agent: Modify AgentEventForwarder to use IIslandAPIClient
2022-09-20 12:32:00 +02:00
Ilija Lazoroski
f39007b0ce
Agent: Implement send_events in HTTPIslandAPIClient
2022-09-20 12:30:08 +02:00
Ilija Lazoroski
9000a01d1d
Agent: Add send_events to IIslandAPIClient
2022-09-20 12:28:50 +02:00
Shreya Malviya
f93565b2cf
Island: Subscribe repository reset functions to CLEAR_SIMULATION_DATA event
2022-09-20 15:50:43 +05:30
Shreya Malviya
51a9bad000
Island: Register instances of INodeRepository, IMachineRepository, IAgentRepository in DI container
2022-09-20 15:48:07 +05:30
Shreya Malviya
e23c6de745
Agent: Remove no longer needed `island_url` parameter from CachingAgentBinaryRepository
2022-09-20 14:59:35 +05:30
Shreya Malviya
1355c038b5
Agent: Add and use HTTPIslandAPIClient.get_agent_binary()
2022-09-20 14:56:10 +05:30
Shreya Malviya
9da1ad4c46
Agent: Pass and accept island_api_client in CachingAgentBinaryRepository's constructor
2022-09-20 14:54:25 +05:30
Shreya Malviya
3100e6c010
Project: Remove outdated entried from Vulture allowlist
2022-09-20 12:37:05 +05:30
Shreya Malviya
1480203627
Agent: Modify docstrings in IIslandAPIClient
2022-09-20 12:35:21 +05:30
Ilija Lazoroski
1b4f834f46
UT: Add status code tests for HTTIslandAPIClient
2022-09-20 08:50:55 +02:00
Ilija Lazoroski
0c13298bbb
UT: Add error handling tests for HTTPIslandAPIClient send_log and
...
get_pba_file
2022-09-20 07:52:48 +02:00
Mike Salvatore
107a15b5f0
Agent: Call raise_for_status() in HTTPIslandAPIClient
2022-09-19 20:05:19 -04:00
Mike Salvatore
a724758caa
Agent: Handle HTTPErrors in HTTPIslandAPIClient
2022-09-19 20:04:52 -04:00
Mike Salvatore
cb8fda0bec
Agent: Add HTTPIslandAPIClient._api_url attribute
2022-09-19 19:57:28 -04:00
Mike Salvatore
841183d8e7
Agent: Reimplement HTTPIslandAPIClient.get_pba_file() as a method
2022-09-19 19:55:07 -04:00
Mike Salvatore
aa3c6c2f4d
Agent: Add IIslandAPIClient.get_pba_file()
2022-09-19 19:52:58 -04:00
Mike Salvatore
92da3b78db
Agent: Reimplement HTTPIslandAPIClient.send_log() as member, not static
2022-09-19 19:44:16 -04:00
Mike Salvatore
aba342b3f2
Agent: Pass IIslandAPIClient to ControlClient.__init__()
2022-09-19 19:41:14 -04:00
Mike Salvatore
9936605242
Agent: Add IIslandAPIClient.send_log()
2022-09-19 19:39:00 -04:00
Shreya Malviya
393bec29e7
Agent: Remove comment from HTTPIslandAPIClient
2022-09-19 19:39:00 -04:00
Shreya Malviya
365376a190
Agent: Change exception handling and log message in ControlClient.get_pba_file()
2022-09-19 19:39:00 -04:00
Shreya Malviya
d07760fe60
Agent: Make HTTPIslandAPIClient.send_log() and HTTPIslandAPIClient.get_pba_file() static
2022-09-19 19:39:00 -04:00
Shreya Malviya
8ab17a96e3
Agent: Fix functions defined in HTTPIslandAPIClient and use the handle_island_errors() decorator on them
2022-09-19 19:39:00 -04:00
Shreya Malviya
fa9225370e
Agent: Add handle_island_errors() decorator to http_island_api_client.py
2022-09-19 19:39:00 -04:00
Shreya Malviya
d188b06980
Agent: Implement HTTPIslandAPIClient.get_pba_file and use in ControlClient
2022-09-19 19:39:00 -04:00
Shreya Malviya
1b92ec78fb
Agent: Implement HTTPIslandAPIClient.send_log and use in ControlClient
2022-09-19 19:39:00 -04:00
Mike Salvatore
e674f3ab24
Merge branch '2292-modify-find-server' into develop
...
PR #2314
2022-09-19 14:42:33 -04:00
Mike Salvatore
b9576db426
UT: Fix broken tests for find_available_island_apis()
2022-09-19 14:21:17 -04:00
Mike Salvatore
753ac739b0
Agent: rename find_servers() -. find_available_island_apis()
2022-09-19 14:20:40 -04:00
Mike Salvatore
2ebb7621e3
Agent: Fix server selection logic
2022-09-19 14:05:34 -04:00
Mike Salvatore
9ea291a7fa
Agent: Fix crash when connecting to IPv4Address
...
socket.connect() needs a string, not IPv4Address, otherwise the thread
will crash.
2022-09-19 14:01:51 -04:00
Mike Salvatore
51ecf52d4b
Agent: Add an ID (int) to relay control message thread name
2022-09-19 14:01:08 -04:00
Mike Salvatore
c6a5e294df
Agent: Add a timeout to notify disconnect socket
2022-09-19 13:57:25 -04:00
Mike Salvatore
6563be8222
Agent: Remove unnecessary local variable
2022-09-19 12:16:20 -04:00
Mike Salvatore
db75806a08
Agent: Rename _get_server() -> _connect_to_island_api()
2022-09-19 12:13:03 -04:00
Mike Salvatore
9a1b5b67b5
Agent: Default self._relay to None
2022-09-19 11:47:54 -04:00
Ilija Lazoroski
bc19b5ea93
Agent: Modify find_server to return tuple of server and IIslandAPIClient
2022-09-19 17:24:00 +02:00
Ilija Lazoroski
f4b47f8238
Agent: Use HTTPIslandAPIClient in find_server
2022-09-19 16:44:37 +02:00
Mike Salvatore
787af6ae1b
Agent: Fix send relay disconnect to unneeded relays
...
Since `find_server()` is parallelized, the iterator was completely
exhausted when `send_remove_from_waitlist_control_message_to_relays()`
was called, making it effectively a NOOP.
2022-09-19 16:40:04 +02:00
Shreya Malviya
9456a30bd9
Agent: Remove unnecessary logic in _check_if_island_server()
2022-09-19 16:40:04 +02:00
Shreya Malviya
69b26287b6
UT: Fix Island API errors' import in network/relay/test_utils.py
2022-09-19 16:40:04 +02:00
Shreya Malviya
8a4666fba2
Agent: Fix Island API client import in network/relay/utils.py
2022-09-19 16:40:04 +02:00
Ilija Lazoroski
11da608fe6
Agent: Modify find_server to use IslandApiClient
2022-09-19 16:40:04 +02:00
Mike Salvatore
310b58392f
Merge pull request #2313 from guardicore/2292-island-api-client
...
2292 island api client
2022-09-19 10:25:29 -04:00
Mike Salvatore
9f697e57d2
Merge pull request #2317 from guardicore/fix-zerologon
...
Fix zerologon
2022-09-19 10:16:19 -04:00
Ilija Lazoroski
2857e70fa2
Island: Change credentials stolen event subscriber argument name
2022-09-19 15:52:44 +02:00
Ilija Lazoroski
0c6997c147
BB: Get the secret value from credentials in ZerologonAnalyzer
2022-09-19 15:52:04 +02:00
Shreya Malviya
9e79c7c6ef
Project: Add IslandAPIRequestError to Vulture allowlist
2022-09-19 19:08:17 +05:30
Shreya Malviya
1b037c4b3a
Agent: Add IslandAPIRequestError for errors that are the client's mistake
2022-09-19 19:08:15 +05:30
Mike Salvatore
04e82de641
Agent: Make language consistent in IIslandAPIClient docstrings
2022-09-19 09:25:56 -04:00
Mike Salvatore
f4f9ca6317
Agent: Update island API client docstrings
2022-09-19 08:18:46 -04:00
Mike Salvatore
43d6ebcc15
Agent: Rename IslandAPIClient -> HTTPIslandAPIClient
2022-09-19 08:03:45 -04:00
Mike Salvatore
6d5503bd6e
Agent: Move IslandAPIClient to island_api_client package
2022-09-19 08:00:00 -04:00
Mike Salvatore
184e54228d
Agent: Use relative import for errors in IslandAPIClient
2022-09-19 07:56:34 -04:00
Mike Salvatore
0790952c47
Project: Fix IslandApiClient -> IslandAPIClient
2022-09-19 07:52:10 -04:00
Mike Salvatore
ca1bc06c55
Agent: Add IIslandAPIClient
2022-09-19 07:51:50 -04:00
Shreya Malviya
b432a9f567
Agent: Fix docstrings in IslandAPIClient
2022-09-19 17:16:10 +05:30
Shreya Malviya
d53b3d5026
UT: Fix Island API errors' import
2022-09-19 17:11:14 +05:30
Shreya Malviya
c3ecb1e2e8
Project: Fix Island API error import
2022-09-19 17:10:34 +05:30
Shreya Malviya
f5279a6cb1
Agent: Import Island API errors in transport/__init__.py
2022-09-19 17:09:52 +05:30
Shreya Malviya
672fde0b94
UT: Change IslandApiClient -> IslandAPIClient
2022-09-19 17:06:41 +05:30
Shreya Malviya
94dc2288cd
Project: Change IslandApiClient -> IslandAPIClient in Vulture allowlist
2022-09-19 17:06:27 +05:30
Shreya Malviya
d217d30b2e
Agent: Change IslandApiClient -> IslandAPIClient
2022-09-19 17:05:56 +05:30
ilija-lazoroski
8e88f81c36
Merge pull request #2304 from guardicore/fix-slow-ransomware-test
...
Agent: Make BatchingTelemetryMessenger sleep period configurable
2022-09-19 12:30:05 +02:00
vakarisz
8386a006d0
Agent: Implement IslandApiClient
2022-09-19 11:11:50 +02:00
Mike Salvatore
89b9e3cc2b
Merge pull request #2305 from guardicore/fix-bb-tests
...
Fix bb tests
2022-09-16 10:52:25 -04:00
Ilija Lazoroski
547c9f7028
BB: Fix tunneling ToC in documentation
2022-09-16 16:41:26 +02:00
vakarisz
0b0f039474
Agent: Add 4 IslandAPIErrors
2022-09-16 17:39:46 +03:00
Ilija Lazoroski
95741acdf4
BB: Shorten import of depth_4_a_test_configuration
2022-09-16 16:37:00 +02:00
Ilija Lazoroski
ecbee6a3cb
BB: Fix tunneling-13 ip address in the test_configuration
2022-09-16 16:36:26 +02:00
Ilija Lazoroski
8df35e0107
BB: Export depth_4_a_test_configuration from __init__
2022-09-16 16:35:54 +02:00
Mike Salvatore
f677096439
Agent: Make BatchingTelemetryMessenger sleep period configurable
...
The ransomware integration tests were sometimes painfully slow because
they were waiting for the BatchingTelemetryMessenger to stop its
internal thread. This commit surfaces the sleep period parameter to the
`build_ransomware()` function so that the unit tests can set it to a
very small value. This is somewhat of a hack, but
BatchingTelemetryMessenger is going away very soon, as Telemetry is
being replaced by Events.
2022-09-16 10:34:31 -04:00
Mike Salvatore
5233dfd2b5
Project: Run pytest with `--dist loadscope`
...
This option forces tests to be grouped by module and run by the same
worker. This avoids some race conditions that cause tests to fail when
they attempt to bind to the same port. This cannot be solved with any
kind of lock because the tests were being run by completely different
processes.
2022-09-16 10:13:40 -04:00
Shreya Malviya
f6270400b6
Project: Undo accidental import change in Vulture allowlist
2022-09-16 19:17:27 +05:30
Shreya Malviya
2146985e51
Island: Undo accidental change to cc/repository/zero_trust/IEventRepository.py
2022-09-16 19:17:19 +05:30
Mike Salvatore
4e1ca659a9
Merge branch '2293-rename-event-serializers' into develop
...
PR #2300
2022-09-16 09:41:37 -04:00
Mike Salvatore
5669bdd8a2
Agent: Add a comment about locking bcrypt and cryptography
2022-09-16 09:36:26 -04:00
Ilija Lazoroski
b50725b939
BB: Change zone of Depth4 machines
2022-09-16 15:36:11 +02:00
Mike Salvatore
9ec55f20ba
Merge pull request #2302 from guardicore/lock-cryptography
...
Lock cryptography and bcrypt
2022-09-16 09:34:30 -04:00
vakarisz
998c1d7a4f
Agent: Rename EVENTS_API_URL to AGENT_EVENTS_API_URL
2022-09-16 16:20:58 +03:00
Mike Salvatore
b02bc0ceb0
Merge pull request #2298 from guardicore/2216-redundant-ip-lookup
...
Island, Agent: Move local IP and interface retrieval to common
2022-09-16 09:12:26 -04:00
Mike Salvatore
dd2ed50609
CHANGELOG: Fix `/api/agent-events` entry
2022-09-16 09:08:27 -04:00
vakarisz
77a23b7920
Island, Common: Delete the cached versions of ip retrieval
2022-09-16 16:05:56 +03:00
Mike Salvatore
f0e8691bc4
UT: Rename common/events -> common/agent_events
2022-09-16 09:02:09 -04:00
Mike Salvatore
83279cb1b7
UT: Fix CredentialsStolenEvent event import
2022-09-16 08:59:28 -04:00
Shreya Malviya
f8134e505e
UT: Fix imports common.events -> common.agent_events
2022-09-16 08:58:02 -04:00
Shreya Malviya
d93eb4565b
Island: Fix imports common.events -> common.agent_events
2022-09-16 08:58:02 -04:00
Shreya Malviya
c8d11cdfe7
Agent: Fix imports common.events -> common.agent_events
2022-09-16 08:58:02 -04:00
Shreya Malviya
b5736fdd3e
Common: Rename common/events/ -> common/agent_events/
2022-09-16 08:58:02 -04:00
Shreya Malviya
e2fed84985
Project: Fix import in Vulture allowlist
2022-09-16 08:58:02 -04:00
Shreya Malviya
89a8ed7a5e
Island: Rename i_event_repository.py -> i_agent_event_repository.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
c7fef90cd5
Project: Fix Vulture allowlist entries
2022-09-16 08:58:02 -04:00
Shreya Malviya
be612abb23
UT: Change IEventRepository -> IAgentEventRepository
2022-09-16 08:58:02 -04:00
Shreya Malviya
0dccbd32b6
Island: Rename IEventRepository -> IAgentEventRepository
2022-09-16 08:58:02 -04:00
Shreya Malviya
f0d5545f28
Island: Rename cc/resources/events.py -> cc/resources/agent_events.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
ad30efcedd
Chaneglog: Add entry for endpoint rename
2022-09-16 08:58:02 -04:00
Shreya Malviya
66eaccb698
Agent: `/api/agent-events` in place of `/api/events`
2022-09-16 08:58:02 -04:00
Shreya Malviya
cfc0905d0c
Island: Rename `/api/events` to `/api/agent-events`
2022-09-16 08:58:02 -04:00
Shreya Malviya
354d6624d3
UT: Use AgentEvents in place of Events in test_events.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
c37876cb97
Island: Rename resource Events -> AgentEvents
2022-09-16 08:58:02 -04:00
Shreya Malviya
edce35efef
Agent: Make log message more specific in agent_event_forwarder.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
5ad5de9c4a
UT: Change event_serializer_registry -> agent_event_serializer_registry in test_agent_event_serializer_registry.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
e6db64bf88
UT: Rename test_event_serializer_registry.py -> test_agent_event_serializer_registry.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
edb1c97e0a
UT: Rename event_serializers/ -> agent_event_serializers/
2022-09-16 08:58:02 -04:00
Shreya Malviya
7bfc2da539
UT: Fix import common.event_serializers -> common.agent_event_serializers
2022-09-16 08:58:02 -04:00
Shreya Malviya
91b973cfe3
Island: Fix import common.event_serializers -> common.agent_event_serializers
2022-09-16 08:58:02 -04:00
Shreya Malviya
922db9c583
Agent: Fix import common.event_serializers -> common.agent_event_serializers
2022-09-16 08:58:02 -04:00
Shreya Malviya
d7327272a0
Common: Rename event_serializers/ -> agent_event_serializers/
2022-09-16 08:58:02 -04:00
Shreya Malviya
2f748516a8
UT: Change pydantic_event_serializer -> pydantic_agent_event_serializer in test_pydantic_agent_event_serializer.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
d694591d1e
UT: Rename test_pydantic_event_serializer.py -> test_pydantic_agent_event_serializer.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
f5a0b42319
Common: Rename pydantic_event_serializer.py -> pydantic_agent_event_serializer.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
d729b514e5
UT: Use PydanticAgentEventSerializer in place of PydanticEventSerializer
2022-09-16 08:58:02 -04:00
Shreya Malviya
43fd978ce4
Common: Rename PydanticEventSerializer -> PydanticAgentEventSerializer
2022-09-16 08:58:02 -04:00
Shreya Malviya
bf5e32a252
Project: Remove irrelevant Vulture allowlist entries
2022-09-16 08:58:02 -04:00
Shreya Malviya
940b479ca2
Common: Rename event_serializer_registry.py -> agent_event_serializer_registry.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
2568d52730
UT: Use AgentEventSerializerRegistry in place of EventSerializerRegistry
2022-09-16 08:58:02 -04:00
Shreya Malviya
4a23f5a95b
Island: Use AgentEventSerializerRegistry in place of EventSerializerRegistry
2022-09-16 08:58:02 -04:00
Shreya Malviya
19a59bf3c2
Agent: Use AgentEventSerializerRegistry in place of EventSerializerRegistry
2022-09-16 08:58:02 -04:00
Shreya Malviya
6ced4af5dc
Common: Rename EventSerializerRegistry -> AgentEventSerializerRegistry
2022-09-16 08:58:02 -04:00
Shreya Malviya
c4ab5d99a9
Agent: Fix import in agent_event_forwarder.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
3b22bf0cb4
Common:Rename i_event_serializer.py -> i_agent_event_serializer.py
2022-09-16 08:58:02 -04:00
Shreya Malviya
619dc68c0e
UT: Use IAgentEventSerializer in place of IEventSerializer
2022-09-16 08:58:02 -04:00
Shreya Malviya
0e2b165c15
Agent: Rename IEventSerializer -> IAgentEventSerializer
2022-09-16 08:58:02 -04:00
Mike Salvatore
c82ee2ce97
Common: Call get_network_interfaces() from get_my_ip_addresses()
2022-09-16 08:52:54 -04:00
vakarisz
247441663d
Common: Rename "get_local_interfaces" to "get_network_interfaces"
2022-09-16 15:45:07 +03:00
vakarisz
135da9631d
Common: Rename "get_local_ip_addresses" to "get_my_ip_addresses"
2022-09-16 15:45:07 +03:00
vakarisz
6bcf44da69
Agent: Remove unused propagation_credentials_repository parameter
2022-09-16 15:45:07 +03:00
vakarisz
11318dad14
Island, Agent: Move local IP and interface retrieval to common
...
Both, island and agent needs to get local IP's/interfaces. We should also consider merging them, since interfaces also contain IP's
2022-09-16 15:45:07 +03:00
Mike Salvatore
ae073de766
Merge pull request #2301 from guardicore/2180-credentials-event-encoding
...
2180 credentials event encoding
2022-09-16 08:35:45 -04:00
Ilija Lazoroski
7c554ec157
Agent: Relock Pipfile on windows
2022-09-16 14:35:40 +02:00
Mike Salvatore
ec40a9c6ad
Common: Inherit from InfectionMonkeyModelConfig in CredsStolenEvent
2022-09-16 08:34:46 -04:00
Mike Salvatore
54f1bd2197
Agent: Add more well-known ports
2022-09-16 08:27:42 -04:00
Mike Salvatore
1b4f1dba4e
Agent: Change the order of COMMON_PORTS
...
COMMON_PORTS should be ordered with the the most likely to succeed ports
first.
2022-09-16 08:16:46 -04:00
Ilija Lazoroski
ecccace870
Agent: Lock bcrypt to 3.2.2
2022-09-16 13:45:29 +02:00
vakarisz
46f7390a05
Common: Use SecretEncodingConfig in credentials_stolen_events.py
2022-09-16 14:26:36 +03:00
vakarisz
9577c5569e
Common, Agent: Extract credential encoding related methods
2022-09-16 14:26:31 +03:00
Kekoa Kaaikala
017cce22d6
Agent: Add cryptography dependency
2022-09-15 19:15:25 +00:00
Mike Salvatore
004a543310
Common: Make Credentials.Config a subclass of InfectionMonkeyModelConfig
2022-09-15 12:23:52 -04:00
Mike Salvatore
729d2beee8
UT: Add missing tests for MongoAgentRepository
...
Increases code coverage to 100%
2022-09-15 12:10:14 -04:00
Mike Salvatore
cbbd10dd71
Merge branch 'improve-mongo-credentials-repo' into develop
2022-09-15 12:05:04 -04:00
Mike Salvatore
deacd18cbe
Island: Make ICredentialsRepository methods abstract
2022-09-15 12:03:38 -04:00
Mike Salvatore
a7a2968a99
Island: Remove superfluous "pass" from ICredentialsRepository
2022-09-15 12:03:23 -04:00
Mike Salvatore
3fd27c6503
Island: Add ICredentialsRepository.reset()
2022-09-15 12:03:21 -04:00
Mike Salvatore
07815eed93
Island: Wrap drop() Exceptions with RemovalError
2022-09-15 11:56:58 -04:00
Mike Salvatore
84c8de6a7c
UT: Test error conditions in MongoCredentialsRepository
...
Increases test coverage to 100% for MongoCredentialsRepository
2022-09-15 11:55:48 -04:00
Mike Salvatore
5aff1c62c3
Island: Use drop() to clear mongo credentials collections
2022-09-15 11:54:06 -04:00
Mike Salvatore
6e47d3272d
Island: Use monkey_island database in MongoCredentialsRepository
2022-09-15 11:48:12 -04:00
Mike Salvatore
ef821f75e2
Agent: Add agent source to CredentialsStolenEvent in ZerologonExploiter
2022-09-15 08:01:58 -04:00
Mike Salvatore
4884313cba
Merge pull request #2297 from guardicore/2182-remove-credentialstelem
...
Remove CredentialsTelem
2022-09-15 07:42:37 -04:00
Shreya Malviya
75dddb0861
BB: Remove usage of CredentialComponentType in Zerologon analyzer
2022-09-15 14:07:18 +05:30
Shreya Malviya
cf48189a07
BB: Use keyword parameters when creating Username/Password/NTHash objects
2022-09-15 14:00:14 +05:30
Shreya Malviya
f57dad05c1
BB: Use keyword parameters when creating Credentials objects
2022-09-15 13:55:49 +05:30
Shreya Malviya
0b2039fb76
UT: Remove test_credentials_telem.py
2022-09-15 12:30:39 +05:30
Shreya Malviya
08fc1c6d39
Common: Remove CREDENTIALS from TelemCategoryEnum
2022-09-15 12:30:06 +05:30
Shreya Malviya
eba94293d4
Agent: Remove CredentialsTelem
2022-09-15 12:29:18 +05:30
Shreya Malviya
775b0e69eb
Island: Remove usage of credential telemetry
2022-09-15 12:28:37 +05:30
Shreya Malviya
b00e0ff427
Agent: Remove usage of CredentialsTelem from master
2022-09-15 12:11:55 +05:30
Shreya Malviya
0a73ca717c
Agent: Fix some mypy issues in zerologon.py
2022-09-15 12:07:03 +05:30
Shreya Malviya
97dcbe6168
Agent: Remove usage of CredentialsTelem from Zerologon exploiter
2022-09-15 11:53:22 +05:30
Mike Salvatore
51d5176986
UT: Improve MongoNodeRepository test coverage
...
Setting the MagicMock members to lambda's did not work as expected. A
look at the code coverage report revealed that not all branches were
covered. Setting them to new MagicMock objects with the correct return
type added coverage to branches that were previously skipped.
2022-09-14 15:58:35 -04:00
Mike Salvatore
4f29326da9
Merge pull request #2295 from guardicore/2180-mongo-event-repository
...
2180 mongo event repository
2022-09-14 15:49:13 -04:00
Kekoa Kaaikala
25c3552061
UT: Clarify mongo repository reset test
2022-09-14 19:35:37 +00:00
Kekoa Kaaikala
9ec91ec97a
Island: Remove unneccessary call to list()
2022-09-14 19:35:05 +00:00
Kekoa Kaaikala
cd84280e79
Island: Simplify event query and deserialization
2022-09-14 19:14:35 +00:00
Kekoa Kaaikala
8311fc79a9
Island: Add message to error on save
2022-09-14 18:43:52 +00:00
Kekoa Kaaikala
5f44204583
UT: Clean up mongo fixture
2022-09-14 18:38:56 +00:00
Kekoa Kaaikala
7e96c11204
Island: Add docstring to MongoEventRepository
2022-09-14 18:35:18 +00:00
Mike Salvatore
2155e9681e
UT: Double sleep time to prevent false failures
2022-09-14 14:17:19 -04:00
Mike Salvatore
0ea1f9576f
Merge pull request #2296 from guardicore/2181-store-stolen-credentials-in-repo
...
2181 store stolen credentials in repo
2022-09-14 14:14:54 -04:00
Mike Salvatore
5742681b13
Island: Rename agent_event_subscribers -> agent_event_handlers
2022-09-14 13:58:12 -04:00
Mike Salvatore
03c49fe4da
Island: Shorten subscription code
2022-09-14 13:55:13 -04:00
Mike Salvatore
b3e9bbe05f
Island: Subscribe save_stolen_credentials_to_repository()
2022-09-14 13:54:38 -04:00
Mike Salvatore
4db251dd7d
Island: Add save_stolen_credentials_to_repository
2022-09-14 13:52:29 -04:00
Mike Salvatore
d5979fae16
Island: Fix typo and grammar in save_event_to_event_repository()
2022-09-14 13:48:55 -04:00
Kekoa Kaaikala
5c762930bf
Island: Search UUID by string value
2022-09-14 17:45:44 +00:00
Kekoa Kaaikala
89954223e8
Island: Match type based on __name__
2022-09-14 17:45:44 +00:00
Kekoa Kaaikala
ad5bba9e2f
Island: Use EventSerializerRegistry
2022-09-14 17:45:44 +00:00
Kekoa Kaaikala
f5e398c175
Island: Add MongoEventRepository
2022-09-14 17:45:41 +00:00
Mike Salvatore
0b5dd3832b
Merge pull request #2291 from guardicore/2180-save-event-to-repository
...
2180 save event to repository
2022-09-14 13:40:19 -04:00
Mike Salvatore
6f4c3d4669
Island: Register StubbedEventRepository in DIContainer
2022-09-14 13:36:55 -04:00
Mike Salvatore
f5711e2fab
Island: Add StubbedEventRepository
...
A placeholder until MongoEventRepository is implemented
2022-09-14 13:35:49 -04:00
Mike Salvatore
9fc91239f2
Agent: Use private module variable for ID caching
...
mypy complains about setting an attribute on the function object. Using
`global _id` accomplishes the same thing and doesn't upset mypy
2022-09-14 12:59:44 -04:00
Mike Salvatore
8faf8de4dd
Agent: Use HardwareID as the return type for get_machine_id()
2022-09-14 12:57:40 -04:00
Mike Salvatore
f7ab5c5dd8
Common: Use MachineID instead of int in AbstractAgentEvent.target
2022-09-14 12:54:49 -04:00
Mike Salvatore
1b2b316e1f
Island: Move MachineID to common
2022-09-14 12:53:42 -04:00
Mike Salvatore
99b0f5bcd6
Merge pull request #2279 from guardicore/2177-agent-all-events-subscriber
...
Subscriber to send all Agent events to Island
2022-09-14 12:12:26 -04:00
Mike Salvatore
d179a5563f
UT: Add note about potentially slow or racey tests
2022-09-14 12:11:51 -04:00
Mike Salvatore
996225deef
Agent: Fix line length
2022-09-14 12:09:42 -04:00
Mike Salvatore
fbd5bb9a9e
Agent: Rename _agent_events_to_island_sender
2022-09-14 12:08:45 -04:00
Mike Salvatore
9471db378f
UT: Reduce sleep time from 0.05 to 0.01 in test_agent_event_forwarder
2022-09-14 12:07:36 -04:00
Ilija Lazoroski
83f1e4cc2a
Island: Use agent_event_handlers on island setup
2022-09-14 17:19:28 +02:00
Ilija Lazoroski
5a836daaa7
Island: Add agent_event_handlers
2022-09-14 17:18:55 +02:00
Ilija Lazoroski
26fc6fd5b9
Island: Add save_event_to_event_repository subscriber
2022-09-14 17:17:32 +02:00
Mike Salvatore
ac4db7aaf6
CHANGELOG: Add entry for #2216
2022-09-14 11:03:06 -04:00
vakarisz
b81f7ad69c
Merge branch '2216-tcp-relay' into develop
2022-09-14 17:47:13 +03:00
Shreya Malviya
218363d40e
UT: Reduce sleep time from 0.1 to 0.05 in test_agent_event_forwarder.py
2022-09-14 19:59:19 +05:30
Shreya Malviya
5c1613bc79
Agent: Add log statement when sending Agent events to Island
2022-09-14 19:54:36 +05:30
Shreya Malviya
7fed97530f
UT: Use BatchingAgentEventForwarder instead of AgentEventsToIslandSender
2022-09-14 19:52:33 +05:30
Shreya Malviya
c24fd9ddab
Agent: Rename AgentEventsToIslandSender -> BatchingAgentEventForwarder
2022-09-14 19:52:10 +05:30
Shreya Malviya
83a828ada5
UT: Rename test_send_all_events_to_island.py -> test_agent_event_forwarder.py
2022-09-14 19:51:15 +05:30
Shreya Malviya
984ce2e8bc
UT: Use agent_event_forwarder instead send_all_events_to_island in import
2022-09-14 19:50:33 +05:30
Shreya Malviya
04b1caeb4c
Agent: Rename send_all_events_to_island.py -> agent_event_forwarder.py
2022-09-14 19:49:35 +05:30
Shreya Malviya
0775beda7a
Agent: Rename SendAllAgentEventsToIsland -> AgentEventForwarder
2022-09-14 19:47:53 +05:30
Shreya Malviya
4eabf6e77b
Agent: Use create_daemon_thread() instead of threading.Thread() in AgentEventsToIslandSender
2022-09-14 19:45:12 +05:30
vakarisz
f3fd2fca8b
Agent: Fix SSH exploiter to be able to exploit unknown OS
...
Previously if the agent couldn't detect the OS, agent failed with errors
2022-09-14 17:08:52 +03:00
Ilija Lazoroski
bb0910371c
Island: Refactor api/events to publish list of events
...
PR #2285
2022-09-14 09:48:16 -04:00
Mike Salvatore
2fe3a2ece3
Merge pull request #2287 from guardicore/2180-i-event-repository
...
Island: Add IEventRepository
2022-09-14 09:44:17 -04:00
Mike Salvatore
c977d8c212
Island: Use TypeVar for IEventRepository.get_events_by_type()
2022-09-14 09:41:58 -04:00
Mike Salvatore
4bb914316f
Merge pull request #2283 from guardicore/2255-mongo-node-repository
...
2255 mongo node repository
2022-09-14 09:35:16 -04:00
Mike Salvatore
f52f8eccd5
UT: Use sets for simpler sequence comparison
2022-09-14 09:19:56 -04:00
Mike Salvatore
1a8c285d8e
UT: Use set.intersection() for simpler set comparison
2022-09-14 09:18:00 -04:00
Mike Salvatore
617a3273cd
Merge branch 'omit-mongo-object-id' into 2255-mongo-node-repository
2022-09-14 09:10:12 -04:00
Mike Salvatore
c2437464c6
Island: Omit the mongo object ID from Agent query results
2022-09-14 09:10:06 -04:00
Ilija Lazoroski
17e9c00180
UT: Add another test for AgentEventsToIslandSender
2022-09-14 15:09:00 +02:00
Mike Salvatore
fa8736e2fe
Island: Omit the mongo object ID from Machine query results
2022-09-14 09:05:42 -04:00
Mike Salvatore
3fb1ddaa74
Island: Omit the mongo object ID from Node query results
2022-09-14 09:02:21 -04:00
Mike Salvatore
5821d71ade
Island: Omit the mongo object ID from credentials query results
2022-09-14 08:59:09 -04:00
Ilija Lazoroski
c54d1b89ab
Island: Add IEventRepository
2022-09-14 13:26:27 +02:00
Mike Salvatore
d509ee7216
Build: Pull Python AppImage v3.7.14
2022-09-14 07:22:44 -04:00
Mike Salvatore
1e3e6c9052
Merge branch '2216-fix-connection-issues' into 2216-tcp-relay
2022-09-14 07:06:03 -04:00
Mike Salvatore
e56d4c0ac7
Merge pull request #2284 from guardicore/2216-relay-bb-tests
...
2216 relay bb tests
2022-09-14 06:56:42 -04:00
Shreya Malviya
97a9f2d156
UT: Fix import in test_send_all_events_to_island.py
2022-09-14 16:14:53 +05:30
Shreya Malviya
c72d34b7ad
Agent: Fix import in monkey.py
2022-09-14 16:12:39 +05:30
Mike Salvatore
1affc3fe5e
Common: Add "raises" docstrings to IEventSerializer.deserialize()
2022-09-14 06:33:31 -04:00
Shreya Malviya
bb8b4742af
Agent: Implement event serializer logic for SendAllAgentEventsToIsland
2022-09-14 16:00:56 +05:30
Shreya Malviya
aeda96db06
UT: Add test for AgentEventsToIslandSender
2022-09-14 15:45:40 +05:30
Shreya Malviya
37c4362b60
Agent: Add default argument and type hint in send_all_events_to_island.py
2022-09-14 15:43:38 +05:30
Ilija Lazoroski
b129833e57
Island: Remove ITelemtryRepository
2022-09-14 06:13:29 -04:00
vakarisz
bc6da3d402
BB: Add documentation about changes to tunneling-11
2022-09-14 12:13:36 +03:00
vakarisz
c281666504
BB: Remove tunneling-12 from depth-3
2022-09-14 12:10:06 +03:00
vakarisz
7a33802b7c
BB: Add tunneling machines to the list of depth 3 test
2022-09-14 12:06:46 +03:00
Shreya Malviya
fe63b28ee1
Agent: Restructure SendAllAgentEventsToIsland and _AgentEventsToIslandSender
2022-09-14 14:31:55 +05:30
Shreya Malviya
404f6d954f
Agent: Replace SendAllAgentEventsToIsland's __call__() with send_event()
2022-09-14 13:46:45 +05:30
Shreya Malviya
8256322a29
Agent: Rename _batch_and_send_events_thread -> _BatchAndSendEventsThread
2022-09-14 13:34:34 +05:30
Shreya Malviya
1ad13db758
Agent: Rename send_all_events_to_island -> SendAllAgentEventsToIsland
2022-09-14 13:33:34 +05:30
Shreya Malviya
5152b9a3cc
Agent: Use threading.Event instead of flag in send_all_events_to_island.py
2022-09-14 12:29:07 +05:30
Shreya Malviya
a561195508
Agent: Use `json` instead of `data` in POST request in send_all_events_to_island.py
2022-09-14 12:14:25 +05:30
Shreya Malviya
4381716e54
Agent: Remove unused variables in send_all_events_to_island.py
2022-09-14 12:14:25 +05:30
Shreya Malviya
39a7ae0964
Agent: Rename DEFAULT_TIME_PERIOD -> DEFAULT_TIME_PERIOD_SECONDS in send_all_events_to_island.py
2022-09-14 12:14:25 +05:30
Shreya Malviya
5ecc3e992a
Agent: Remove send_all_events_to_island's dependency on pubsub
2022-09-14 12:14:25 +05:30
Shreya Malviya
83c7f10859
Agent: Simplify batching and sending logic in send_all_events_to_island.py
2022-09-14 12:14:25 +05:30
Shreya Malviya
1d60cb160b
Agent: Clear event batches set and use correct variable name in send_all_events_to_island.py
2022-09-14 12:14:25 +05:30
Shreya Malviya
239b2e2550
Agent: Extract API URL to variable EVENTS_API_URL in send_all_events_to_island.py
2022-09-14 12:14:25 +05:30
Shreya Malviya
39f8bafd46
Agent: Add docstrings in send_all_events_to_island.py
2022-09-14 12:14:25 +05:30
Shreya Malviya
de68f21fdf
Agent: Subscribe `send_all_events_to_island` to all events
2022-09-14 12:14:25 +05:30
Shreya Malviya
1abf323b14
Agent: Add type annotation for `send_all_events_to_island._batch_and_send_events_thread._event_batch`
2022-09-14 12:14:25 +05:30
Shreya Malviya
8f4aefda74
Agent: Rename some variables in `send_all_events_to_island`
2022-09-14 12:14:25 +05:30
Shreya Malviya
6520fe2c90
Agent: Rename push_events_to_island.py -> send_all_events_to_island.py for consistency
2022-09-14 12:14:25 +05:30
Shreya Malviya
9475c86fba
Agent: Rename `push_all_events_to_island` -> `send_all_events_to_island` for consistency
2022-09-14 12:14:25 +05:30
Shreya Malviya
5542f67ceb
Agent: Finish implementing threading/batching in `push_all_events_to_island`
2022-09-14 12:14:25 +05:30
Shreya Malviya
e51a717bdf
Agent: Add a very crude outline of using a queue and threading in `push_all_events_to_island`
2022-09-14 12:14:25 +05:30
Shreya Malviya
a06c6a622e
Agent: Add log statements in class `push_all_events_to_island`'s `__call__()`
2022-09-14 12:14:25 +05:30
Shreya Malviya
1462e832b0
Agent: Add subscriber to push all events to the Island
2022-09-14 12:14:25 +05:30
Mike Salvatore
cd6a46a304
Island: Add MongoNodeRepository
2022-09-13 20:43:24 -04:00
Mike Salvatore
76b51d25b9
Island: Use frozenset instead of tuple for communication types
2022-09-13 20:42:37 -04:00
Mike Salvatore
6cc8948ebf
Island: Add INodeRepository.reset()
2022-09-13 19:09:55 -04:00
Mike Salvatore
ed0e8c4870
Common: Add event type to serialized agent events
2022-09-13 17:15:52 -04:00
Mike Salvatore
03989e1964
Common: Add EVENT_TYPE_FIELD
2022-09-13 17:04:44 -04:00
Mike Salvatore
010a630c4f
Merge pull request #2282 from guardicore/2179-register-credentials-stolen-event-serializer
...
2179 register credentials stolen event serializer
2022-09-13 17:02:25 -04:00
Kekoa Kaaikala
e7bb5ce535
BB: Add interface to tunneling-11
2022-09-13 19:52:04 +00:00
Kekoa Kaaikala
b865c13a3b
BB: Revert depth_3_a test
2022-09-13 19:45:57 +00:00
Mike Salvatore
d30dfd3396
Agent: Setup EventSerializerRegistry
2022-09-13 15:16:27 -04:00
Mike Salvatore
ca23c94c8e
Island: Setup EventSerializerRegistry
2022-09-13 15:12:07 -04:00
Mike Salvatore
905fb3563e
Merge pull request #2281 from guardicore/2216-prevent-port-collisions
...
Agent: Add TCPPortSelector
2022-09-13 15:08:56 -04:00
Mike Salvatore
0f0f50208d
Agent: Add missing "param" in docstring
...
Co-authored-by: Kekoa Kaaikala <kekoa.kaaikala@gmail.com>
2022-09-13 15:07:25 -04:00
Mike Salvatore
5905d3bf5b
Common: Add register_common_agent_event_serializers()
2022-09-13 15:04:45 -04:00
Mike Salvatore
ad01003480
Common: Rename i_event_serialize{,r}.py
2022-09-13 14:58:15 -04:00
Mike Salvatore
1c742c3f96
Merge pull request #2280 from guardicore/2179-credentialsstolenevent-pydantic
...
2179 credentialsstolenevent pydantic
2022-09-13 14:47:10 -04:00
Mike Salvatore
1503c3f0ba
Common: Switch AbstractAgentEvent.source from int to AgentID
2022-09-13 13:25:47 -04:00
Mike Salvatore
80cd5a05a1
Common: Move AgentID definition to common
2022-09-13 13:25:45 -04:00
Mike Salvatore
1998d492eb
Agent: Remove disused credential_collectors.credential_components pkg
2022-09-13 13:17:02 -04:00
Mike Salvatore
04d79a0a35
Agent: Add TCPPortSelector
2022-09-13 12:24:14 -04:00
Ilija Lazoroski
31f3c1a4d6
UT: Fix all unit tests that we creating events to use pydantic
2022-09-13 17:53:58 +02:00
Ilija Lazoroski
1799f1253c
Common: Make AbstractAgentEvent to be a pydantic modell
...
In this way we are saying that every event needs to be a pydantic model
for which we may pay the price later on.
2022-09-13 17:45:48 +02:00
Ilija Lazoroski
a68a765722
Common: Make CredentialsStolenEvent to be a class
2022-09-13 17:45:48 +02:00
Kekoa Kaaikala
1a96e9fd8d
Common: Make CredentialsStolenEvent a pydantic model
2022-09-13 17:45:48 +02:00
Kekoa Kaaikala
78d5094f90
Common: Use int instead of UUID in AbstractAgentEvent
2022-09-13 17:45:48 +02:00
Kekoa Kaaikala
69063de627
Agent: Add note about unintentional disconnect
2022-09-13 15:38:19 +00:00
Kekoa Kaaikala
4ba4cb583a
Agent: Add thread ID to SocketsPipe thread name
2022-09-13 15:32:15 +00:00
Mike Salvatore
bde44f74f5
Merge pull request #2275 from guardicore/2179-implement-pydantic-event-serializer
...
2179 implement pydantic event serializer
2022-09-13 09:56:57 -04:00
Mike Salvatore
69e11d6b50
Common: Ignore mypy cyclical definition warning for JSONSerializable
2022-09-13 09:22:24 -04:00
Ilija Lazoroski
d3a4f255f0
Common: Use isinstance in PydanticEventSerializer
2022-09-13 14:09:54 +02:00
Mike Salvatore
ef2bac6de2
Merge pull request #2278 from guardicore/2234-remove-repository-service
...
Island: Remove RepositoryService
2022-09-13 08:01:36 -04:00
Mike Salvatore
6c0b63aa29
Common: Don't hide AttributeError from the caller
2022-09-13 07:55:15 -04:00
Mike Salvatore
780595cf19
Common: Use `simplify=True` in PydanticEventSerializer
2022-09-13 07:53:30 -04:00
Mike Salvatore
34e843f7f3
Common: Make PydanticEventSerializer generic
2022-09-13 07:50:38 -04:00
Ilija Lazoroski
dcd9cab0f4
Project: Remove clear_simulation_data entry from vulture_allowlist
2022-09-13 13:40:54 +02:00
Ilija Lazoroski
62ab6e5a77
Common: Add generic events to PydanticEventSerializer
2022-09-13 13:38:41 +02:00
Ilija Lazoroski
88d65f40ae
Project: Add PydanticEventSerializer to vulture_allowlist
2022-09-13 13:38:41 +02:00
Ilija Lazoroski
9e9160304c
UT: Add unit tests for PydanticEventSerializer
2022-09-13 13:38:41 +02:00
Ilija Lazoroski
1755d72ae7
Common: Export PydanticEventSerializer from __init__
2022-09-13 13:38:33 +02:00
Ilija Lazoroski
e756e0dbc3
Common: Implement EventSerializer for pydantic objects
2022-09-13 13:38:26 +02:00
Mike Salvatore
d58d8bb87b
Island: Remove RepositoryService
...
Issue #2234
2022-09-13 07:26:13 -04:00
Mike Salvatore
b226c84b6c
Merge pull request #2277 from guardicore/2234-refactor-clear-simulation-data
...
2234 refactor clear simulation data
2022-09-13 07:25:49 -04:00
Mike Salvatore
7c86bfc182
Island: Rename _handle_*_events() -> _subscribe_*_events()
2022-09-13 07:24:25 -04:00
Ilija Lazoroski
f944347644
UT: Test ResetAgentConfiguration endpoint
2022-09-13 11:41:08 +02:00
Ilija Lazoroski
f87fb39b0f
Project: Add clear_simulation_data to vulture_allowlist
...
Remove once #2277 is closed
2022-09-13 11:30:13 +02:00
Mike Salvatore
4e49e59447
Island: Rename local event_queue -> island_event_queue
...
Disambiguate Island event queues from Agent event queues
2022-09-13 11:07:35 +02:00
Mike Salvatore
6d297dc201
Island: Subscribe legacy Database.reset_db to CLEAR_SIMULATION_DATA
2022-09-13 11:07:35 +02:00
Mike Salvatore
9479b56722
Island: Subscribe ICredentialsRepository to CLEAR_SIMULATION_DATA
2022-09-13 11:07:35 +02:00
Mike Salvatore
745027bf93
Island: Wrap island event handler setup in separate function
2022-09-13 11:07:35 +02:00
Mike Salvatore
7f29e0342d
Island: Use interface instead of concrete in island_event_handlers
2022-09-13 11:07:35 +02:00
Mike Salvatore
ba724db969
Island: Publish IslandEventTopic.CLEAR_SIMULATION_DATA from resource
2022-09-13 11:07:35 +02:00
Mike Salvatore
2c750acc7a
Island: Return 204 No Content from ClearSimulationData POST
2022-09-13 11:07:35 +02:00
ilija-lazoroski
e0fb651c69
Merge pull request #2276 from guardicore/2234-refactor-reset-agent-config
...
2234 refactor reset agent config
2022-09-13 10:55:47 +02:00
Ilija Lazoroski
afa6c6b159
Island: Rename event_queue to island_event_queue
2022-09-13 10:44:52 +02:00
Ilija Lazoroski
2bfb85a652
UT: Add typehints to test_reset_agent_configuration
2022-09-13 09:33:48 +02:00
Ilija Lazoroski
599c753cf7
Island: Add docstrings to reset_agent_configuration event handler
2022-09-13 09:31:38 +02:00
Mike Salvatore
70978f9b30
Merge branch '2216-find-servers-concurrently' into 2216-fix-connection-issues
2022-09-12 16:49:07 -04:00
Kekoa Kaaikala
3dd2052dc5
Agent: Add debug logging to TCPRelay
2022-09-12 20:45:37 +00:00
Mike Salvatore
c532cdec72
Agent: Detect closed socket in SocketsPipe
...
When a socket is closed, select.select() returns the socket in the
read_list. A closed socket can be detected by attempting to read from
it. If 0 data is read, then the socket is closed.
See below for more details:
> If a socket is in the output readable list, you can be
as-close-to-certain-as-we-ever-get-in-this-business that a recv on
that socket will return something.
https://docs.python.org/3/howto/sockets.html#non-blocking-sockets
https://stackoverflow.com/questions/17386487/python-detect-when-a-socket-disconnects-for-any-reason
https://stackoverflow.com/questions/17705239/is-there-a-way-to-detect-that-tcp-socket-has-been-closed-by-the-remote-peer-wit
2022-09-12 16:35:36 -04:00
Mike Salvatore
fe954bb659
Agent: Call pipe.start(), not run()
...
run() blocks, start() starts the run method on a different thread.
2022-09-12 16:31:03 -04:00
Mike Salvatore
9002c47d56
Agent: Add a timeout on TCPPipeSpawner dest socket
2022-09-12 16:29:19 -04:00
Mike Salvatore
77c97062eb
Agent: Wrap relay stop logic in a method
2022-09-12 14:53:19 -04:00
Mike Salvatore
27cb2009fc
Agent: Let relay run indefinitely if user hasn't forced a stop
2022-09-12 14:46:42 -04:00
Mike Salvatore
ea47fc326a
Island: Remove extra newline from server_setup.py
2022-09-12 14:15:08 -04:00
Mike Salvatore
0e112cc31a
Island: Wire up event handlers before starting the island server
...
_start_island_server() blocks, so event handlers need to be
wired/subscribed before the server starts.
2022-09-12 14:12:30 -04:00
Mike Salvatore
ecab1be70e
Island: Change IslandEventTopic definition from dynamic to static
...
My code completion tool doesn't play well with dynamically defined
Enums.
2022-09-12 13:35:47 -04:00
Mike Salvatore
8b49554cb5
Island: Add island_event_handlers package
2022-09-12 12:00:05 -04:00
Mike Salvatore
3e67f5696c
Island: Move setup_island_event_handlers to monkey_island.cc.setup
2022-09-12 11:56:34 -04:00
Mike Salvatore
c02f87add0
Merge branch '2234-extract-network-utils-from-services' into 2234-refactor-reset-agent-config
2022-09-12 11:53:19 -04:00
Mike Salvatore
ad3dd6ba36
Island: Move network_utils from services/ -> server_utils/
2022-09-12 11:52:53 -04:00
Mike Salvatore
285e6aaa35
Island: Remove disused local_ips() functions
2022-09-12 11:48:36 -04:00
Mike Salvatore
4bc9f735be
Island: Rename setup_island_event_{subscribers,handlers}
2022-09-12 11:25:58 -04:00
Mike Salvatore
fd7a00a225
Island: Rename subscribe_to_topics() -> setup_island_event_subscribers()
2022-09-12 11:20:17 -04:00
vakaris_zilius
c2c2993ff7
Agent: Fix a bug(peeking socket consumes data)
...
sock.recv takes two parameters instead of one
2022-09-12 15:01:21 +00:00
Mike Salvatore
a01785838d
Agent: Pass keep_tunnel_open timeout as new_client_timeout
2022-09-12 10:24:26 -04:00
Mike Salvatore
67893b7825
Agent: Find/check island servers concurrently
2022-09-12 10:16:54 -04:00
Mike Salvatore
a9edbb2874
Agent: Add ThreadSafeIterator
2022-09-12 10:16:51 -04:00
Ilija Lazoroski
0ca13eb93d
Island: Add subscribe_to_topics on server setup
2022-09-12 15:59:58 +02:00
Ilija Lazoroski
b834bfe7f7
Island: Publish RESET_AGENT_CONFIGURATION from endpoint
2022-09-12 15:22:09 +02:00
Mike Salvatore
191ee1a5f9
Agent: Change order of spawn pipe and add relay user
...
If we were unsuccessful in starting the pipe, we don't want to sit
around and wait for a relay user to connect.
2022-09-12 08:12:17 -04:00
vakarisz
7ff61423dc
Agent: Log uncaught errors in tcp_connection_handler.py thread
...
If there's an uncaught error in the thread, the error won't propagate to the caller and we wouldn't know what went wrong from the logs. This fixes things and all uncaught errors get logged
2022-09-12 12:02:34 +00:00
Kekoa Kaaikala
9ff92d2128
Agent: Fix ident not available in constructor
2022-09-12 11:59:22 +00:00
Kekoa Kaaikala
756bfe488b
Agent: Provide address as string to connect()
2022-09-12 11:59:22 +00:00
Ilija Lazoroski
f9b1c5ebd2
Island: Export reset_agent_configuration from __init__
2022-09-12 13:21:52 +02:00
Ilija Lazoroski
e50b034324
Island: Create callable reset_agent_configuration class
2022-09-12 13:21:44 +02:00
Mike Salvatore
bc769ee6b8
Common: Define del_key() in terms of MutableMapping.pop()
2022-09-11 22:59:58 -04:00
vakarisz
c756c7ace2
BB: Add tunneling test diagrams
2022-09-09 17:51:37 +03:00
vakarisz
46152c0cd2
Island, Agent: Update pydantic to 1.10
...
Without this update SecretStr is of an unhashable type
2022-09-09 17:04:47 +03:00
Ilija Lazoroski
e690eb7c61
Project: Lock the windows pipenv version to 2022.7.4
2022-09-09 09:16:45 -04:00
Ilija Lazoroski
a4b6e2157b
Agent: Cast cmd_island_port to int
2022-09-09 14:28:14 +02:00
Ilija Lazoroski
2b4b462c1a
Agent: Relock Pipfile
2022-09-09 08:23:00 -04:00
Ilija Lazoroski
867a3a83e7
Agent: Use get_plaintext in SSHExploiter login with password
2022-09-09 08:22:56 -04:00
Ilija Lazoroski
6171b66282
Agent: Fix SSHCollector to publish list of Credentials
...
Previously it was publish list of lists of Credentials
2022-09-09 08:22:53 -04:00
Kekoa Kaaikala
093e2c79dc
Agent: Add relay to servers list for exploited hosts
2022-09-09 08:19:56 -04:00
Mike Salvatore
20649b5e3c
Merge pull request #2263 from guardicore/2216-remove-unused-code
...
2216 remove unused code
2022-09-09 08:19:56 -04:00
Mike Salvatore
0246f6b981
Agent: Convert _cmd_island_port to int in one place
2022-09-09 08:19:56 -04:00
Kekoa Kaaikala
4a2297b097
Island: Remove TunnelTelem
2022-09-09 08:19:56 -04:00
Kekoa Kaaikala
3516fa1fec
Agent: Fix: Pass port as int
2022-09-09 08:19:56 -04:00
Kekoa Kaaikala
cb45cd8873
Agent: Remove TunnelTelem
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
Shreya Malviya
7530a89152
Agent: Remove usage of proxies
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
Kekoa Kaaikala
1c805184fe
Agent: Remove unused proxy classes
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
Kekoa Kaaikala
d7cabc2f5e
Agent: Get rid of default_tunnel
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
dcb77d6285
Agent: Remove MonkeyTunnel
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
Ilija Lazoroski
178b296f75
Agent: Use iterator in ControlClient.find_server
2022-09-09 08:13:02 -04:00
Ilija Lazoroski
02a919123b
Agent: Remove thread join in find_server
2022-09-09 08:13:02 -04:00
Shreya Malviya
cd91b3e42a
UT: Rename RequestsGetArgument -> MockRequestsGetResponsePerServerArgument
2022-09-09 08:13:02 -04:00
Shreya Malviya
0239a1be6b
UT: Simplify test logic in test_control_find_server__control_message_sent_to_necessary_relays
2022-09-09 08:13:02 -04:00
Shreya Malviya
47f838cf9f
UT: Rename test_control_find_server_socket -> test_control_find_server__control_message_sent_to_necessary_relays
2022-09-09 08:13:02 -04:00
Shreya Malviya
f847757a9a
UT: Rename test_control_find_server_any_exception -> test_control_find_server__no_available_relays
2022-09-09 08:13:02 -04:00
Shreya Malviya
a39917d9aa
UT: Fix test_control_find_server_socket to check call parameters
2022-09-09 08:13:02 -04:00
Ilija Lazoroski
804bd4eadb
Agent: Modify find_server to accept list of servers
2022-09-09 08:13:02 -04:00
Ilija Lazoroski
ac058c7788
Agent: Add TODO to rework address_to_ip_port to use list of servers
2022-09-09 08:13:02 -04:00
Mike Salvatore
4bff110f35
Merge branch '2216-add-tcprelay' into tcp-relay
...
PR #2231
2022-09-09 08:12:50 -04:00
Mike Salvatore
ee262778de
Merge pull request #2243 from guardicore/2216-pass-servers-to-exploiters
...
2216 pass servers to exploiters
2022-09-09 08:07:24 -04:00
Mike Salvatore
f16f111543
Merge pull request #2242 from guardicore/2216-modify-agent-build-commands
...
2216 modify agent build commands
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
4fca8ccf5d
UT: Fix credentials passed to exploiter test
2022-09-09 08:07:24 -04:00
Mike Salvatore
579616dd91
Merge pull request #2241 from guardicore/2216-modify-agent-command-line-arguments
...
Agent: Modify command line arguments to accept list of servers
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
067d50f3c4
Agent: Modify agent build command line to accept list of servers
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
f93125f671
Agent: Pass servers when running exploits in Puppet
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
e842c45e42
Agent: Add list of servers to dropper
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
ddc4f4d836
Agent: Remove tunnel from aget build command functions
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
c51217507a
Agent: Pass servers to exploit_host in ExploiterWrapper.Inner
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
33f20c7da0
Agent: Remove tunnel argument from dropper
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
4ad2c35c94
UT: Remove tunnel from build_monkey_commandline
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
8fc0d52b8b
Agent: Pass list of servers in HostExploiter.exploit_host
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
0f73cc91f2
Changelog: Add entry for changing "-s/--server" to "-s/--servers"
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
b2f0b54d37
Agent: Add list of server when propagating
2022-09-09 08:07:24 -04:00
Mike Salvatore
1776b3b0b7
Agent: Modify exception message when server connection fails
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
f104f31dcd
Agent: Pass list of servers to Exploiter.exploit_hosts
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
c9a9367dd1
Changelog: Change -s/--servers to accept list of servers
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
8b2107d197
Agent: Accept list of servers in AutomatedMaster
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
c44a0406ee
Changelog: Add entry for removing -t/--tunnel from agent command line arguments
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
a79b579cdc
Agent: Construct AutomatedMaster with list of servers
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
ba187ed830
Agent: Modify command line arguments to accept list of servers
...
Removes tunnel argument
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
e6b0e43580
UT: Fix Powershell unit tests to accept list of servers
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
42de7140f3
Agent: Modify exploiters to use list of servers
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
95ea5e481e
Agent: Accept list of servers in HostExploiter
2022-09-09 08:07:24 -04:00
Ilija Lazoroski
e4d49f5a12
Agent: Add servers list to ExploiterWrapper
2022-09-09 08:07:24 -04:00
vakarisz
72c76319d1
BB: Move tunneling to depth 4a test suite
2022-09-08 16:58:14 +03:00
vakarisz
b6588925e2
BB: Add tunneling-13 machine
2022-09-08 16:56:32 +03:00
Mike Salvatore
d009bc458c
Island: Import TypeAlias from typing_extensions in node.py
2022-09-07 11:15:07 -04:00
Mike Salvatore
fa8a72dc86
Island: Remove unused import from node.py
2022-09-07 11:13:06 -04:00
Mike Salvatore
0310c737d7
UT: Remove unused imports from test_node.py
2022-09-07 11:12:30 -04:00
Mike Salvatore
588b740970
Merge pull request #2253 from guardicore/2217-remove-marshmallow
...
2217 remove marshmallow
2022-09-07 10:57:29 -04:00
Mike Salvatore
68bc73d86a
Merge branch 'i-node-repository' into develop
2022-09-07 10:25:00 -04:00
Mike Salvatore
4e4e4cf97d
Island: Export INodeRepository from monkey_island.cc.repository
2022-09-07 10:22:54 -04:00
Mike Salvatore
5f874356b1
Island: Remove INetworkMapRepository
...
Replaced by monkey_island.cc.models.Node and INodeRepository
2022-09-07 10:22:54 -04:00
Mike Salvatore
8c69780f4e
Island: Add INodeRepository
2022-09-07 10:22:54 -04:00
Mike Salvatore
35ecdb11ab
Island: Add docstrings to Node model
2022-09-07 10:22:52 -04:00
Mike Salvatore
094a0b1a8d
Island: Use Mapping for tracking node connections
2022-09-07 10:21:51 -04:00
VakarisZ
6891c82a46
Merge pull request #2252 from guardicore/2217-remove-unused-code
...
2217 remove unused code
2022-09-07 16:58:42 +03:00
vakaris_zilius
f0b50b254e
Island: Refactor simulation to use pydantic
2022-09-07 13:48:19 +00:00
Ilija Lazoroski
6fe501195b
Island: Remove marshmallow-enum from Pipfile
2022-09-07 15:33:09 +02:00
Ilija Lazoroski
6fb77694ef
Island: Remove marshmallow from Pipfile
2022-09-07 15:31:51 +02:00
Ilija Lazoroski
62982459b0
Agent: Remove marshmallow-enum from Pipfile
2022-09-07 15:30:17 +02:00
Ilija Lazoroski
8aad9701cd
Agent: Remove marshmallow for Pipfile
2022-09-07 15:28:18 +02:00
vakaris_zilius
895de8c720
Common: Delete IJSONSerializable.py
...
This interface is no longer used (replaced by pydantic objects)
2022-09-07 13:19:39 +00:00
vakaris_zilius
b7e6435ced
UI: Delete InternalConfig.js
...
This is no longer used, advanced tab only contains a couple of fields now
2022-09-07 13:17:01 +00:00
vakaris_zilius
c73fe7a3a9
Island: Remove unused CustomJSONEncoder
...
This is replaced by APIEncoder in representations.py
2022-09-07 13:16:57 +00:00
Mike Salvatore
d39d6ea10f
Merge pull request #2240 from guardicore/2217-pydantic-credentials
...
2217 pydantic credentials
2022-09-07 09:10:56 -04:00
vakaris_zilius
d7dde14cae
Agent, Island: Update pydantic version to 1.10.2 from 1.9.2
2022-09-07 13:01:46 +00:00
vakaris_zilius
adca1683c8
UI: Improve style in ReformatHook.js
2022-09-07 13:01:46 +00:00
Mike Salvatore
1fc0718554
Agent: Use isinstance() to check if identity is Username
2022-09-07 07:50:39 -04:00
vakaris_zilius
c8f131e6b0
Common: Small style improvements in credentials.py
2022-09-07 11:48:34 +00:00
vakaris_zilius
5608bb3f11
Common, Agent: Rename get_plain_text to get_plaintext
2022-09-07 11:48:34 +00:00
vakaris_zilius
6e254c71d7
Common: Fix failing UT and add more for get_plain_text
2022-09-07 11:48:34 +00:00
vakaris_zilius
dc8e644bc5
UT: Fix some of powershell UT's
2022-09-07 11:48:33 +00:00
vakaris_zilius
ece4d9383e
Agent, Common: Refactor pydantic credentials to use SecretStr
2022-09-07 11:48:33 +00:00
Mike Salvatore
17e3b3d205
UT: Add `simplify=True` to Credentials serialization
2022-09-07 11:48:33 +00:00
Mike Salvatore
646b3a1b46
BB: Add `simplify=True` to Credentials serialization
2022-09-07 11:48:33 +00:00
Mike Salvatore
8fd226cd23
UT: Add safety test since we will switch to pydantic.SecretType
2022-09-07 11:48:33 +00:00
vakaris_zilius
b08097b131
Island, Common: Small style improvements
2022-09-07 11:48:33 +00:00
vakaris_zilius
16a59a3f5a
UT: Fix typehint in credentials conftest.py
2022-09-07 11:48:33 +00:00
vakaris_zilius
233090942a
Agent: Use issintance instead of type comparison in credential repo
2022-09-07 11:48:32 +00:00
vakaris_zilius
792895a25c
UI: Improve the naming/handling of credential types in the UI
2022-09-07 11:48:32 +00:00
vakaris_zilius
9fb2804202
Agent: Use SecretStr and SecretBytes instead of SecretField
...
SecretField is a base type for secrets, but it doesn't seem to be exported. When the agent is ran, this import fails
2022-09-07 11:48:32 +00:00
vakaris_zilius
472ca382f1
Island, BB: Fix credential conversion to dict bugs
2022-09-07 11:48:32 +00:00
vakaris_zilius
e5574240e9
Island, Agent: Change json encryptors to handle pydantic models
2022-09-07 11:48:32 +00:00
vakaris_zilius
7dba3c4fed
UI: Remove duplicate credentials from report
2022-09-07 11:48:31 +00:00
vakaris_zilius
9cc11f6a09
Island: Remove misleading comment
2022-09-07 11:48:31 +00:00
vakaris_zilius
f1b8ad373b
Island: Fix bug in credentials_parser.py
2022-09-07 11:48:31 +00:00
vakaris_zilius
ed24108bfa
Project: Add temporary IJSONSerializable ignore
2022-09-07 11:48:28 +00:00
vakaris_zilius
d347521a29
Island, Agent: Fix bugs in credential object creation
2022-09-07 11:47:56 +00:00
vakarisz
7149c704a2
Island, Agent: Fix credential parsing to match pydantic syntax
2022-09-07 11:47:56 +00:00
vakarisz
d73cbee591
Agent, Island: Use pydantic credentials and methods
...
Since the interface of credential serialization changed, code was modified to use the new interface
2022-09-07 11:47:56 +00:00
vakarisz
f018b85f56
UT: Add nt/lm hash unit test and data
2022-09-07 11:47:55 +00:00
vakarisz
12bc514a92
Agent: Remove unused ransomware directory
2022-09-07 11:47:55 +00:00
vakarisz
f868f03ea7
Common: Refactor credentials from marshmallow to pydantic
2022-09-07 11:47:53 +00:00
vakarisz
3ac60988a8
Common: Replace credentials dataclasses with pydantic dataclasses
...
For pydantic to work properly, the models need to either use pydantic version of dataclass or inherit BaseModel, but not both. https://pydantic-docs.helpmanual.io/usage/dataclasses/
2022-09-07 11:46:38 +00:00
Kekoa Kaaikala
1e0b26af8b
Agent: Add docstring to SocketsPipe
2022-09-06 19:55:25 +00:00
Kekoa Kaaikala
7ebc403029
Agent: Add docstrings to RelayConnectionHandler
2022-09-06 19:54:53 +00:00
Mike Salvatore
5972f87391
Merge pull request #2245 from guardicore/2233-island-event-queue
...
Add IIslandEventQueue
2022-09-06 15:34:49 -04:00
Kekoa Kaaikala
efac1dae98
Agent: Pass correct type to add_potential_user()
2022-09-06 19:33:03 +00:00
Kekoa Kaaikala
bdc8de026e
Agent: Move TCPRelay into network.relay package
2022-09-06 19:26:26 +00:00
Kekoa Kaaikala
813c5f9d3b
Agent: Clarify exceptions in SocketsPipe._pipe()
2022-09-06 19:16:49 +00:00
Mike Salvatore
205848f2a5
Project: Remove PyPubSubIslandEventQueue from vulture_allowlist.py
2022-09-06 15:13:35 -04:00
Mike Salvatore
166588d00d
Project: Remove PyPubSubAgentEventQueue from vulture_allowlist.py
2022-09-06 15:12:37 -04:00
Mike Salvatore
aee4887b64
Island: Fix island event queue import
2022-09-06 15:11:02 -04:00
Mike Salvatore
84aa993a8b
Island: Improve `event` docstring in IIslandEventQueue
2022-09-06 15:08:50 -04:00
Mike Salvatore
01ff1711c6
Merge pull request #2246 from guardicore/2233-pypubsubislandeventqueue
...
Add PyPubSubIslandEventQueue
2022-09-06 15:06:08 -04:00
Mike Salvatore
4e4331c5c3
Common: s/event/kwargs in PyPubSubPublisherWrapper comment
2022-09-06 15:05:29 -04:00
Mike Salvatore
1036189fcc
Island: Rename _pypubsub_publisher_wrappe{d,r}
2022-09-06 15:01:10 -04:00
Mike Salvatore
b16d19e0ed
Common: Rename _pypubsub_publisher_wrappe{d,r}
2022-09-06 15:00:24 -04:00
Mike Salvatore
76fe0be990
Agent: Address addr type TODO in RelayConnectionHandler
2022-09-06 14:54:13 -04:00
Mike Salvatore
1cd544e227
Agent: Call mixin constructor in TCPConnectionHandler
2022-09-06 14:50:42 -04:00
Mike Salvatore
7edb15d825
Agent: Fix host/port initialization in TCPConnectionHandler
2022-09-06 14:43:23 -04:00
Mike Salvatore
17356ca079
Agent: Fix del_key() import in relay_user_handler.py
2022-09-06 14:42:53 -04:00
Mike Salvatore
017aabe8f7
Agent: Change relay__user_handler.DEFAULT_NEW_CLIENT_TIMEOUT
2022-09-06 14:35:49 -04:00
Kekoa Kaaikala
65f4edc625
Agent: Add InterruptableThreadMixin
2022-09-06 18:30:41 +00:00
Kekoa Kaaikala
066947c59f
Agent: Remove closed pipes from TCPPipeSpawner
2022-09-06 18:04:56 +00:00
Mike Salvatore
83cc5fc336
Agent: Fix Pipfile.lock
...
`pipenv install` was run on Linux without `--keep-outdated`, which
removed Windows-only dependencies. This commit fixes that.
2022-09-06 14:03:36 -04:00
Mike Salvatore
377bb293fe
UT: Use `self` instead of class name
2022-09-06 13:00:41 -04:00
Mike Salvatore
59c58b3115
UT: Replace fn() with SubscriberSpy callable
2022-09-06 12:59:22 -04:00
Mike Salvatore
e1e119c27a
Common: Add missing type hint for PyPubSubPublisherWrapper._refs
2022-09-06 12:57:24 -04:00
Mike Salvatore
ba52eae8ed
Common: Decouple PyPubSubPublisherWrapper from events
2022-09-06 12:56:49 -04:00
Kekoa Kaaikala
c601f2214a
Agent: Use del_key instead of del
2022-09-06 16:39:41 +00:00
Kekoa Kaaikala
14de4db9fa
UT: Use more specific assert in test_connection_spawns_pipe
2022-09-06 16:25:37 +00:00
Kekoa Kaaikala
c021d54c05
Agent: Reduce relay shutdown responsiveness
2022-09-06 14:57:10 +00:00
Kekoa Kaaikala
e438a8b9c7
Agent: Use EggTimer
2022-09-06 14:41:17 +00:00
Kekoa Kaaikala
3ad96a7e6b
Agent: Simplify RELAY_CONTROL_MESSAGE import
2022-09-06 14:21:07 +00:00
Kekoa Kaaikala
b5345a38d9
Agent: Rename TCPConnectionHandler parameters
...
Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2022-09-06 14:20:11 +00:00
Mike Salvatore
a74266464b
Merge pull request #2247 from guardicore/2217-fix-bb-tests
...
2217 fix bb tests
2022-09-06 10:14:37 -04:00
Shreya Malviya
c16c6456aa
Island: Remove unneeded comments from PyPubSubIslandEventQueue
2022-09-06 19:41:59 +05:30
Shreya Malviya
69813f8cd4
Common: Add explanatory comments about pypubsub's internal working in PyPubSubPublisherWrapper
2022-09-06 19:41:42 +05:30
Mike Salvatore
ce6d5cc705
BB: Add contained type to _propagation_credentials type hint
2022-09-06 10:10:08 -04:00
Shreya Malviya
70468c37fb
Island: Use PyPubSubPublisherWrapper in PyPubSubIslandEventQueue
2022-09-06 19:38:48 +05:30
Shreya Malviya
3c71211b79
Common: Use PyPubSubPublisherWrapper in PyPubSubAgentEventQueue
2022-09-06 19:38:16 +05:30
Shreya Malviya
3cf332a079
Common: Add PyPubSubPublisherWrapper
2022-09-06 19:37:35 +05:30
Kekoa Kaaikala
d7398e1014
Agent: Move keep_connection into the run() method
2022-09-06 14:03:17 +00:00
Ilija Lazoroski
eee6291a3e
BB: Set deep copy when copying agent_configuration
2022-09-06 15:49:02 +02:00
Ilija Lazoroski
b5bd0532b7
BB: Fix type annotation in noop_test_configuration
2022-09-06 15:41:54 +02:00
Shreya Malviya
38c6d53cc5
UT: Move test_pypubsub_island_event_queue.py out of common/ and in to monkey_island/
2022-09-06 19:05:50 +05:30
Shreya Malviya
8f35a43591
Project: Fix import path in Vulture allowlist
2022-09-06 19:05:14 +05:30
Shreya Malviya
f2e7a3d66f
Island: Add Island event queue stuff to monkey_island/
2022-09-06 19:05:09 +05:30
Shreya Malviya
502a875fdd
Common: Move Island event queue stuff out of common/
2022-09-06 19:04:41 +05:30
Kekoa Kaaikala
333e587aab
Agent: Use is_set() of threading.Event
2022-09-06 13:20:19 +00:00
Kekoa Kaaikala
906edf3662
Agent: Remove unneccessary call in SocketsPipe
2022-09-06 12:52:00 +00:00
Kekoa Kaaikala
311807cf31
Agent: Update RelayUserHandler docstrings
2022-09-06 12:48:19 +00:00
Shreya Malviya
5da8b424b5
UT: Use IslandEventTopic enum's names for pypubsub topics
2022-09-06 18:13:25 +05:30
Shreya Malviya
004337583a
Common: Use IslandEventTopic enum's names for pypubsub topics
2022-09-06 18:11:08 +05:30
Shreya Malviya
1a09f26fd9
Common: Modify IslandEventTopic enum to not have values
2022-09-06 18:07:25 +05:30
Mike Salvatore
e7aca8326e
Island: Remove CC_TUNNEL from CommunicationType
...
This is no longer needed after #2216 .
2022-09-06 08:34:14 -04:00
Mike Salvatore
b33fd7f436
Island: Add ConnectionTarget TypeAlias
2022-09-06 08:33:49 -04:00
Shreya Malviya
27c8a1019b
Island: Register IIslandEventQueue instance in DI container
2022-09-06 17:59:17 +05:30
Kekoa Kaaikala
7a7ea96dbb
Agent: Set daemon thread in superclass constructor
2022-09-06 12:27:07 +00:00
Shreya Malviya
237f6d01b6
UT: Add tests for PyPubSubIslandEventQueue
2022-09-06 17:53:36 +05:30
Shreya Malviya
71c7a9a533
Common: Change parameter name event_data -> event in Island event queue
2022-09-06 17:47:01 +05:30
Kekoa Kaaikala
483bd943bd
Agent: Rename tcp.py to sockets_pipe.py
2022-09-06 12:14:52 +00:00
vakaris_zilius
3b2954ec02
UI: Fix missing default brute-forcer options in config schema
...
If we don't provide default options in config schema AdvancedMultiSelect doesn't know what to reset it back to. Essentially we need two states, one for the actual value of configuration and one for the default. When we disable SMB, the SMB value with all it's options are deleted. When we enable it, we need to pull its options from somewhere.
2022-09-06 08:51:22 +00:00
Shreya Malviya
265e083571
UT: Rename test_pypubsub_event_queue.py -> test_pypubsub_agent_event_queue.py
2022-09-06 13:33:36 +05:30
Shreya Malviya
ac2217ce8a
Common: Add IslandEventSubecriber type
2022-09-06 13:30:45 +05:30
Shreya Malviya
fb4bfb7be1
Project: Fix PyPubSubIslandEventQueue entries to Vulture allowlist
2022-09-06 13:25:59 +05:30
Shreya Malviya
342a4959b3
Common: Import PyPubSubIslandEventQueue in common/event_queue/__init__.py
2022-09-06 13:20:53 +05:30
Shreya Malviya
4219b6cbd4
Common: Rename IslandEventTopics -> IslandEventTopic
2022-09-06 13:19:53 +05:30
Shreya Malviya
c9500cd04f
Common: Add PyPubSubIslandEventQueue
2022-09-06 13:17:26 +05:30
Shreya Malviya
71e9f68fe6
Common: Fix IslandEventTopics enum values
2022-09-06 13:05:35 +05:30
Shreya Malviya
3dba1bc7d5
Common: Import IIslandEventQueue, IslandEventTopics in common/event_queue/__init__.py
2022-09-06 13:04:51 +05:30
Shreya Malviya
eef72b245f
UT: Use AgentEventSubscriber in place of EventSubscriber
2022-09-06 12:10:29 +05:30
Shreya Malviya
86018be736
Common: Rename EventSubscriber -> AgentEventSubscriber
2022-09-06 12:09:48 +05:30
Shreya Malviya
122e09426e
Project: Add IIslandEventQueue entries to Vulture allowlist
2022-09-06 12:08:06 +05:30
Shreya Malviya
f4a0b89e87
Common: Add IIslandEventQueue
2022-09-06 11:44:34 +05:30
Shreya Malviya
9bc4d8c241
Common: Fix docstring in IAgentEventQueue.publish
2022-09-06 11:44:10 +05:30
Mike Salvatore
6abcaa9bd6
Agent: Remove extra newline in RelayConnectionHandler
2022-09-05 20:03:17 -04:00
Shreya Malviya
d6df50e323
Common: Make docstring in IAgentEventQueue more specific
2022-09-05 19:36:39 +05:30
Shreya Malviya
e1e4b054cf
Project: Use correct file path in Vulture allowlist
2022-09-05 19:30:32 +05:30
Shreya Malviya
612132a906
Common: Rename pypubsub_event_queue.py -> pypubsub_agent_event_queue.py
2022-09-05 19:30:28 +05:30
Shreya Malviya
21815291a0
Project: Use correct variable in Vulture allowlist
2022-09-05 19:29:37 +05:30
Shreya Malviya
331c11751f
UT: Use PyPubSubAgentEventQueue in place of PyPubSubEventQueue
2022-09-05 19:29:37 +05:30
Shreya Malviya
de74b866bb
Island: Rename PyPubSubEventQueue -> PyPubSubAgentEventQueue
2022-09-05 19:29:37 +05:30
Shreya Malviya
5b7d3bfb70
Agent: Rename PyPubSubEventQueue -> PyPubSubAgentEventQueue
2022-09-05 19:29:37 +05:30
Shreya Malviya
a83446e0f2
Common: Rename PyPubSubEventQueue -> PyPubSubAgentEventQueue
2022-09-05 19:29:37 +05:30
Shreya Malviya
cb9200b3c0
Common: Rename i_event_queue.py -> i_agent_event_queue.py
2022-09-05 19:29:37 +05:30
Shreya Malviya
e14c1ea5f3
Project: Use correct file path in Vulture allowlist
2022-09-05 19:29:37 +05:30
Shreya Malviya
28cf860aeb
UT: Use IAgentEventQueue in place of IEventQueue
2022-09-05 19:29:37 +05:30
Shreya Malviya
acb049f1f1
Island: Rename IEventQueue -> IAgentEventQueue
2022-09-05 19:29:37 +05:30
Shreya Malviya
74e17ef006
Agent: Rename IEventQueue -> IAgentEventQueue
2022-09-05 19:29:37 +05:30
Shreya Malviya
903d43fe26
Common: Rename IEventQueue -> IAgentEventQueue
2022-09-05 19:29:37 +05:30
Shreya Malviya
f577e48d72
UT: Use AbstractAgentEvent in place of AbstractEvent
2022-09-05 19:29:37 +05:30
Shreya Malviya
ce43a46a9c
Common: Rename abstract_event.py -> abstract_agent_event.py
2022-09-05 19:29:32 +05:30
Shreya Malviya
76cf34b5f0
Common: Rename AbstractEvent -> AbstractAgentEvent
2022-09-05 19:00:20 +05:30
Kekoa Kaaikala
5a8d8ccad5
Agent: Add name to SocketsPipe thread
2022-09-02 20:07:22 +00:00
Kekoa Kaaikala
72144faefc
Agent: Update TCPRelay to separate responsbilities
2022-09-02 19:58:01 +00:00
Kekoa Kaaikala
bbc9cf16e6
Agent: Add RelayConnectionHandler
2022-09-02 19:17:43 +00:00
Mike Salvatore
de5da88c22
Merge pull request #2238 from guardicore/agent-repository
...
Agent repository
2022-09-02 15:04:16 -04:00
Kekoa Kaaikala
b179f602c4
Agent: Give TCPConnectionHandler thread a name
2022-09-02 15:05:19 +00:00
Mike Salvatore
bfcab0f6d9
Agent: Make parent `None` for now
...
Fixes #2235
Fixes #2236
2022-09-02 08:12:23 -04:00
Shreya Malviya
3ced1d97d9
Merge pull request #2229 from guardicore/2217-pydantic-for-agent-configuration
...
Agent configuration with pydantic
2022-09-02 12:32:31 +05:30
Shreya Malviya
4017f094cf
Project: Add entries to Vulture allowlist
2022-09-02 12:25:08 +05:30
Shreya Malviya
c985337df0
BB: Fix configuration modification logic in all test configurations since TestConfiguration is a dataclass
2022-09-02 12:05:30 +05:30
Shreya Malviya
daec8843af
BB: Use positional arguments for PluginConfiguration object creation where missed in depth_1_a.py
2022-09-02 12:05:30 +05:30
Shreya Malviya
6cf62d48cb
BB: Use `replace_agent_configuration()` and `replace_propagation_credentials()` for all test configuration modifications
2022-09-02 12:05:30 +05:30
Shreya Malviya
2352bb0d5e
BB: Fix configuration modification logic in zerologon.py
2022-09-02 12:05:30 +05:30
Shreya Malviya
ad6449507d
BB: Fix configuration modification logic in wmi_mimikatz.py
2022-09-02 12:05:30 +05:30
Shreya Malviya
a0d0f127f9
BB: Fix configuration modification logic in smb_pth.py
2022-09-02 12:05:30 +05:30
Shreya Malviya
e564bd1072
BB: Fix configuration modification logic in powershell_credentials_reuse.py
2022-09-02 12:05:30 +05:30
Shreya Malviya
15fd1f9f72
BB: Fix configuration modification logic in depth_3_a.py
2022-09-02 12:05:30 +05:30
Shreya Malviya
0392cd5794
BB: Fix configuration modification logic in depth_2_a.py
2022-09-02 12:05:30 +05:30
Shreya Malviya
a2b8338ac7
BB: Fix configuration modification logic in depth_1_a.py
2022-09-02 12:05:30 +05:30
Shreya Malviya
1abf2b7f03
BB: Add `simplify=True` when converting test agent configuration to dict in MonkeyIslandClient
2022-09-02 12:05:30 +05:30
Shreya Malviya
637023c568
BB: Create copy of agent configuration when updating it for different tests
2022-09-02 12:05:30 +05:30
Shreya Malviya
446524b5b8
BB: Use keyword arguments where missing in configuration objects' creation
2022-09-02 12:05:30 +05:30
Shreya Malviya
c7ee48fff1
BB: Remove unneeded configuration replacing functions
2022-09-02 12:05:30 +05:30
Shreya Malviya
a65415588f
BB: Simplify logic in BB tests' configurations
2022-09-02 12:05:30 +05:30
Shreya Malviya
ff52fbefe4
BB: Fix AgentConfiguration logic in MonkeyIslandClient
2022-09-02 12:05:30 +05:30
Shreya Malviya
f841bc041b
Agent: Fix AgentConfiguration object creation logic in ControlChannel.get_config()
2022-09-02 12:05:30 +05:30
Mike Salvatore
0f21ad2e09
Common: Allow 0 for keep_tunnel_open_time
2022-09-02 12:05:30 +05:30
Mike Salvatore
326d128be8
Common: Allow 0 for maximum_depth
2022-09-02 12:05:30 +05:30
Mike Salvatore
8d991f462f
UT: Use kwargs instead of **dict in test_agent_configuration.py
2022-09-02 12:05:30 +05:30
Mike Salvatore
1444ce10c3
Common: Remove unneeded `import annotations` from agent_configuration
2022-09-02 12:05:30 +05:30
Shreya Malviya
46ee6de13e
UT: Remove unneeded function `convert_all_lists_to_tuples_in_mapping()`
2022-09-02 12:05:30 +05:30
Shreya Malviya
9db1a19ad3
UT: Simplify assertion logic in common/agent_configuration/test_agent_configuration.py
2022-09-02 12:05:29 +05:30
Shreya Malviya
6460639f91
UT: Use `simplify=True` when converting configuration to dict
2022-09-02 12:05:29 +05:30
Shreya Malviya
d5ee4c7f27
Island: Use `simplify=True` when converting configuration to dict
2022-09-02 12:05:29 +05:30
Shreya Malviya
fa1620ebb9
UT: Add tests for checking that validators in ScanTargetConfiguration work
2022-09-02 12:05:29 +05:30
Shreya Malviya
f7f0047868
UT: Simplify assertion logic in test_agent_configuration_endpoint
2022-09-02 12:05:29 +05:30
Shreya Malviya
5b1558ce53
Project: Include classes in Vulture allowlist
2022-09-02 12:05:29 +05:30
Shreya Malviya
6234263746
Island: Simplify configuration updating logic in PBAFileUpload
2022-09-02 12:05:29 +05:30
Shreya Malviya
4f599c3118
UT: Rename `convert_lists_to_tuples` -> `convert_all_lists_to_tuples_in_mapping`
2022-09-02 12:05:29 +05:30
Shreya Malviya
82d8f5bacd
Island: Simplify JSON logic inFileAgentConfigurationRepository
2022-09-02 12:05:29 +05:30
Shreya Malviya
eb207de919
UT: Convert lists to tuples before comparing values in configuration tests
...
Probably not the best way to do this
2022-09-02 12:05:29 +05:30
Shreya Malviya
1f77fd468a
UT: Add function `convert_lists_to_tuples` to utils
2022-09-02 12:05:29 +05:30
Shreya Malviya
9b924c55b6
Common: Remove utils.InvalidConfigurationError
2022-09-02 12:05:29 +05:30
Shreya Malviya
fe3706c0b4
Common: Remove agent_configuration.InvalidConfigurationError
2022-09-02 12:05:29 +05:30
Shreya Malviya
dda79c0809
Common: Remove unneeded code for freezing lists to tuples
2022-09-02 12:05:29 +05:30
Shreya Malviya
f11e2dc8a1
UT: Fix configuration logic to work with pydantic in `agent_configuration` fixture
2022-09-02 12:05:29 +05:30
Shreya Malviya
016cf80cdd
UT: Fix AgentConfiguration object creation logic FileAgentConfigurationRepository tests
2022-09-02 12:05:29 +05:30
Shreya Malviya
f4e3bc2a89
Island: Fix AgentConfiguration logic in FileAgentConfigurationRepository
2022-09-02 12:05:29 +05:30
Shreya Malviya
a9a006a9fd
Agent: Replace fields in configuration using pydantic syntax in PBA file upload resource
2022-09-02 12:05:29 +05:30
Shreya Malviya
163c54a8c3
Agent: Replace fields in configuration using pydantic syntax in propagator
2022-09-02 12:05:26 +05:30
Shreya Malviya
45c6fda8b2
UT: Use keyword arguments when using configurations
2022-09-02 12:05:08 +05:30
Shreya Malviya
2b11fde827
Agent: Use keyword arguments when using PluginConfiguration in Master
2022-09-02 12:05:08 +05:30
Shreya Malviya
e68a5391c8
UT: Fix POST request in test_agent_configuration_endpoint to use new pydantic model AgentConfiguration
2022-09-02 12:05:08 +05:30
Shreya Malviya
fe792ffc6f
Island: Catch ValueError and TypeError instead of InvalidConfigurationError in resource AgentConfiguration's PUT
2022-09-02 12:05:08 +05:30
Shreya Malviya
433e154cd1
Island: Modify AgentConfiguration endpoint to use new pydantic model
2022-09-02 12:05:08 +05:30
Shreya Malviya
c79b3c4497
UT: Check that ValueError is raised instead of marshmallow.ValidationError in configuration tests
2022-09-02 12:05:08 +05:30
Shreya Malviya
a1b8bb24b4
Common: Raise ValueError instead of marshmallow.ValidationError in validators
2022-09-02 12:05:08 +05:30
Shreya Malviya
b20ad194ff
Common: Modify default configurations to work with new pydantic models
2022-09-02 12:05:08 +05:30
Shreya Malviya
96f213d4ee
Project: Add pydantic validators to Vulture allowlist
2022-09-02 12:05:08 +05:30
Shreya Malviya
430885ebd4
UT: Fix new pydantic configuration class names
2022-09-02 12:05:08 +05:30
Shreya Malviya
0d6e3809d7
Common: Rename all new pydantic configurations appropriately
2022-09-02 12:05:08 +05:30
Shreya Malviya
41e7cfb768
Common: Remove agent sub-configuration schemas
2022-09-02 12:05:08 +05:30
Shreya Malviya
f2c9952685
Common: Remove old sub-configurations using marshmallow
2022-09-02 12:05:08 +05:30
Shreya Malviya
1311fd5d27
Common: Remove old AgentConfiguration using marshmallow
2022-09-02 12:05:08 +05:30
Shreya Malviya
6d29829808
UT: Modify tests to use new pydantic configurations
...
TODO: Fix error handling and some assertions (tuple/list stuff)
2022-09-02 12:05:08 +05:30
Shreya Malviya
275237c3f7
Common: Inherit from MutableInfectionMonkeyBaseModel where missing in new pydantic configurations
2022-09-02 12:05:08 +05:30
Shreya Malviya
2f05d22780
Common: Create AgentConfiguration using pydantic
2022-09-02 12:05:08 +05:30
Shreya Malviya
b8914101a6
Common: Remove unused imports in agent_sub_configurations.py
2022-09-02 12:05:08 +05:30
Shreya Malviya
501f752248
Common: Create PropagationConfiguration using pydantic
2022-09-02 12:05:08 +05:30
Shreya Malviya
602604e408
Common: Create ExploitationConfiguration using pydantic
2022-09-02 12:05:08 +05:30
Shreya Malviya
b74f90fe9b
Common: Create ExploitationOptionsConfiguration using pydantic
2022-09-02 12:05:08 +05:30
Shreya Malviya
153c3e9b9f
Common: Create NetworkScanConfiguration using pydantic
2022-09-02 12:05:08 +05:30
Shreya Malviya
63a8e81c74
Common: Create TCPScanConfiguration using pydantic
2022-09-02 12:05:07 +05:30
Shreya Malviya
858b7650ac
Common: Create ICMPScanConfiguration using pydantic
2022-09-02 12:05:07 +05:30
Shreya Malviya
e7b0e6babf
Common: Create ScanTargetConfiguration using pydantic
2022-09-02 12:05:07 +05:30
Shreya Malviya
520183f42d
Common: Create PluginConfiguration using pydantic
2022-09-02 12:05:07 +05:30
Shreya Malviya
554a180fbd
Common: Create CustomPBAConfiguration using pydantic
2022-09-02 12:05:07 +05:30
Mike Salvatore
765ce858fb
Agent: Rename IAgentRepository -> IAgentBinaryRepository
...
PR #2239
2022-09-01 19:03:37 -04:00
Kekoa Kaaikala
62e4fb89bb
Agent: Inject dependencies into TCPRelay
2022-09-01 19:28:06 +00:00
Kekoa Kaaikala
46573c9f2d
UT: Add tests for RelayUserHandler
2022-09-01 19:24:13 +00:00
Kekoa Kaaikala
b1c1d2bd39
Agent: Allow callback registration on TCPConnectionHandler
2022-09-01 19:19:05 +00:00
Kekoa Kaaikala
ef39a8afd1
Agent: Add TCPPipeSpawner class
2022-09-01 19:15:23 +00:00
Mike Salvatore
ccffd1eaee
Project: Update vulture_allowlist.py for IAgentRepository changes
2022-09-01 12:43:45 -04:00
Mike Salvatore
3ab800f119
Island: Add docstrings to the Agent model
2022-09-01 12:25:29 -04:00
Mike Salvatore
693ce9e486
Island: Implement MongoAgentRepository.reset()
2022-09-01 12:25:29 -04:00
Mike Salvatore
d854eb7576
Island: Implement MongoAgentRepository.upsert_agent()
2022-09-01 12:13:01 -04:00
Kekoa Kaaikala
0e869462b5
Agent: Refactor TCPRelay
...
Integrate TCPConnectionHandler and RelayUserHandler into TCPRelay
Remove TCPProxy
2022-09-01 15:06:47 +00:00
Kekoa Kaaikala
d6931a6414
Agent: Clean up RelayUserHandler
...
Add get_potential_users and remove pipe handling
2022-09-01 15:03:16 +00:00
Mike Salvatore
1745b76122
Island: Implement MongoAgentRepository.get_running_agents()
2022-09-01 10:38:01 -04:00
Mike Salvatore
ba228e56b6
Island: Implement MongoAgentRepository.get_agent_by_id()
2022-09-01 10:21:40 -04:00
Mike Salvatore
6f285ba80c
Island: Rename `id` parameter to `agent_id` in IAgentRepository
2022-09-01 10:21:40 -04:00
Mike Salvatore
f00268c4a1
Island: Add IAgentRepository.reset()
2022-09-01 10:21:40 -04:00
Mike Salvatore
1eefbdb2b1
Island: Allow Agent.parent_id to be None
2022-09-01 10:21:40 -04:00
Mike Salvatore
22701fc0a3
Island: Redefine IAgentRepository
2022-09-01 10:21:40 -04:00
Mike Salvatore
f79d2fd8a6
Island: Add AgentID type alias
2022-09-01 10:21:40 -04:00
Ilija Lazoroski
15dee35aa4
Agent: Add RelayUserHandler
2022-09-01 16:02:27 +02:00
Kekoa Kaaikala
1f723b174e
Agent: Add TCPConnectionHandler
2022-09-01 13:54:17 +00:00
Kekoa Kaaikala
2e7be823a1
Agent: Revert old TcpProxy and create a new one
2022-09-01 13:14:07 +00:00
Ilija Lazoroski
c9b7f924a3
UT: Fix ExploitingInterceptingTelemetryMessenger tests
2022-09-01 13:58:14 +02:00
Ilija Lazoroski
eee06467f6
Agent: Add TODO to rethink on_user_disconnected
2022-09-01 13:44:39 +02:00
Ilija Lazoroski
508b811939
Agent: Rename on_user_connected to add_relay_user
2022-09-01 13:41:50 +02:00
Ilija Lazoroski
43a1ddb714
Agent: Rename on_potential_new_user to add_potential_user
2022-09-01 13:38:31 +02:00
Ilija Lazoroski
a754963222
Agent: Remove on_user_disconnected in TCPRelay
2022-09-01 13:32:07 +02:00
Ilija Lazoroski
6e0dc0ca13
Agent: Use super().__init__(...) in TCPRelay
2022-09-01 13:27:40 +02:00
Ilija Lazoroski
9fae6cca20
Agent: Use dictionary for relay and potential users in TCPRelay
2022-09-01 12:56:26 +02:00
Ilija Lazoroski
9a3afb051d
Agent: Use IPv4Address for RelayUser.address
2022-09-01 12:10:21 +02:00
Ilija Lazoroski
1d394bbd2e
Agent: Fix docstrings in TCPRelay
2022-09-01 11:39:25 +02:00
Ilija Lazoroski
d478e99227
Agent: Make TCPRelay non-optional in ExploitInterceptingTelemetryMessenger
2022-09-01 11:29:03 +02:00
Ilija Lazoroski
ecdf04a85e
Agent: Change relay control message
...
'-' to 'infection-monkey-relay-control-message: -'
2022-09-01 10:35:29 +02:00
Ilija Lazoroski
94fba0fdf0
Agent: Rename RelayUser.time to last_update_time
2022-09-01 10:17:13 +02:00
Ilija Lazoroski
302cdaac70
Agent: Use event.wait() when running TCPRelay
2022-09-01 09:57:46 +02:00
Mike Salvatore
453f45e403
Merge pull request #2232 from guardicore/2218-get-network-interfaces
...
2218 get network interfaces
2022-08-31 15:54:13 -04:00
Kekoa Kaaikala
a954df3ed8
Agent: Replace get_local_network_interfaces
...
Replaced get_local_network_interfaces() with get_network_interfaces()
2022-08-31 19:25:42 +00:00
Mike Salvatore
973a82e087
Merge branch 'machine-repository' into develop
...
PR #2228
2022-08-31 10:54:54 -04:00
Mike Salvatore
ba7dab26d7
Island: Refactor how Machine objects are managed by IMachineRepository
...
- Replace `create_machine()` with `get_new_id()`
- Replace `update_machine()` with `upsert_machine()`
Benefits:
The repository doesn't store Machine objects that only have the ID
populated (unless that is the caller's desire).
Upsert instead of update allows the interface to be more permissive.
2022-08-31 10:17:20 -04:00
Kekoa Kaaikala
31ff85ad3c
Agent: Add timeout to wait for pending clients
2022-08-31 13:51:54 +00:00
Kekoa Kaaikala
4b5d93beb0
Agent: Add disconnect protocol to TCPRelay
2022-08-31 12:06:13 +00:00
Kekoa Kaaikala
cd0b3077cf
Agent: Notify TCPRelay of exploit
2022-08-30 21:31:06 +00:00
Kekoa Kaaikala
9425a9463a
Agent: Track relay users in TCPRelay
2022-08-30 20:53:16 +00:00
Kekoa Kaaikala
79d5b8bed1
Agent: Add TCPRelay class
2022-08-30 20:08:54 +00:00
Kekoa Kaaikala
b10327af5c
Agent: Register agent interfaces
2022-08-30 15:36:30 +00:00
Mike Salvatore
4cbefedad2
Merge pull request #2222 from guardicore/2135-use-ipaddress
...
2135 use ipaddress
2022-08-30 10:04:21 -04:00
Kekoa Kaaikala
70a9251c5b
Agent: Fix type hints
2022-08-30 13:44:32 +00:00
Mike Salvatore
81128a4842
Island: Don't use Field() for simple defaults in Machine
2022-08-30 09:34:17 -04:00
Mike Salvatore
b538842e84
Island: Remove display_name from MongoMachineRepository._find_one()
2022-08-30 09:32:47 -04:00
Kekoa Kaaikala
fedfe4e45d
Agent: Use str(interface) instead of building string
2022-08-30 11:58:57 +00:00
Kekoa Kaaikala
e6663747eb
Agent: Use IPv4Interface's string
2022-08-30 11:36:51 +00:00
Kekoa Kaaikala
2b55c35a65
Agent: Use str() instead of .compressed
2022-08-30 11:36:51 +00:00
Kekoa Kaaikala
01c508e248
Agent: Replace NetworkInterface with IPv4Interface
2022-08-30 11:36:51 +00:00
Kekoa Kaaikala
f31ba824c6
UT: Fix tests
2022-08-30 11:36:51 +00:00
Kekoa Kaaikala
d8beba17fd
Agent: Update NetworkInterface to be IPv4Interface
2022-08-30 11:36:51 +00:00
Kekoa Kaaikala
75ba889f57
Agent: Fix typing issues
2022-08-30 11:36:51 +00:00
Kekoa Kaaikala
06ae6a8b90
Project: Add ipaddress types for mypy
2022-08-30 11:36:51 +00:00
Mike Salvatore
bf5e54ebc9
Island: Raise RemovalError from IMachineRepository.reset()
2022-08-30 07:34:20 -04:00
Mike Salvatore
383cfdfefe
Island: Rename `id_` parameter to `machine_id` in IMachineRepository
2022-08-30 07:30:41 -04:00
Mike Salvatore
0adf9d8467
Island: Add MongoMachineRepository
2022-08-30 05:03:47 -04:00
Mike Salvatore
1383332d33
Merge branch 'machine-model-defaults' into machine-repository
2022-08-29 20:31:44 -04:00
Mike Salvatore
5713d1c99b
UT: Add test_hardware_id_default()
2022-08-29 20:30:07 -04:00
Mike Salvatore
ac1cda40a8
Island: Add default value for Machine.hostname
2022-08-29 20:27:57 -04:00
Mike Salvatore
5d51b40475
Island: Add default value for Machine.operating_system_version
2022-08-29 20:26:11 -04:00
Mike Salvatore
3e2244cd62
UT: Add test_operating_system_default_value()
2022-08-29 20:26:11 -04:00
Mike Salvatore
40601b955c
Island: Add default value for Machine.network_interfaces
2022-08-29 20:26:05 -04:00
Mike Salvatore
da8ed9e6db
Island: Fix ICredentialsRepository import in MongoCredentialsRepository
2022-08-29 19:35:04 -04:00
Mike Salvatore
10d8d8e756
Island: Use MONGO_OBJECT_ID_KEY in MongoCredentialsRepository
2022-08-29 19:32:40 -04:00
Mike Salvatore
bf6125dd55
Island: Add MONGO_OBJECT_ID_KEY
2022-08-29 19:31:35 -04:00
Mike Salvatore
3eda8d640d
Island: Export IMachineRepository from repository package
2022-08-29 19:27:17 -04:00
Mike Salvatore
da752e041b
Project: Exclude vulture_allowlist.py from mypy checks
2022-08-29 19:27:17 -04:00
Mike Salvatore
eb3fe21b11
Island: Redefine IMachineRepository
2022-08-29 19:27:14 -04:00
Mike Salvatore
4c03c8aae9
Island: Import TypeAlias from typing_extensions
2022-08-29 19:13:23 -04:00
Mike Salvatore
c73a29c1b7
Common: Import TypeAlias from typing_extensions
2022-08-29 19:13:03 -04:00
Mike Salvatore
e98086e3d1
Project: Exclude vulture_allowlist.py from mypy checks
2022-08-29 15:46:29 -04:00
Mike Salvatore
6b083ca61b
Island: Remove superfluous "pass" from repository.errors
2022-08-29 15:15:49 -04:00
Mike Salvatore
1de552ea94
Island: Add UnknownRecordError to repository.errors
2022-08-29 15:14:42 -04:00
Mike Salvatore
694cdca883
Island: Make Machine.operating_system Optional
2022-08-29 15:00:45 -04:00
Mike Salvatore
ebcfe5a9fc
Island: Add docstrings to Machine
2022-08-29 14:35:45 -04:00
Mike Salvatore
43a53112fc
Island: Use monkey_island.cc.models.Machine in IMachineRepository
2022-08-29 14:35:10 -04:00
Mike Salvatore
cff363597a
Common: Annotate HardwareID as a TypeAlias
2022-08-29 14:34:28 -04:00
Mike Salvatore
b1f15b59f7
Common: Ignore arg-type error in DIContainer.register()
2022-08-29 14:28:48 -04:00
Mike Salvatore
599676c496
Project: Add mypy configuration to pyproject.toml
2022-08-29 14:16:43 -04:00
Mike Salvatore
4662dd8bed
Island: Annotate MachineID as a TypeAlias
...
See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
2022-08-29 13:50:12 -04:00
Ilija Lazoroski
1deb03b6d7
Island: Fix type annotation in AWSService
2022-08-29 12:46:34 -04:00
Ilija Lazoroski
6adacf702e
Island: Don't drop collections that starts with "config"
...
Fixes #2210
PR #2227
2022-08-29 12:46:20 -04:00
Mike Salvatore
4af38f6e8a
Project: Add .DS_Store to .gitignore
2022-08-29 12:32:15 -04:00
Mike Salvatore
797c2ea294
Merge branch 'v1.13.0-documentation-updates' into documentation-updates
2022-08-29 12:30:36 -04:00
Mike Salvatore
e9bfbbd08e
Merge pull request #2224 from ybasford/v1.13.0-documentation-updates
...
Changed punctuation
2022-08-29 12:24:03 -04:00
ybasford
7dd4fe820d
Docs: Fixed spelling
2022-08-29 12:16:10 -04:00
ybasford
4d723b07fa
Docs: Corrected the number of reports
2022-08-29 12:16:07 -04:00
ybasford
d9eb867a2d
Docs: Corrected grammatical error
2022-08-29 12:16:06 -04:00
ybasford
2783db69b9
Docs: No need for capitalization
2022-08-29 12:15:48 -04:00
ybasford
159eb2b45b
Docs: Capital letters and changed a word
2022-08-29 12:15:46 -04:00
ybasford
5bc2b1ba5a
Docs: Turned into singular because there is only one note
2022-08-29 12:15:30 -04:00
ybasford
99cd35aae5
Docs: Removed redundant word
2022-08-29 12:15:24 -04:00
ybasford
c98a55bcd4
Docs: Changed punctuation
...
Used a colon because it precedes a list
2022-08-29 12:15:20 -04:00
ybasford
aae513ce00
Docs: Added a word
2022-08-29 12:15:16 -04:00
ybasford
bc66b6defa
Docs: Changed punctuation
2022-08-29 12:15:11 -04:00
ybasford
43c8778c7c
Docs: Capitalized heading
2022-08-29 12:15:09 -04:00
ybasford
4e5e800222
Docs: Corrected typo
2022-08-29 12:15:06 -04:00
ybasford
6bcd5816ee
Docs: Corrected grammar
2022-08-29 12:13:44 -04:00
ybasford
8794d2a3c1
Docs: Update aws-run-on-ec2-machine.md
...
Changed wording
2022-08-29 12:12:36 -04:00
ybasford
4ca7fdeae9
Docs: Changed to US spelling
2022-08-29 12:12:32 -04:00
ybasford
9dbe0016e1
Docs: Deleted extra word
2022-08-29 12:12:18 -04:00
Kekoa Kaaikala
b622cb18bc
Project: Add ShellCheck to pre-commit hooks
...
PR #2219
2022-08-29 11:10:09 -04:00
Mike Salvatore
fd502a832a
Merge pull request #2220 from guardicore/add-mypy-precommit-hook
...
Project: Add mypy pre-commit check
2022-08-29 10:58:34 -04:00
Kekoa Kaaikala
cea2d0842b
Project: Include unit tests in mypy checks
2022-08-29 14:54:06 +00:00
Mike Salvatore
40d4f7f50c
Island: Remode disused deb-package/
2022-08-29 10:31:18 -04:00
Mike Salvatore
3000304d28
Island: Remove disused and empty `environment` subpackage
2022-08-29 10:30:01 -04:00
Mike Salvatore
9a95cfbc8b
Project: Add machine_hardware_id to vulture_allowlist.py
2022-08-25 11:51:17 -04:00
Mike Salvatore
def1dce86b
Common: Rename MutableBaseModel -> MutableInfectionMonkeyBaseModel
2022-08-25 11:50:12 -04:00
Kekoa Kaaikala
47bb7b207f
Project: Add mypy pre-commit check
2022-08-25 15:15:21 +00:00
Mike Salvatore
8e3abe7601
Merge branch 'prototype-register-agents' into develop
2022-08-25 10:21:54 -04:00
Mike Salvatore
478f3bea29
Merge pull request #2211 from guardicore/fix-batching-telemetry-thread-shutdown
...
Fix batching telemetry thread shutdown
2022-08-25 10:13:16 -04:00
Kekoa Kaaikala
2f50e30a92
Agent: Remove debug code
2022-08-24 20:10:35 +00:00
Kekoa Kaaikala
6bb710a495
Agent: Name the batching telemetry thread
2022-08-24 15:59:09 -04:00
Kekoa Kaaikala
bcc0c86526
Agent: Fix batching telemetry thread shutdown
2022-08-24 19:51:19 +00:00
Mike Salvatore
ab399e4f34
Island: Add debug logging to Agents resource
2022-08-24 08:54:41 -04:00
Mike Salvatore
9c32dee739
Agent: Register agent on startup
2022-08-24 08:54:41 -04:00
Mike Salvatore
80b4b05b65
Agent: Add pydantic as a dependency
2022-08-24 08:54:41 -04:00
Mike Salvatore
09739268fa
Agent: Add get_machine_id()
2022-08-24 08:54:41 -04:00
Mike Salvatore
160d2d11cf
Agent: Add get_agent_id()
2022-08-24 08:54:41 -04:00
Mike Salvatore
78f792aee9
Island: Add /api/agents endpoint
2022-08-24 08:54:41 -04:00
Mike Salvatore
00514a3c0d
Common: Add AgentRegistrationData
2022-08-24 08:54:41 -04:00
Mike Salvatore
0607f36404
Common: Move transforms from monkey_island to common
2022-08-24 08:54:41 -04:00
Mike Salvatore
fc14a1f573
Common: Make InfectionMonkeyModelConfig immutable
2022-08-24 08:54:41 -04:00
Mike Salvatore
3a94be8766
Common: Move base_models.py to common
2022-08-24 08:54:41 -04:00
Mike Salvatore
acc158db44
Island: Use HardwareId in Machine model
2022-08-24 08:54:41 -04:00
Mike Salvatore
f418571d93
Common: Add HardwareID type
2022-08-24 08:54:41 -04:00
Kekoa Kaaikala
15bd9a31c6
Agent: Pass ITelemetryMessenger to Ransomware
2022-08-23 20:05:52 -04:00
Mike Salvatore
a28cd97c0d
Common: Store strongrefs to subscribers
2022-08-23 19:59:57 -04:00
Mike Salvatore
9ab2c0bc6a
Agent: Add debug logging to add_creds_from_event_to_prop_creds_repo()
2022-08-23 19:59:57 -04:00
Mike Salvatore
0b8355c8a4
Common: Add debug logging to PyPubSubEventQueue
2022-08-23 10:00:34 -04:00
Mike Salvatore
0864593176
Agent: Add more debug logging to Agg'Prop'Cred'Repo'
2022-08-23 10:00:26 -04:00
Shreya Malviya
512403c1e0
UI: Fix spelling mistake on configuration page
2022-08-22 18:06:53 +05:30
Mike Salvatore
b7b3f28213
UT: Fix formatting in test_transforms.py
2022-08-22 08:02:25 -04:00
Ilija Lazoroski
789ca96bb0
BB: Set island mode to Custom
2022-08-19 12:13:59 -04:00
Mike Salvatore
0e78129515
Common: Rename OperatingSystems -> OperatingSystem
...
By convention, Enum names are singular.
2022-08-19 12:10:43 -04:00
Mike Salvatore
9fb0532646
IT: Speed up ransomware extension test by disabling readme feature
...
Reduces the runtime from 1.25s to under 0.005s
2022-08-19 11:53:36 -04:00
Mike Salvatore
19d6333f2c
Merge branch 'machine-agent-node-models' into develop
2022-08-19 11:41:30 -04:00
Mike Salvatore
4769b0edc8
Project: Add fields from some models to vulture_allowlist.py
2022-08-19 11:31:14 -04:00
Mike Salvatore
4a05c5a250
Island: Add agent model
2022-08-19 11:31:14 -04:00
Mike Salvatore
a625cc4583
Island: Rename Machine.node_id -> hardware_id
...
"hardware_id" more accurately explains the data we want to store. It
also avoids any confusion resulting from overloading the term "node".
2022-08-19 11:31:14 -04:00
Mike Salvatore
59fd83f0a0
Island: Add Node model
2022-08-19 11:31:14 -04:00
Mike Salvatore
5b4b7f0049
Island: Use make_immutable_sequence() when constructing Machine
2022-08-19 11:31:14 -04:00
Mike Salvatore
b3bfc598a3
Island: Add transform functions to make immutable copies of sequences
2022-08-19 11:31:14 -04:00
Mike Salvatore
3fd7051869
Island: Add MachineID type definition
2022-08-19 11:31:14 -04:00
Mike Salvatore
54db99350d
Island: Add CommunicationType Enum
2022-08-19 11:31:14 -04:00
Mike Salvatore
b6e04074a4
Island: Make Machine.network_interfaces immutable
2022-08-19 11:31:14 -04:00
Mike Salvatore
a4a4613a66
Island: Add a Machine model
2022-08-19 11:31:14 -04:00
Mike Salvatore
09474ac1fe
Island: Add base models for pydantic classes
2022-08-19 11:31:11 -04:00
Mike Salvatore
b5581d76b2
Island: Add pydantic to Python dependencies
2022-08-19 11:30:07 -04:00
Mike Salvatore
e0d3f5c666
Docs: Fix spelling error in ransomware simulation docs
2022-08-19 09:50:20 -04:00
Mike Salvatore
ce390e41b8
Merge pull request #2206 from guardicore/1242-allow-custom-ransomware-extension
...
1242 allow custom ransomware extension
2022-08-19 09:48:34 -04:00
Mike Salvatore
11b6797a0a
Changelog: Fix spelling error
2022-08-19 09:47:10 -04:00
Kekoa Kaaikala
9a449a6a99
Changelog: Add entry for custom file extension
2022-08-19 13:08:16 +00:00
Ilija Lazoroski
9b08b2942f
Agent: Initialize MimikatzCollector with a event_queue
2022-08-19 10:12:43 +02:00
Kekoa Kaaikala
59ad57ccbd
Agent: Discard the right file extension
2022-08-18 17:51:24 +00:00
Kekoa Kaaikala
b5c6240190
UT: Move a ransomware test to integration_tests
2022-08-18 17:46:55 +00:00
Kekoa Kaaikala
baa1687487
Docs: Add a section for custom file extension
2022-08-18 16:47:57 +00:00
Kekoa Kaaikala
9cbee5ba6d
UT: Test that ransomware applies the file extension
2022-08-18 15:30:28 +00:00
Kekoa Kaaikala
880c2fe707
Agent: Add file extension to ransomware
2022-08-18 15:30:28 +00:00
Kekoa Kaaikala
0797afb9a0
UI: Allow for empty file extension
2022-08-18 15:30:28 +00:00
Kekoa Kaaikala
194f08c294
Agent: Add file extension to default agent config
2022-08-18 15:30:21 +00:00
Kekoa Kaaikala
ae1fbb7cc5
Agent: Add file extension to RansomwareOptions
2022-08-18 15:30:14 +00:00
ilija-lazoroski
808bf5fee9
Merge pull request #2205 from guardicore/2179-create-ieventserializer
...
Event serializer
2022-08-18 16:06:14 +02:00
Ilija Lazoroski
ff0469690f
UT: Add type checking tests for EventSerializer Registry
2022-08-18 15:54:11 +02:00
Ilija Lazoroski
b541dc465d
Common: Type checking in EventSerializerRegistry
2022-08-18 15:54:04 +02:00
Shreya Malviya
4be262657e
Project: Remove Vulture entries no longer relevant
...
Issue #2176
2022-08-18 07:13:30 -04:00
Mike Salvatore
c55098e186
Merge pull request #2197 from guardicore/2176-remove-credentials-intercepting-telemetry-messenger
...
2176 remove credentials intercepting telemetry messenger
2022-08-18 06:39:42 -04:00
Mike Salvatore
bc0c46bfb9
Merge pull request #2201 from guardicore/2176-publish-credentials-stolen-in-mimikatz
...
CredentialsStolenEvent in MimikatzCredentialCollector
2022-08-18 06:37:40 -04:00
Ilija Lazoroski
4b1ad70f84
Common: Set event to registry only by class
2022-08-18 10:33:10 +02:00
Ilija Lazoroski
aeaabbccc4
UT: Test EventSerializerRegistry
2022-08-18 10:31:10 +02:00
Ilija Lazoroski
e83503e65a
Common: Export EventSerializerRegistry from __init__
2022-08-18 10:30:38 +02:00
Ilija Lazoroski
a32d9359b0
Common: Accept Union[str, Type[AbstractEvent]] in EventSerializerRegistry
2022-08-18 09:44:45 +02:00
Ilija Lazoroski
23604009a0
Common: Fix hint in IEventSerializer
2022-08-18 09:32:02 +02:00
Ilija Lazoroski
20f529d6a2
UT: Separate mimikatz credentials stolen event test
2022-08-18 09:22:59 +02:00
Kekoa Kaaikala
4f776f0102
UI: Add field for ransomed file extension
2022-08-17 20:10:23 +00:00
Shreya Malviya
132f3a3473
Project: Add event serializer entries to Vulture allowlist
2022-08-17 21:31:35 +05:30
Shreya Malviya
141c766b51
Common: Add EventSerializerRegistry
2022-08-17 21:29:06 +05:30
Shreya Malviya
0b9191ca43
Common: Add IEventSerializer to common/event_serializers/__init__.py
2022-08-17 21:28:33 +05:30
Kekoa Kaaikala
639fb26445
Agent: Improve the speed of bit flipping code
...
- Remove a function call
- Use a generator
- Use a more efficient flip calculation (subtraction instead of xor)
Issue #2123
2022-08-17 10:52:57 -04:00
Mike Salvatore
8b32e6d7a5
Merge pull request #2203 from guardicore/build-downgrade-pipenv
...
Build: Downgrade pipenv to use 2022.7.4
2022-08-17 09:01:07 -04:00
Ilija Lazoroski
8355d9e68a
Buid: Export CI to get rid of nasty characters
2022-08-17 09:00:44 -04:00
Ilija Lazoroski
a96efcdc7d
Build: Downgrade pipenv to use 2022.7.4
...
It seems that every time a new version of pipenv is released, it breaks
our build. See also 01e886f866
.
2022-08-17 08:59:51 -04:00
Shreya Malviya
6722057491
Agent: Use existing patch function in test_pypykatz_result_parsing_no_secrets
2022-08-17 18:03:07 +05:30
Shreya Malviya
c09adfb01b
Common: Add IEventSerializer
2022-08-17 17:57:28 +05:30
Mike Salvatore
85875e3323
Merge pull request #2198 from guardicore/2176-modify-zerologon-to-publish-events
...
2176 modify zerologon to publish events
2022-08-17 08:08:45 -04:00
Shreya Malviya
4334740002
UT: Simplify test_mimikatz_credentials_stolen_event_published
2022-08-17 17:31:06 +05:30
Shreya Malviya
2c3b29493f
Agent: Define SSH_COLLECTOR_EVENT_TAGS as a frozenset
2022-08-17 17:29:48 +05:30
Shreya Malviya
5747c2e8b4
UT: Update MimikatzCredentialCollector test now that MIMIKATZ_EVENT_TAGS is a frozenset
2022-08-17 17:28:44 +05:30
Shreya Malviya
3dca01d5d5
Agent: Define MIMIKATZ_EVENT_TAGS as a frozenset
2022-08-17 17:28:18 +05:30
Shreya Malviya
a3ddd6fb42
Common: Create directory and files for event serializer
2022-08-17 17:25:44 +05:30
Ilija Lazoroski
69e1f21312
Agent: Use frozenset for zerologon event tags
2022-08-17 13:45:13 +02:00
Ilija Lazoroski
74b9dd58fc
Agent: Add _ATTACK_TECHNIQUE to zerologon technique tags
2022-08-17 12:11:23 +02:00
Shreya Malviya
f9f3daffa7
UT: Add missing type hint to event_queue_subscriber fixture
2022-08-17 14:48:16 +05:30
Shreya Malviya
f510b89c08
UT: Move event_queue_subscriber fixture back to test_pypubsub_event_queue.py
2022-08-17 14:46:54 +05:30
Shreya Malviya
11901b1835
UT: Simplify variable logic in MimikatzCredentialCollector's event publishing test
2022-08-17 14:44:43 +05:30
Shreya Malviya
eb17b20625
UT: Simplify MimikatzCredentialCollector's event publishing test
2022-08-17 14:41:26 +05:30
Shreya Malviya
8f789b9d60
Agent: Remove unneeded argument passed to CredentialsStolenEvent in MimikatzCredentialCollector
2022-08-17 11:52:02 +05:30
Shreya Malviya
7faf6d3ecf
Agent: Modify Mimikatz credential collector's attack technique tags' strings
2022-08-17 11:50:38 +05:30
Shreya Malviya
457cc6be27
Agent: Modify Mimikatz credential collector tag string
2022-08-17 11:49:43 +05:30
Shreya Malviya
a0cf3d65f4
Agent: Rename variable in SSH handler
2022-08-17 11:48:35 +05:30
Shreya Malviya
140967b05f
UT: Use event_queue_subscriber fixture in MimikatzCredentialCollector tests
2022-08-17 11:47:52 +05:30
Shreya Malviya
b6c7001294
UT: Use event_queue_subscriber fixture in PyPubSubEventQueue tests
2022-08-17 11:47:52 +05:30
Shreya Malviya
2fbe9f3a4a
UT: Create event_queue_subscriber fixture
2022-08-17 11:47:52 +05:30
Shreya Malviya
b7ada959fa
UT: Simplify MimikatzCredentialCollector's event publishing test
2022-08-17 11:47:52 +05:30
Shreya Malviya
95a3be0273
UT: Add test to check CredentialStolenEvent is published in MimikatzCredentialCollector
2022-08-17 11:47:52 +05:30
Shreya Malviya
f453ff21fd
UT: Pass event queue to MimikatzCredentialCollector's constructor in tests
2022-08-17 11:47:52 +05:30
Shreya Malviya
c8a2c2156b
Agent: Fix variable name in MimikatzCredentialCollector
2022-08-17 11:47:51 +05:30
Shreya Malviya
56770d25c6
Agent: Publish credentials stolen event in MimikatzCredentialCollector
2022-08-17 11:47:51 +05:30
Shreya Malviya
e03f140749
Agent: Add function to publish credentials stolen event in Mimikatz credential collector
2022-08-17 11:47:51 +05:30
Shreya Malviya
b5058ce611
Agent: Add event tag constants for Mimikatz credential collector
2022-08-17 11:47:51 +05:30
Shreya Malviya
d745e10bf1
Agent: Accept event queue in Mimikatz collector's constructor
2022-08-17 11:47:51 +05:30
Ilija Lazoroski
3a9830415c
Agent: Use default target for ZerologonExploiter event
2022-08-17 00:58:45 +02:00
Ilija Lazoroski
f8b56dd171
Agent: Add T1098 (Account Manipulation) to ZerologonExploiter
2022-08-17 00:58:45 +02:00
Ilija Lazoroski
3c8091d242
Agent: Add T1003 tag to zerologon exploiter
2022-08-17 00:58:45 +02:00
Ilija Lazoroski
b0f76383c4
Agent: Change zerologon tag to `zerologon-exploiter
...
`
2022-08-17 00:58:45 +02:00
Ilija Lazoroski
550c7465fa
Agent: Add IEventQueue to ExploitWrapper
2022-08-17 00:58:45 +02:00
Ilija Lazoroski
d400fcb215
Agent: Extract zerologon tags into constant
2022-08-17 00:58:45 +02:00
Ilija Lazoroski
aaef2f1f81
UT: Fix Powershell tests to accept IEventQueue
2022-08-17 00:58:45 +02:00
Ilija Lazoroski
76bbe62c3b
Agent: Modify Zerologon to publish CredentialsStolenEvent
2022-08-17 00:55:09 +02:00
Ilija Lazoroski
f171e548f3
Agent: Modify exploiter wrapper to accept IEventQueue
2022-08-17 00:55:09 +02:00
Ilija Lazoroski
c6cb477474
Agent: Add event_queue to the exploit_host in HostExploiter
2022-08-17 00:55:09 +02:00
Ilija Lazoroski
fb0f7c86af
Agent: Remove usage of CredentialsInterceptingTelemetryMessenger
2022-08-17 00:24:59 +02:00
Ilija Lazoroski
8dd6c5b7c2
Agent: Remove CredentialsInterceptingTelemetryMessenger
2022-08-17 00:21:05 +02:00
Mike Salvatore
2edaf52140
Merge pull request #2196 from guardicore/2176-modify-ssh-collector-for-events
...
2176 modify ssh collector for events
2022-08-16 12:41:14 -04:00
Ilija Lazoroski
eec48e9cd8
Agent: Remove target from SSHCredentialCollector event construction
2022-08-16 17:31:02 +02:00
Ilija Lazoroski
205ff84b31
Common: Add defaults for each argument in AbstractEvent
2022-08-16 17:30:30 +02:00
Ilija Lazoroski
b3d37d9223
Agent: Change SSHCredentialCollector tag to lowercase
2022-08-16 17:27:43 +02:00
Ilija Lazoroski
5466bd5dba
UT: Remove unneeded fixture in SSHCredentialCollector tests
2022-08-16 17:26:25 +02:00
Ilija Lazoroski
142136dd41
Agent: Remove duplication in SSHCredentialCollector
2022-08-16 17:14:37 +02:00
Ilija Lazoroski
d38a386f67
Agent: Add prefix `attack-` to attack tecniques tags
2022-08-16 14:25:28 +02:00
Ilija Lazoroski
c18ceff85d
Agent: Remove unneeded variable in SSHCredentialCollector
2022-08-16 14:24:26 +02:00
Ilija Lazoroski
ea9082d412
Agent: Remove hack_event from CredentialsStolenEvent
2022-08-16 14:23:25 +02:00
Mike Salvatore
1d79d98689
Agent: Rename credentials_store -> propagation_credentials_repository
2022-08-16 08:17:04 -04:00
Ilija Lazoroski
c3557caf1c
Agent: Add _ATTACK_TECHNIQUE_ to attack_technique tags
2022-08-16 14:11:16 +02:00
Ilija Lazoroski
fdd0368837
Agent: Extract SSH collector tags into constants
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
706a626d24
Agent: Move subscribtion to a separate method for readability
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
2a94a67767
Agent: Rename usr_info to user_info in ssh_handler
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
88bb856859
Common: Reorder params in docstring AbstractEvent
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
8f5681b1df
Agent: Init a callable class and subscribe to it
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
d672fcfffe
Agent: Fix a typo in ssh_handler
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
03d569cc00
Agent: Init SSHCredentialCollector with an IEventQueue
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
4aa71cba7e
Agent: Remove default values from CredentialsStolenEvent creation
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
486a7a9225
Common: Use a temporary hack to define non-defaults from a inherited class event
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
5f631a78f7
Agent: Remove IGUID from config
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
39f07603a7
Agent: Define integer GUID and use it in ssh_handler
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
b22ccdb942
Agent: Publish CredentialsStolenEvent each time we find a SSHKeypair
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
e439a53bde
UT: Fix SSHCredentialCollector test to accept IEventQueue
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
2610666f93
Agent: Publish an CredentialsStolenEvent from SSHCredentialCollector
2022-08-16 11:58:53 +02:00
Ilija Lazoroski
4952a544c0
Agent: Accept IEventQueue in SSHCollector constructor
2022-08-16 11:58:53 +02:00
Mike Salvatore
d09c1a689e
Merge pull request #2200 from guardicore/2191-fix-credentials-repository-get
...
2191 fix credentials repository get
2022-08-15 15:45:03 -04:00
Kekoa Kaaikala
e4f7707b66
Agent: Return credentials when credentials propagation fails
2022-08-15 19:25:54 +00:00
Kekoa Kaaikala
9e6a569393
Agent: Update credentials repository to cache per-instance
2022-08-15 19:25:54 +00:00
Mike Salvatore
500eeeb582
Merge pull request #2194 from guardicore/2191-trailing-url-slashes
...
Island: Remove trailing slashes before registering a URL
2022-08-15 14:25:28 -04:00
Kekoa Kaaikala
a67a4418c9
Island: Remove PropagationCredentials URL trailing slash
2022-08-15 18:04:56 +00:00
Mike Salvatore
96f794e192
UT: Mark TestEvent* classes with `__test__ = False`
2022-08-15 14:04:09 -04:00
Kekoa Kaaikala
19df4d9755
Island: Enforce "no trailing slash" rule for URLs
2022-08-15 18:01:32 +00:00
Mike Salvatore
4e9aa62c61
Merge pull request #2195 from guardicore/refactor-island-boot
...
Refactor island boot
2022-08-15 08:35:00 -04:00
Mike Salvatore
01e886f866
Project: Remove step in travis build to upgrade pipenv
...
It seems that every time a new version of pipenv is released it breaks
travis. For the moment, it seems that the magic combination is to
upgrade pip but not upgrade pipenv.
I've been unable to reproduce the issue outside of any environment other
than Travis CI.
Once we split our project up into multiple repos, we should strongly
consider switching to poetry.
2022-08-15 08:23:17 -04:00
Mike Salvatore
879f809aa4
Project: Use the latest pip in travis build
2022-08-15 07:37:36 -04:00
Mike Salvatore
fae4247505
Project: Add special `fix-travis` branch to travis build list
...
When attempting to fix an issue with travis, it's important to actually
run travis. In order to do this without a pull request, I've added a
special `fix-travis` branch to the list of branches travis is allowed to
build.
2022-08-15 07:34:39 -04:00
Mike Salvatore
9f89d3f508
Merge pull request #2193 from guardicore/2176-stolen-credentials-subscriber
...
2176 stolen credentials subscriber
2022-08-15 07:26:18 -04:00
Ilija Lazoroski
f6712c5f84
Agent: Subscribe CredentialsStolenEvent to the EventQueue
2022-08-15 10:02:00 +02:00
Ilija Lazoroski
b3ac7a6538
UT: Add tests for adding credentials from event to repository
2022-08-15 09:30:04 +02:00
Ilija Lazoroski
db8e1e50da
Agent: Add add_credentials_from_event_to_propagation_credentials_repository
...
Callable class that adds credentials to the propagation credentials
repository
2022-08-15 09:30:04 +02:00
Mike Salvatore
d6e0b03a64
Island: Move island log file registration to setup_server.py
2022-08-12 12:02:23 -04:00
Mike Salvatore
fdc041ead6
Island: Only call get_ip_addresses() once in server_setup.py
2022-08-12 11:57:31 -04:00
Mike Salvatore
315c17eb48
Island: Remove unneeded ANALYTICS_URL constant
2022-08-12 11:53:33 -04:00
Mike Salvatore
6da38e341f
Island: Run analytics request asynchronously
2022-08-12 11:49:16 -04:00
Mike Salvatore
0c39268668
Island: Reorder function calls in run_monkey_island()
...
Configuration options should be validated before they are used.
2022-08-12 11:46:16 -04:00
Mike Salvatore
09f6cce6de
Island: Collect system info in server_setup.py
...
Information about the system (host machine, island, etc.) should be
collected early on and passed to the components that require it.
2022-08-12 11:45:52 -04:00
Mike Salvatore
1873ce3bfe
Island: Rename ex -> err in server_setup.py
2022-08-12 10:55:25 -04:00
vakaris_zilius
5d36b7a981
Island: Remove trailing slashes before registering a URL
...
Strict slashes seems to not handle a case when URL is defined with a trailing slash, but request is sent without one. Removing trailing slashes before registering a URL will solve the burden of remembering to register URLS without slashes
2022-08-12 14:54:28 +00:00
Mike Salvatore
dd30b61658
Island: Add missing type hint to _configure_gevent_exception_handling()
2022-08-12 10:50:23 -04:00
Mike Salvatore
2379271c13
Island: Call _configure_gevent_ex_handling from _start_island_server
2022-08-12 10:49:45 -04:00
Mike Salvatore
61cb14d628
Island: Wrap mongo start in _initialize_mongodb_connection()
2022-08-12 10:47:23 -04:00
Mike Salvatore
82c7782ff0
Merge pull request #2188 from guardicore/2165-labda-decoupling
...
2165 lambda decoupling
2022-08-12 10:33:51 -04:00
Mike Salvatore
af7eb23bef
Island: Reword warning in Version
2022-08-12 10:31:30 -04:00
Mike Salvatore
8788b258dd
Docs: Change "launch" to "starts"
2022-08-12 10:29:42 -04:00
Mike Salvatore
658607de25
UT: Remove unnecessary wait() from test_version
...
Unit tests should not be exposed to the internals of what they are
testing. Furthermore, the `latest_version` and `download` properties
wait for the event to be set, making the extra `wait()` redundant.
2022-08-12 10:27:53 -04:00
Mike Salvatore
94a25b07b2
Island: Simplify error messages in Version
2022-08-12 10:24:29 -04:00
Mike Salvatore
df1b9f0f9c
Island: Fix return type hint for Version._get_version_info()
2022-08-12 10:22:22 -04:00
Mike Salvatore
617d101af2
Island: Fix string formatting in _send_analytics()
2022-08-12 10:20:30 -04:00
Mike Salvatore
6dc29e36e2
UT: Fix test_version__request_failed()
2022-08-12 10:16:46 -04:00
Mike Salvatore
2e70b87ee9
Revert "Island, UI: Handle the case when version couldn't be fetched"
...
This reverts commit 737070f956
.
2022-08-12 10:15:44 -04:00
Mike Salvatore
dc0f865f9b
Merge pull request #2192 from guardicore/2176-initialize-event-queue
...
Initialize IEventQueue
2022-08-12 10:14:20 -04:00
Mike Salvatore
23b96c2a36
Agent: Convert _event_queue from member to local variable
2022-08-12 10:13:36 -04:00
Ilija Lazoroski
21c9ea9d44
Agent: Initialize IEventQueue
2022-08-12 15:31:55 +02:00
Mike Salvatore
74ca26657e
Merge pull request #2189 from guardicore/2176-define-stolen-credentials-event
...
2176 define stolen credentials event
2022-08-12 06:48:16 -04:00
Mike Salvatore
b0b0874be9
Common: Modify stolen_credentials description in docstring
2022-08-12 06:47:08 -04:00
Ilija Lazoroski
743d40abab
Common: Rename StolenCredentialsEvent to CredentialsStolenEvent
2022-08-12 09:39:04 +02:00
vakarisz
737070f956
Island, UI: Handle the case when version couldn't be fetched
2022-08-12 09:50:28 +03:00
vakarisz
c61737abc0
Island: Send analytics on island startup instead of object creation
...
This change makes the logic more evident, because sending the analytics is not done during the initialization of an object
2022-08-12 09:32:50 +03:00
Ilija Lazoroski
f06d53368a
Common: Export StolenCredentialsEvent from __init__
2022-08-11 19:36:58 +02:00
Ilija Lazoroski
889863bb93
Common: Define StolenCredentialsEvent
2022-08-11 19:36:52 +02:00
vakarisz
bec7bef1b3
Island: Return current version number instead of None
2022-08-11 17:57:07 +03:00
vakarisz
5ffec0eb4f
Changelog: Add entry about separating version and analytics requests
2022-08-11 17:45:09 +03:00
vakarisz
248cef589a
Docs: Change performed queried documentation in the FAQ
...
Island now performs 2 queries instead of 1(1 for analytics and 1 for update information)
2022-08-11 17:45:08 +03:00
ilija-lazoroski
956621dcf3
Island: Add events endpoint
...
PR #2187
Issue #2155
2022-08-11 10:23:54 -04:00
vakarisz
32460bbb3e
Island: Send analytics upon island startup
2022-08-11 17:20:56 +03:00
vakarisz
02e719f7b2
Island: Fetch version and download url from new lambda API
2022-08-11 15:14:54 +03:00
Mike Salvatore
be2a683732
Merge branch 'release/1.13.0'
2022-01-25 09:58:01 -05:00
Mike Salvatore
67c87e044b
Merge branch 'release/1.12.0'
2021-10-29 09:01:22 -04:00
Mike Salvatore
07730160d7
Release Infection Monkey v1.11.0
2021-08-16 14:41:13 -04:00
Mike Salvatore
cbd803acae
Update release 1.11.0 date in changelog
2021-08-13 08:38:05 -04:00
Mike Salvatore
2d7919c60c
Merge pull request #1074 from guardicore/release/1.10.0
...
Release Infection Monkey v1.10.0
2021-04-06 07:00:02 -04:00
VakarisZ
ab01917812
Merge pull request #769 from guardicore/release/1.9.0
...
Release/1.9.0
2020-08-05 21:58:57 +03:00