Loading manifests/monitoringservice.yaml +76 −76 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ spec: protocol: TCP env: - name: LOG_LEVEL value: "INFO" value: "DEBUG" - name: METRICSDB_HOSTNAME value: "monitoringservice" - name: METRICSDB_ILP_PORT Loading src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py +11 −3 Original line number Diff line number Diff line Loading @@ -123,10 +123,14 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto -output: KPI identifier representing the KPI """ def create_kpi(self, client: MonitoringClient, service_id, kpi_name, kpi_description, kpi_sample_type): def create_kpi( self, client: MonitoringClient, service_id, device_id, endpoint_id, kpi_name, kpi_description, kpi_sample_type ): kpidescriptor = KpiDescriptor() kpidescriptor.kpi_description = kpi_description kpidescriptor.service_id.service_uuid.uuid = service_id.service_uuid.uuid kpidescriptor.device_id.device_uuid.uuid = device_id.device_uuid.uuid kpidescriptor.endpoint_id.endpoint_uuid.uuid = endpoint_id.endpoint_uuid.uuid kpidescriptor.kpi_sample_type = kpi_sample_type new_kpi = client.SetKpi(kpidescriptor) Loading @@ -141,12 +145,14 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto -output: None """ def create_kpis(self, service_id): def create_kpis(self, service_id, device_id, endpoint_id): # for now, all the KPIs are created for all the services from which requests are received for kpi in self.monitored_kpis: created_kpi = self.create_kpi( self.monitoring_client, service_id, device_id, endpoint_id, kpi, self.monitored_kpis[kpi]["description"], self.monitored_kpis[kpi]["kpi_sample_type"], Loading Loading @@ -428,10 +434,12 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto self.inference_results.put({"output": cryptomining_detector_output_serialized, "timestamp": datetime.now()}) service_id = request.service_id device_id = request.endpoint_id.device_id endpoint_id = request.endpoint_id # Check if a request of a new service has been received and, if so, create the monitored KPIs for that service if service_id not in self.service_ids: self.create_kpis(service_id) self.create_kpis(service_id, device_id, endpoint_id) self.service_ids.append(service_id) # Only notify Attack Mitigator when a cryptomining connection has been detected Loading Loading
manifests/monitoringservice.yaml +76 −76 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ spec: protocol: TCP env: - name: LOG_LEVEL value: "INFO" value: "DEBUG" - name: METRICSDB_HOSTNAME value: "monitoringservice" - name: METRICSDB_ILP_PORT Loading
src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py +11 −3 Original line number Diff line number Diff line Loading @@ -123,10 +123,14 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto -output: KPI identifier representing the KPI """ def create_kpi(self, client: MonitoringClient, service_id, kpi_name, kpi_description, kpi_sample_type): def create_kpi( self, client: MonitoringClient, service_id, device_id, endpoint_id, kpi_name, kpi_description, kpi_sample_type ): kpidescriptor = KpiDescriptor() kpidescriptor.kpi_description = kpi_description kpidescriptor.service_id.service_uuid.uuid = service_id.service_uuid.uuid kpidescriptor.device_id.device_uuid.uuid = device_id.device_uuid.uuid kpidescriptor.endpoint_id.endpoint_uuid.uuid = endpoint_id.endpoint_uuid.uuid kpidescriptor.kpi_sample_type = kpi_sample_type new_kpi = client.SetKpi(kpidescriptor) Loading @@ -141,12 +145,14 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto -output: None """ def create_kpis(self, service_id): def create_kpis(self, service_id, device_id, endpoint_id): # for now, all the KPIs are created for all the services from which requests are received for kpi in self.monitored_kpis: created_kpi = self.create_kpi( self.monitoring_client, service_id, device_id, endpoint_id, kpi, self.monitored_kpis[kpi]["description"], self.monitored_kpis[kpi]["kpi_sample_type"], Loading Loading @@ -428,10 +434,12 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto self.inference_results.put({"output": cryptomining_detector_output_serialized, "timestamp": datetime.now()}) service_id = request.service_id device_id = request.endpoint_id.device_id endpoint_id = request.endpoint_id # Check if a request of a new service has been received and, if so, create the monitored KPIs for that service if service_id not in self.service_ids: self.create_kpis(service_id) self.create_kpis(service_id, device_id, endpoint_id) self.service_ids.append(service_id) # Only notify Attack Mitigator when a cryptomining connection has been detected Loading