Extracted ES_SERVICE to const

CR
This commit is contained in:
Shay Nehmad 2019-09-02 11:00:10 +03:00
parent faf6da15bb
commit 9fc2bf886d
4 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,2 @@
ES_SERVICE = 'elastic-search-9200'

View File

@ -10,7 +10,8 @@ import requests
from infection_monkey.exploit.web_rce import WebRCE from infection_monkey.exploit.web_rce import WebRCE
from infection_monkey.model import WGET_HTTP_UPLOAD, RDP_CMDLINE_HTTP, CHECK_COMMAND, ID_STRING, CMD_PREFIX,\ from infection_monkey.model import WGET_HTTP_UPLOAD, RDP_CMDLINE_HTTP, CHECK_COMMAND, ID_STRING, CMD_PREFIX,\
DOWNLOAD_TIMEOUT DOWNLOAD_TIMEOUT
from infection_monkey.network.elasticfinger import ES_PORT, ES_SERVICE from infection_monkey.network.elasticfinger import ES_PORT
from common.data.network_consts import ES_SERVICE
from infection_monkey.telemetry.attack.t1197_telem import T1197Telem from infection_monkey.telemetry.attack.t1197_telem import T1197Telem
from common.utils.attack_utils import ScanStatus, BITS_UPLOAD_STRING from common.utils.attack_utils import ScanStatus, BITS_UPLOAD_STRING

View File

@ -6,11 +6,11 @@ import requests
from requests.exceptions import Timeout, ConnectionError from requests.exceptions import Timeout, ConnectionError
import infection_monkey.config import infection_monkey.config
from common.data.network_consts import ES_SERVICE
from infection_monkey.model.host import VictimHost from infection_monkey.model.host import VictimHost
from infection_monkey.network import HostFinger from infection_monkey.network import HostFinger
ES_PORT = 9200 ES_PORT = 9200
ES_SERVICE = 'elastic-search-9200'
ES_HTTP_TIMEOUT = 5 ES_HTTP_TIMEOUT = 5
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
__author__ = 'danielg' __author__ = 'danielg'

View File

@ -1,5 +1,6 @@
import json import json
from common.data.network_consts import ES_SERVICE
from common.data.zero_trust_consts import * from common.data.zero_trust_consts import *
from monkey_island.cc.models import Monkey from monkey_island.cc.models import Monkey
from monkey_island.cc.models.zero_trust.event import Event from monkey_island.cc.models.zero_trust.event import Event
@ -42,7 +43,7 @@ def test_open_data_endpoints(telemetry_json):
), ),
event_type=EVENT_TYPE_ISLAND event_type=EVENT_TYPE_ISLAND
)) ))
if service_name in 'elastic-search-9200': if service_name == ES_SERVICE:
found_elastic_search_server = STATUS_FAILED found_elastic_search_server = STATUS_FAILED
events.append(Event.create_event( events.append(Event.create_event(
title="Scan telemetry analysis", title="Scan telemetry analysis",