Better log unmanaged

parent 60ee64dd
...@@ -31,6 +31,7 @@ templconf = """ ...@@ -31,6 +31,7 @@ templconf = """
"nostart": [], "nostart": [],
"noapps": [], "noapps": [],
"knownapps": ["DHCP", "DHCPV6", "DNScrypt", "DoH_DoT", "DNS", "Ookla", "ICMP", "ICMPV6", "IGMP", "LLMNR", "MDNS", "DoH_DoT", "Ookla", "WSD"], "knownapps": ["DHCP", "DHCPV6", "DNScrypt", "DoH_DoT", "DNS", "Ookla", "ICMP", "ICMPV6", "IGMP", "LLMNR", "MDNS", "DoH_DoT", "Ookla", "WSD"],
"knowstarts": [],
"ipset": "system_triplet", "ipset": "system_triplet",
"timeout":"3600" "timeout":"3600"
}, },
...@@ -39,6 +40,7 @@ templconf = """ ...@@ -39,6 +40,7 @@ templconf = """
"nostart": [], "nostart": [],
"noapps": [], "noapps": [],
"knownapps": ["Steam", "Xbox", "Playstation"], "knownapps": ["Steam", "Xbox", "Playstation"],
"knowstarts": ["TLS", "HTTP"],
"ipset": "streaming_triplet", "ipset": "streaming_triplet",
"timeout":"3600" "timeout":"3600"
}, },
...@@ -47,6 +49,7 @@ templconf = """ ...@@ -47,6 +49,7 @@ templconf = """
"nostart": ["DNS", "ICMP"], "nostart": ["DNS", "ICMP"],
"noapps": [], "noapps": [],
"knownapps": [], "knownapps": [],
"knowstarts": [],
"ipset": "name_ipset", "ipset": "name_ipset",
"timeout":"3600" "timeout":"3600"
} }
...@@ -185,6 +188,9 @@ class NexDPI(): ...@@ -185,6 +188,9 @@ class NexDPI():
cname = flow.application_category_name cname = flow.application_category_name
aname = flow.application_name aname = flow.application_name
sername = aname.split(".")[-1:][0] sername = aname.split(".")[-1:][0]
startname = False
if aname != sername:
startname = aname.split(".")[:-1][0]
ipv=flow.ip_version ipv=flow.ip_version
log.debug("RECEIVED: "+cname+" "+aname+" "+sername+"\n\n"+str(flow)) log.debug("RECEIVED: "+cname+" "+aname+" "+sername+"\n\n"+str(flow))
...@@ -216,7 +222,10 @@ class NexDPI(): ...@@ -216,7 +222,10 @@ class NexDPI():
sh("ipset add "+ipset_list+" "+triplet+" timeout "+Cats[cname]['timeout']+" --exist > /dev/null 2>&1") sh("ipset add "+ipset_list+" "+triplet+" timeout "+Cats[cname]['timeout']+" --exist > /dev/null 2>&1")
log.info("ADD: "+ipset_list+" "+triplet+" "+self.fullname) log.info("ADD: "+ipset_list+" "+triplet+" "+self.fullname)
if sername in list(Cats[cname]['knownapps']): if sername in list(Cats[cname]['knownapps']):
continue if not start:
continue
elif startname in list(Cats[name]['knowstarts']):
continue
if self.fullname and not self.fullname in UnknownMatch: if self.fullname and not self.fullname in UnknownMatch:
log.warning("UNKNOWN("+str(managed)+"): "+self.fullname) log.warning("UNKNOWN("+str(managed)+"): "+self.fullname)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment