Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
35b9ecad
Commit
35b9ecad
authored
2 years ago
by
delacal
Browse files
Options
Downloads
Patches
Plain Diff
- Added endpoint_id field to the monitoring of KPIs in the Centralized Attack Detector.
- Minor fixes.
parent
c2ce42d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!93
Updated L3 components + scalability
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manifests/monitoringservice.yaml
+76
-76
76 additions, 76 deletions
manifests/monitoringservice.yaml
src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py
+11
-3
11 additions, 3 deletions
...ervice/l3_centralizedattackdetectorServiceServicerImpl.py
with
87 additions
and
79 deletions
manifests/monitoringservice.yaml
+
76
−
76
View file @
35b9ecad
...
...
@@ -30,23 +30,23 @@ spec:
terminationGracePeriodSeconds
:
5
restartPolicy
:
Always
containers
:
-
name
:
metricsdb
image
:
questdb/questdb
ports
:
-
name
:
http
containerPort
:
9000
protocol
:
TCP
-
name
:
influxdb
containerPort
:
9009
protocol
:
TCP
-
name
:
postgre
containerPort
:
8812
protocol
:
TCP
env
:
-
name
:
QDB_CAIRO_COMMIT_LAG
value
:
"
1000"
-
name
:
QDB_CAIRO_MAX_UNCOMMITTED_ROWS
value
:
"
100000"
-
name
:
metricsdb
image
:
questdb/questdb
ports
:
-
name
:
http
containerPort
:
9000
protocol
:
TCP
-
name
:
influxdb
containerPort
:
9009
protocol
:
TCP
-
name
:
postgre
containerPort
:
8812
protocol
:
TCP
env
:
-
name
:
QDB_CAIRO_COMMIT_LAG
value
:
"
1000"
-
name
:
QDB_CAIRO_MAX_UNCOMMITTED_ROWS
value
:
"
100000"
---
apiVersion
:
apps/v1
kind
:
Deployment
...
...
@@ -65,37 +65,37 @@ spec:
terminationGracePeriodSeconds
:
5
restartPolicy
:
Always
containers
:
-
name
:
server
image
:
registry.gitlab.com/teraflow-h2020/controller/monitoring:latest
imagePullPolicy
:
Always
ports
:
-
name
:
grpc
containerPort
:
7070
protocol
:
TCP
env
:
-
name
:
LOG_LEVEL
value
:
"
INFO
"
-
name
:
METRICSDB_HOSTNAME
value
:
"
monitoringservice"
-
name
:
METRICSDB_ILP_PORT
value
:
"
9009"
-
name
:
METRICSDB_REST_PORT
value
:
"
9000"
-
name
:
METRICSDB_TABLE
value
:
"
monitoring"
readinessProbe
:
exec
:
command
:
[
"
/bin/grpc_health_probe"
,
"
-addr=:7070"
]
livenessProbe
:
exec
:
command
:
[
"
/bin/grpc_health_probe"
,
"
-addr=:7070"
]
resources
:
requests
:
cpu
:
250m
memory
:
512Mi
limits
:
cpu
:
700m
memory
:
1024Mi
-
name
:
server
image
:
registry.gitlab.com/teraflow-h2020/controller/monitoring:latest
imagePullPolicy
:
Always
ports
:
-
name
:
grpc
containerPort
:
7070
protocol
:
TCP
env
:
-
name
:
LOG_LEVEL
value
:
"
DEBUG
"
-
name
:
METRICSDB_HOSTNAME
value
:
"
monitoringservice"
-
name
:
METRICSDB_ILP_PORT
value
:
"
9009"
-
name
:
METRICSDB_REST_PORT
value
:
"
9000"
-
name
:
METRICSDB_TABLE
value
:
"
monitoring"
readinessProbe
:
exec
:
command
:
[
"
/bin/grpc_health_probe"
,
"
-addr=:7070"
]
livenessProbe
:
exec
:
command
:
[
"
/bin/grpc_health_probe"
,
"
-addr=:7070"
]
resources
:
requests
:
cpu
:
250m
memory
:
512Mi
limits
:
cpu
:
700m
memory
:
1024Mi
---
apiVersion
:
v1
kind
:
Service
...
...
@@ -106,22 +106,22 @@ spec:
selector
:
app
:
monitoringservice
ports
:
-
name
:
grpc
protocol
:
TCP
port
:
7070
targetPort
:
7070
-
name
:
http
protocol
:
TCP
port
:
9000
targetPort
:
9000
-
name
:
influxdb
protocol
:
TCP
port
:
9009
targetPort
:
9009
-
name
:
postgre
protocol
:
TCP
port
:
8812
targetPort
:
8812
-
name
:
grpc
protocol
:
TCP
port
:
7070
targetPort
:
7070
-
name
:
http
protocol
:
TCP
port
:
9000
targetPort
:
9000
-
name
:
influxdb
protocol
:
TCP
port
:
9009
targetPort
:
9009
-
name
:
postgre
protocol
:
TCP
port
:
8812
targetPort
:
8812
---
apiVersion
:
networking.k8s.io/v1
...
...
@@ -131,16 +131,16 @@ metadata:
spec
:
podSelector
:
matchLabels
:
app
:
monitoringservice
app
:
monitoringservice
ingress
:
-
from
:
[]
ports
:
-
port
:
7070
-
port
:
8812
-
from
:
-
podSelector
:
matchLabels
:
app
:
monitoringservice
ports
:
-
port
:
9009
-
port
:
9000
-
from
:
[]
ports
:
-
port
:
7070
-
port
:
8812
-
from
:
-
podSelector
:
matchLabels
:
app
:
monitoringservice
ports
:
-
port
:
9009
-
port
:
9000
This diff is collapsed.
Click to expand it.
src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py
+
11
−
3
View file @
35b9ecad
...
...
@@ -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
)
...
...
@@ -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
"
],
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment