From 8be5271c381ba161a9305059bed329c29a1c7bcb Mon Sep 17 00:00:00 2001
From: karamchandan <amit.kbatra@alumnos.upm.es>
Date: Tue, 11 Jul 2023 00:56:40 +0200
Subject: [PATCH] Fixed bugs in CAD service implementation

---
 .../service/l3_attackmitigatorServiceServicerImpl.py      | 4 +++-
 .../l3_centralizedattackdetectorServiceServicerImpl.py    | 8 +++++---
 src/tests/scenario3/l3/deploy_specs.sh                    | 2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py b/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py
index ad02f6243..e374ad45a 100644
--- a/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py
+++ b/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py
@@ -138,9 +138,11 @@ class l3_attackmitigatorServiceServicerImpl(L3AttackmitigatorServicer):
 
         # Add the ACLRuleSet to the list of configured ACLRuleSets
         self.configured_acl_config_rules.append(acl_config_rule)
+        
+        LOGGER.info(service_request)
 
         # Update the Service with the new ACL RuleSet
-        service_reply: ServiceId = self.service_client.UpdateService(service_request)
+        service_reply = self.service_client.UpdateService(service_request)
 
         LOGGER.info(f"Service reply: {grpc_message_to_json_string(service_reply)}")
 
diff --git a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py
index 36d1d7b92..8b675e8a5 100644
--- a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py
+++ b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py
@@ -174,6 +174,9 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto
 
         # AM evaluation tests
         self.am_notification_times = []
+        
+        # List of attack connections IPs
+        self.attack_ips = []
 
         # List of attack connections
         self.attack_connections = []
@@ -274,9 +277,8 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto
         if non_empty_time_interval:
             for service_id in monitor_service_ids:
                 LOGGER.debug("service_id: {}".format(service_id))
-
-                self.monitor_compute_l3_kpi(service_id, monitor_inference_results)
-
+                
+                self.monitor_compute_l3_kpi()
                 LOGGER.debug("KPIs sent to monitoring server")
         else:
             LOGGER.debug("No KPIs sent to monitoring server")
diff --git a/src/tests/scenario3/l3/deploy_specs.sh b/src/tests/scenario3/l3/deploy_specs.sh
index c3c9122b8..da6583f9d 100644
--- a/src/tests/scenario3/l3/deploy_specs.sh
+++ b/src/tests/scenario3/l3/deploy_specs.sh
@@ -20,7 +20,7 @@
 export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"
 
 # Set the list of components, separated by spaces, you want to build images for, and deploy.
-export TFS_COMPONENTS="context device pathcomp service slice compute webui load_generator monitoring automation l3_attackmitigator l3_centralizedattackdetector"
+export TFS_COMPONENTS="context device pathcomp service slice compute webui monitoring automation l3_attackmitigator l3_centralizedattackdetector"
 
 # Set the tag you want to use for your images.
 export TFS_IMAGE_TAG="dev"
-- 
GitLab