mirror of
https://github.com/valitydev/Cortex-Analyzers.git
synced 2024-11-07 17:38:53 +00:00
consistency with the configuration file
This commit is contained in:
parent
3fad29ef63
commit
1ecc251178
@ -21,7 +21,7 @@ class FireholBlocklistsAnalyzer(Analyzer):
|
|||||||
|
|
||||||
# Get config parameters
|
# Get config parameters
|
||||||
self.path = self.getParam('config.blocklistpath', '/tmp/fireholblocklists')
|
self.path = self.getParam('config.blocklistpath', '/tmp/fireholblocklists')
|
||||||
self.ignoredays = self.getParam('config.ignoreolderthandays', 365)
|
self.ignoredays = self.getParam('config.ignoredays', 365)
|
||||||
self.utc = pytz.UTC
|
self.utc = pytz.UTC
|
||||||
self.now = dt.datetime.now(tz=self.utc)
|
self.now = dt.datetime.now(tz=self.utc)
|
||||||
|
|
||||||
@ -73,6 +73,7 @@ class FireholBlocklistsAnalyzer(Analyzer):
|
|||||||
datestr = re.sub('# Source File Date: ', '', l.rstrip('\n'))
|
datestr = re.sub('# Source File Date: ', '', l.rstrip('\n'))
|
||||||
date = parse(datestr)
|
date = parse(datestr)
|
||||||
file_date[ipsetname] = str(date)
|
file_date[ipsetname] = str(date)
|
||||||
|
print(self.now - date).days
|
||||||
if (self.now - date).days > self.ignoredays:
|
if (self.now - date).days > self.ignoredays:
|
||||||
break
|
break
|
||||||
description[ipsetname] += re.sub(r'^\[.*\] \(.*\) [a-zA-Z0-9.\- ]*$', '', l.lstrip('# '))\
|
description[ipsetname] += re.sub(r'^\[.*\] \(.*\) [a-zA-Z0-9.\- ]*$', '', l.lstrip('# '))\
|
||||||
|
Loading…
Reference in New Issue
Block a user