File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 2727config .read ('../etc/analyzer.conf' )
2828
2929expirations = config .items ('expiration' )
30-
30+ excludesubstrings = config . get ( 'exclude' , 'substring' ). split ( ',' )
3131myuuid = config .get ('global' , 'my-uuid' )
3232myqueue = "analyzer:8:{}" .format (myuuid )
3333mylogginglevel = config .get ('global' , 'logging-level' )
@@ -89,7 +89,7 @@ def process_format_passivedns(line=None):
8989
9090while (True ):
9191 expiration = None
92- d4_record_line = r_d4 .rpop (myqueue )
92+ d4_record_line = r_d4 .rpop (myqueue )
9393 if d4_record_line is None :
9494 time .sleep (1 )
9595 continue
@@ -103,6 +103,13 @@ def process_format_passivedns(line=None):
103103 logger .debug ('Parsing of passive DNS line is incomplete: {}' .format (l .strip ()))
104104 continue
105105 if rdns ['q' ] and rdns ['type' ]:
106+ excludeflag = False
107+ for exclude in excludesubstrings :
108+ if exclude in rdns ['q' ]:
109+ excludeflag = True
110+ if excludeflag :
111+ logger .debug ('Excluded {}' .format (rdns ['q' ]))
112+ continue
106113 for y in expirations :
107114 if y [0 ] == rdns ['type' ]:
108115 expiration = y [1 ]
Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ logging-level = INFO
66[expiration]
7716 = 24000
8899 = 26000
9+ [exclude]
10+ substring = spamhaus.org,asn.cymru.com
You can’t perform that action at this time.
0 commit comments