Skip to content
Snippets Groups Projects
Commit 436e649e authored by Carlos Natalino Da Silva's avatar Carlos Natalino Da Silva
Browse files

Continuing with the implementation of the workflow

parent 527ca678
No related branches found
No related tags found
1 merge request!54Release 2.0.0
...@@ -10,7 +10,7 @@ REGISTRY_IMAGE="" ...@@ -10,7 +10,7 @@ REGISTRY_IMAGE=""
#REGISTRY_IMAGE="http://my-container-registry.local/" #REGISTRY_IMAGE="http://my-container-registry.local/"
# Set the list of components you want to build images for, and deploy. # Set the list of components you want to build images for, and deploy.
COMPONENTS="context device automation policy service compute monitoring centralizedattackdetector" COMPONENTS="context device automation policy service compute monitoring centralizedattackdetector opticalcentralizedattackdetector"
# Set the tag you want to use for your images. # Set the tag you want to use for your images.
IMAGE_TAG="tf-dev" IMAGE_TAG="tf-dev"
...@@ -38,6 +38,10 @@ kubectl delete namespace $K8S_NAMESPACE ...@@ -38,6 +38,10 @@ kubectl delete namespace $K8S_NAMESPACE
kubectl create namespace $K8S_NAMESPACE kubectl create namespace $K8S_NAMESPACE
printf "\n" printf "\n"
# creating secrets
kubectl create secret generic influxdb-secrets --namespace=tf-dev --from-literal=INFLUXDB_USER='test_user' --from-literal=INFLUXDB_DATABASE='test' --from-literal=INFLUXDB_HOSTNAME='influxdb' --from-literal=INFLUXDB_PASSWORD='test_password'
kubectl create secret generic monitoring-secrets --namespace=tf-dev --from-literal=INFLUXDB_USER='test_user' --from-literal=INFLUXDB_DATABASE='test' --from-literal=INFLUXDB_HOSTNAME='influxdb' --from-literal=INFLUXDB_PASSWORD='test_password'
for COMPONENT in $COMPONENTS; do for COMPONENT in $COMPONENTS; do
echo "Processing '$COMPONENT' component..." echo "Processing '$COMPONENT' component..."
IMAGE_NAME="$COMPONENT:$IMAGE_TAG" IMAGE_NAME="$COMPONENT:$IMAGE_TAG"
......
...@@ -12,11 +12,11 @@ GRPC_GRACE_PERIOD = 60 ...@@ -12,11 +12,11 @@ GRPC_GRACE_PERIOD = 60
MONITORING_INTERVAL = 2 # monitoring interval in seconds MONITORING_INTERVAL = 2 # monitoring interval in seconds
#TODO: adjust the addresses below for the specific case #TODO: adjust the addresses below for the specific case
# MONITORING_SERVICE_ADDRESS = 'monitoring' # address/name of the monitoring service # MONITORING_SERVICE_ADDRESS = 'monitoring' # address/name of the monitoring service
MONITORING_SERVICE_ADDRESS = 'localhost' # address/name of the monitoring service MONITORING_SERVICE_ADDRESS = '10.109.226.172' # address/name of the monitoring service
# CONTEXT_SERVICE_ADDRESS = 'context' # address/name of the monitoring service # CONTEXT_SERVICE_ADDRESS = 'context' # address/name of the monitoring service
CONTEXT_SERVICE_ADDRESS = '10.103.238.143' # address/name of the monitoring service CONTEXT_SERVICE_ADDRESS = '10.98.160.79' # address/name of the monitoring service
# SERVICE_SERVICE_ADDRESS = 'service' # address/name of the service service # SERVICE_SERVICE_ADDRESS = 'service' # address/name of the service service
SERVICE_SERVICE_ADDRESS = '10.98.1.146' # address/name of the service service SERVICE_SERVICE_ADDRESS = '10.97.59.81' # address/name of the service service
# INFERENCE_SERVICE_ADDRESS = 'dbscanserving' # address/name of the inference service # INFERENCE_SERVICE_ADDRESS = 'dbscanserving' # address/name of the inference service
INFERENCE_SERVICE_ADDRESS = 'localhost' # address/name of the inference service INFERENCE_SERVICE_ADDRESS = 'localhost' # address/name of the inference service
......
...@@ -40,14 +40,20 @@ def detect_attack(monitoring_interval): ...@@ -40,14 +40,20 @@ def detect_attack(monitoring_interval):
context_ids: ContextIdList = context_client.ListContextIds(Empty()) context_ids: ContextIdList = context_client.ListContextIds(Empty())
# for each context, retrieve list of current services # for each context, retrieve list of current services
service_uuids = [] services = []
for context_id in context_ids.context_ids: for context_id in context_ids.context_ids:
LOGGER.warning(context_id.context_uuid.uuid)
service_ids: ServiceIdList = context_client.ListServiceIds(context_id) context_services: ServiceIdList = context_client.ListServices(context_id)
for service_id in service_ids.service_ids: for service in context_services.services:
service_uuids.append((service_id.context_id.context_uuid.uuid, service_id.service_uuid.uuid)) services.append(service)
# get monitoring data for each of the current services # get monitoring data for each of the current services
for service in services:
for endpoint in service.service_endpoint_ids:
# get instant KPI for this endpoint
LOGGER.warning(f'service: {service.service_id.service_uuid.uuid}\t endpoint: {endpoint.endpoint_uuid.uuid}\tdevice: {endpoint.device_id.device_uuid.uuid}')
# how to get all KPIs for a particular device?
pass
# run attack detection for every service # run attack detection for every service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment