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
5967330e
Commit
5967330e
authored
1 year ago
by
karamchandan
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup of the DAD service implementation
parent
ce468995
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!141
Pre-release fixes and code cleanup in L3 cybersecurity components
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/l3_distributedattackdetector/service/l3_distributedattackdetector.py
+2
-14
2 additions, 14 deletions
...tedattackdetector/service/l3_distributedattackdetector.py
with
2 additions
and
14 deletions
src/l3_distributedattackdetector/service/l3_distributedattackdetector.py
+
2
−
14
View file @
5967330e
...
...
@@ -94,7 +94,7 @@ class l3_distributedattackdetector:
# open known attack ips csv file
with
open
(
"
known_attack_ips.csv
"
,
"
r
"
)
as
f
:
known_attack_ips
=
f
.
read
().
split
lines
(
)
known_attack_ips
=
f
.
read
().
split
(
"
,
"
)
return
known_attack_ips
...
...
@@ -184,18 +184,6 @@ class l3_distributedattackdetector:
return
stub
.
ListServices
(
context_id
)
def
get_service_id
(
self
,
context_id
):
service_id_list
=
self
.
get_service_ids
(
context_id
)
service_id
=
None
for
s_id
in
service_id_list
.
service_ids
:
if
(
s_id
.
service_uuid
.
uuid
==
"
0eaa0752-c7b6-4c2e-97da-317fbfee5112
"
):
# TODO: Change this identifier to the L3VPN service identifier with the real router for the demo v2
service_id
=
s_id
break
return
service_id
def
get_service_id2
(
self
,
context_id
):
service_list
=
self
.
get_services
(
context_id
)
service_id
=
None
for
s
in
service_list
.
services
:
...
...
@@ -241,7 +229,7 @@ class l3_distributedattackdetector:
self
.
connections_dict
[
self
.
conn_id
][
"
ip_o
"
]
=
self
.
conn_id
[
0
]
self
.
connections_dict
[
self
.
conn_id
][
"
port_o
"
]
=
self
.
conn_id
[
1
]
self
.
connections_dict
[
self
.
conn_id
][
"
flow_id
"
]
=
"
:
"
.
join
(
self
.
conn_id
)
self
.
connections_dict
[
self
.
conn_id
][
"
service_id
"
]
=
self
.
get_service_id
2
(
CONTEXT_ID
)
self
.
connections_dict
[
self
.
conn_id
][
"
service_id
"
]
=
self
.
get_service_id
(
CONTEXT_ID
)
self
.
connections_dict
[
self
.
conn_id
][
"
endpoint_id
"
]
=
self
.
get_endpoint_id
(
CONTEXT_ID
)
self
.
connections_dict
[
self
.
conn_id
][
"
protocol
"
]
=
"
TCP
"
self
.
connections_dict
[
self
.
conn_id
][
"
ip_d
"
]
=
self
.
conn_id
[
2
]
...
...
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