Added new icons for timeline events types (and deleted the Island event type)

This commit is contained in:
Shay Nehmad 2019-09-02 16:00:04 +03:00
parent d7543e1117
commit 68d185f5fd
8 changed files with 19 additions and 18 deletions

View File

@ -129,10 +129,9 @@ TESTS_MAP = {
},
}
EVENT_TYPE_ISLAND = "island"
EVENT_TYPE_MONKEY_NETWORK = "monkey_network"
EVENT_TYPE_MONKEY_LOCAL = "monkey_local"
EVENT_TYPES = (EVENT_TYPE_MONKEY_LOCAL, EVENT_TYPE_MONKEY_NETWORK, EVENT_TYPE_ISLAND)
EVENT_TYPES = (EVENT_TYPE_MONKEY_LOCAL, EVENT_TYPE_MONKEY_NETWORK)
PILLARS_TO_TESTS = {
DATA: [],

View File

@ -1,6 +1,6 @@
from mongoengine import ValidationError
from common.data.zero_trust_consts import EVENT_TYPE_ISLAND
from common.data.zero_trust_consts import EVENT_TYPE_MONKEY_NETWORK
from monkey_island.cc.models.zero_trust.event import Event
from monkey_island.cc.testing.IslandTestCase import IslandTestCase
@ -14,7 +14,7 @@ class TestEvent(IslandTestCase):
_ = Event.create_event(
title=None, # title required
message="bla bla",
event_type=EVENT_TYPE_ISLAND
event_type=EVENT_TYPE_MONKEY_NETWORK
)
with self.assertRaises(ValidationError):
@ -28,5 +28,5 @@ class TestEvent(IslandTestCase):
_ = Event.create_event(
title="skjs",
message="bla bla",
event_type=EVENT_TYPE_ISLAND
event_type=EVENT_TYPE_MONKEY_NETWORK
)

View File

@ -1,6 +1,6 @@
import json
from common.data.zero_trust_consts import EVENT_TYPE_MONKEY_LOCAL, EVENT_TYPE_ISLAND, \
from common.data.zero_trust_consts import EVENT_TYPE_MONKEY_LOCAL, \
STATUS_PASSED, STATUS_FAILED, TEST_ENDPOINT_SECURITY_EXISTS
from monkey_island.cc.models import Monkey
from monkey_island.cc.models.zero_trust.event import Event
@ -24,7 +24,7 @@ def test_antivirus_existence(telemetry_json):
title="Found AV process",
message="The process '{}' was recognized as an Anti Virus process. Process "
"details: {}".format(process[1]['name'], json.dumps(process[1])),
event_type=EVENT_TYPE_ISLAND
event_type=EVENT_TYPE_MONKEY_LOCAL
))
if len(av_processes) > 0:

View File

@ -30,7 +30,7 @@ def test_open_data_endpoints(telemetry_json):
events.append(Event.create_event(
title="Scan telemetry analysis",
message="Scanned service: {}.".format(service_name),
event_type=EVENT_TYPE_ISLAND
event_type=EVENT_TYPE_MONKEY_NETWORK
))
if service_name in HTTP_SERVERS_SERVICES_NAMES:
found_http_server_status = STATUS_FAILED
@ -41,7 +41,7 @@ def test_open_data_endpoints(telemetry_json):
telemetry_json["data"]["machine"]["ip_addr"],
json.dumps(service_data)
),
event_type=EVENT_TYPE_ISLAND
event_type=EVENT_TYPE_MONKEY_NETWORK
))
if service_name == ES_SERVICE:
found_elastic_search_server = STATUS_FAILED
@ -52,7 +52,7 @@ def test_open_data_endpoints(telemetry_json):
telemetry_json["data"]["machine"]["ip_addr"],
json.dumps(service_data)
),
event_type=EVENT_TYPE_ISLAND
event_type=EVENT_TYPE_MONKEY_NETWORK
))
Finding.save_finding(

View File

@ -1,8 +1,7 @@
import itertools
from six import text_type
from common.data.zero_trust_consts import STATUS_FAILED, EVENT_TYPE_MONKEY_NETWORK, STATUS_PASSED, \
EVENT_TYPE_ISLAND
from common.data.zero_trust_consts import STATUS_FAILED, EVENT_TYPE_MONKEY_NETWORK, STATUS_PASSED
from common.network.network_range import NetworkRange
from common.network.segmentation_utils import get_ip_in_src_and_not_in_dst, get_ip_if_in_subnet
from monkey_island.cc.models import Monkey
@ -107,5 +106,5 @@ def get_segmentation_done_event(current_monkey, subnet_pair):
hostname=current_monkey.hostname,
src_seg=subnet_pair[0],
dst_seg=subnet_pair[1]),
event_type=EVENT_TYPE_ISLAND
event_type=EVENT_TYPE_MONKEY_NETWORK
)

View File

@ -2,11 +2,12 @@ import React, {Component} from "react";
import {Timeline, TimelineEvent} from "react-event-timeline";
import * as PropTypes from "prop-types";
let monkeyLocalIcon = require('../../../images/zerotrust/im-alert-machine-icon.svg');
let monkeyNetworkIcon = require('../../../images/zerotrust/im-alert-network-icon.svg');
const eventTypeToIcon = {
"monkey_local": "fa fa-exclamation-circle fa-2x icon-warning",
"monkey_network": "fa fa-exclamation-circle fa-2x icon-warning",
"island": "fa fa-server fa-2x icon-info",
null: "fa fa-question-circle fa-2x icon-info",
"monkey_local": monkeyLocalIcon,
"monkey_network": monkeyNetworkIcon,
};
export default class EventsTimeline extends Component {
@ -21,7 +22,7 @@ export default class EventsTimeline extends Component {
key={index}
createdAt={event_time}
title={event.title}
icon={<i className={eventTypeToIcon[event.event_type]} />}>
icon={<img src={eventTypeToIcon[event.event_type]} alt="icon" style={{width: '24px'}} />}>
{event.message}
</TimelineEvent>)
})

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><title>im-alert-machine-icon</title><g id="Layer_2" data-name="Layer 2"><g id="originals"><circle cx="24" cy="24" r="23" style="fill:#fc2"/><path d="M24,2A22,22,0,1,1,2,24,22,22,0,0,1,24,2m0-2A24,24,0,1,0,48,24,24.02719,24.02719,0,0,0,24,0Z" style="fill:#333"/><rect x="12" y="16" width="24" height="16.20144" style="fill:none;stroke:#333;stroke-miterlimit:10;stroke-width:1.9409949287049788px"/><rect x="23" y="19" width="2" height="6" style="fill:#333"/><rect x="23" y="27" width="2" height="2" style="fill:#333"/><rect x="20" y="33" width="8" height="3" style="fill:#333"/></g></g></svg>

After

Width:  |  Height:  |  Size: 650 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><title>im-alert-network-icon</title><g id="Layer_2" data-name="Layer 2"><g id="originals"><circle cx="24" cy="24" r="23" style="fill:#fc2"/><path d="M24,2A22,22,0,1,1,2,24,22,22,0,0,1,24,2m0-2A24,24,0,1,0,48,24,24.02719,24.02719,0,0,0,24,0Z" style="fill:#333"/><circle cx="18.5" cy="9.5" r="2.5" style="fill:#333"/><circle cx="8.5" cy="25.5" r="2.5" style="fill:#333"/><circle cx="13" cy="34" r="2" style="fill:#333"/><circle cx="23.5" cy="39.5" r="2.49988" style="fill:#333"/><circle cx="37" cy="32" r="2" style="fill:#333"/><circle cx="35" cy="14" r="2" style="fill:#333"/><line x1="37" y1="32" x2="24" y2="24" style="fill:none;stroke:#333;stroke-miterlimit:10"/><line x1="23.5" y1="40" x2="23.5" y2="24.5" style="fill:none;stroke:#333;stroke-miterlimit:10"/><line x1="13.5" y1="33.5" x2="23.5" y2="24.5" style="fill:none;stroke:#333;stroke-miterlimit:10"/><line x1="23.5" y1="24.5" x2="8.5" y2="25.5" style="fill:none;stroke:#333;stroke-miterlimit:10"/><line x1="18.5" y1="9.5" x2="24.5" y2="25.5" style="fill:none;stroke:#333;stroke-miterlimit:10"/><line x1="35.5" y1="13.5" x2="23.5" y2="24.5" style="fill:none;stroke:#333;stroke-miterlimit:10"/><circle cx="24" cy="24" r="9" style="fill:#fc2;stroke:#333;stroke-miterlimit:10;stroke-width:2px"/><rect x="23" y="19" width="2" height="6" style="fill:#333"/><rect x="23" y="27" width="2" height="2" style="fill:#333"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB