diff --git a/envs/monkey_zoo/blackbox/tests/performance/telemetry_performance_test_workflow.py b/envs/monkey_zoo/blackbox/tests/performance/telemetry_performance_test_workflow.py index 320973d97..b5acf4a9e 100644 --- a/envs/monkey_zoo/blackbox/tests/performance/telemetry_performance_test_workflow.py +++ b/envs/monkey_zoo/blackbox/tests/performance/telemetry_performance_test_workflow.py @@ -13,9 +13,8 @@ class TelemetryPerformanceTestWorkflow(BasicTest): def run(self): try: - # TelemetryPerformanceTest(island_client=self.island_client).test_telemetry_performance() + TelemetryPerformanceTest(island_client=self.island_client).test_telemetry_performance() performance_test = EndpointPerformanceTest(self.name, self.performance_config, self.island_client) assert performance_test.run() finally: - pass - # self.island_client.reset_env() + self.island_client.reset_env() diff --git a/monkey/monkey_island/cc/resources/reporting/report.py b/monkey/monkey_island/cc/resources/reporting/report.py index 6770512e6..961e745a8 100644 --- a/monkey/monkey_island/cc/resources/reporting/report.py +++ b/monkey/monkey_island/cc/resources/reporting/report.py @@ -6,7 +6,6 @@ from flask import jsonify from monkey_island.cc.auth import jwt_required from monkey_island.cc.services.reporting.report import ReportService from monkey_island.cc.services.reporting.zero_trust_service import ZeroTrustService -from monkey_island.cc.testing.profiler_decorator import profile ZERO_TRUST_REPORT_TYPE = "zero_trust" SECURITY_REPORT_TYPE = "security" @@ -22,7 +21,6 @@ __author__ = ["itay.mizeretz", "shay.nehmad"] class Report(flask_restful.Resource): @jwt_required() - @profile() def get(self, report_type=SECURITY_REPORT_TYPE, report_data=None): if report_type == SECURITY_REPORT_TYPE: return ReportService.get_report() diff --git a/monkey/monkey_island/cc/resources/zero_trust/finding_event.py b/monkey/monkey_island/cc/resources/zero_trust/finding_event.py index 73cfa7f4c..16c545241 100644 --- a/monkey/monkey_island/cc/resources/zero_trust/finding_event.py +++ b/monkey/monkey_island/cc/resources/zero_trust/finding_event.py @@ -3,12 +3,10 @@ import json from monkey_island.cc.auth import jwt_required from monkey_island.cc.services.reporting.zero_trust_service import ZeroTrustService -from monkey_island.cc.testing.profiler_decorator import profile class ZeroTrustFindingEvent(flask_restful.Resource): @jwt_required() - @profile() def get(self, finding_id: str): return {'events_json': json.dumps(ZeroTrustService.get_events_by_finding(finding_id), default=str)} diff --git a/monkey/monkey_island/cc/services/reporting/zero_trust_service.py b/monkey/monkey_island/cc/services/reporting/zero_trust_service.py index 7ecac4e7f..821d2104a 100644 --- a/monkey/monkey_island/cc/services/reporting/zero_trust_service.py +++ b/monkey/monkey_island/cc/services/reporting/zero_trust_service.py @@ -109,8 +109,7 @@ class ZeroTrustService(object): @staticmethod def get_all_findings(): - pipeline = [{'$match': {}}, - {'$addFields': {'oldest_events': {'$slice': ['$events', EVENT_FETCH_CNT]}, + pipeline = [{'$addFields': {'oldest_events': {'$slice': ['$events', EVENT_FETCH_CNT]}, 'latest_events': {'$slice': ['$events', -1*EVENT_FETCH_CNT]}, 'event_count': {'$size': '$events'}}}, {'$unset': ['events']}] @@ -130,7 +129,7 @@ class ZeroTrustService(object): elif overlap_count <= 0: return [] else: - return events[ -overlap_count :] + return events[-1 * overlap_count:] @staticmethod def __get_enriched_finding(finding): diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/EventsModal.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/EventsModal.js index 4d31816b0..4ddfdf93c 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/EventsModal.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/EventsModal.js @@ -1,4 +1,4 @@ -import React, {Component} from 'react'; +import React from 'react'; import {Modal} from 'react-bootstrap'; import EventsTimeline from './EventsTimeline'; import * as PropTypes from 'prop-types'; @@ -6,7 +6,7 @@ import saveJsonToFile from '../../utils/SaveJsonToFile'; import EventsModalButtons from './EventsModalButtons'; import AuthComponent from '../../AuthComponent'; import Pluralize from 'pluralize'; -import SkippedEventsTimeline from "./SkippedEventsTimeline"; +import SkippedEventsTimeline from './SkippedEventsTimeline'; const FINDING_EVENTS_URL = '/api/zero-trust/finding-event/';