Added state function, WIP

This commit is contained in:
Shay Nehmad 2019-08-25 18:14:15 +03:00
parent 05eab34d45
commit 223adb0f33
2 changed files with 9 additions and 0 deletions

View File

@ -1,4 +1,6 @@
from monkey_island.cc.services.node import NodeService from monkey_island.cc.services.node import NodeService
from monkey_island.cc.services.telemetry.zero_trust_tests.segmentation import \
test_positive_findings_for_unreached_segments
def process_state_telemetry(telemetry_json): def process_state_telemetry(telemetry_json):
@ -8,3 +10,6 @@ def process_state_telemetry(telemetry_json):
NodeService.set_monkey_dead(monkey, True) NodeService.set_monkey_dead(monkey, True)
else: else:
NodeService.set_monkey_dead(monkey, False) NodeService.set_monkey_dead(monkey, False)
if telemetry_json['data']['done']:
test_positive_findings_for_unreached_segments(telemetry_json)

View File

@ -66,3 +66,7 @@ def get_segmentation_violation_event(current_monkey, source_subnet, target_ip, t
event_type=EVENT_TYPE_MONKEY_NETWORK event_type=EVENT_TYPE_MONKEY_NETWORK
) )
def test_positive_findings_for_unreached_segments(telemetry_json):
current_monkey = Monkey.get_single_monkey_by_guid(telemetry_json['monkey_guid'])
subnet_groups = get_config_network_segments_as_subnet_groups()