diff --git a/.github/issue_template.md b/.github/issue_template.md index 16b88283d..35e74892b 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,10 +1,11 @@ # EDIT THIS TITLE BEFORE POSTING. Use this template for bug reports. If you'd like to request a feature, please be as descriptive as possible and delete the template except the first section (Request Type) ### Request Type -(select Bug or Feature Request and **remove this line**) -Bug / Feature Request +(select Bug, Analyzer or Feature and **remove this line**) +Bug / Analyzer / Feature ### Work Environment +(replace with N/A if not applicable) | Question | Answer |---------------------------|-------------------- @@ -16,10 +17,11 @@ Bug / Feature Request | Browser type & version | If applicable -### Problem Description -Describe the problem/bug as clearly as possible. +### Description +Describe your request as clearly as possible. ### Steps to Reproduce +(keep this section only if the issue relates to a bug) 1. step 1 1. step 2 1. step 3... diff --git a/analyzers/FireHOLBlocklists/firehol_blocklists.py b/analyzers/FireHOLBlocklists/firehol_blocklists.py index ae741fabd..c44ddb0a8 100755 --- a/analyzers/FireHOLBlocklists/firehol_blocklists.py +++ b/analyzers/FireHOLBlocklists/firehol_blocklists.py @@ -20,7 +20,7 @@ def __init__(self): Analyzer.__init__(self) # Get config parameters - self.path = self.getParam('config.blocklistpath', '/tmp/fireholblocklists') + self.path = self.getParam('config.blocklistpath', None, 'No path to blocklists provided.') self.ignoreolderthandays = self.getParam('config.ignoreolderthandays', 365) self.utc = pytz.UTC self.now = dt.datetime.now(tz=self.utc) @@ -65,7 +65,7 @@ def _check_ip(self, ip): with open('{}/{}'.format(self.path, ipset)) as afile: ipsetname = ipset.split('.')[0] description.update({ipsetname: ''}) - file_date.update({ipsetname : ''}) + file_date.update({ipsetname: ''}) for l in afile: if l[0] == '#': # Check for date and break if too old @@ -80,7 +80,8 @@ def _check_ip(self, ip): else: if ip in l: # On match append to hits and break; next file! - hits.append({'list': ipsetname, 'description': description.get(ipsetname), 'file_date': file_date.get(ipsetname)}) + hits.append({'list': ipsetname, 'description': description.get(ipsetname), + 'file_date': file_date.get(ipsetname)}) break # Second: check the netsets @@ -88,14 +89,14 @@ def _check_ip(self, ip): with open('{}/{}'.format(self.path, netset)) as afile: netsetname = netset.split('.')[0] description.update({netsetname: ''}) - file_date.update({ipsetname : ''}) + file_date.update({netsetname: ''}) for l in afile: if l[0] == '#': # Check for date and break if too old if '# Source File Date: ' in l: datestr = re.sub('# Source File Date: ', '', l.rstrip('\n')) date = parse(datestr) - file_date[ipsetname] = str(date) + file_date[netsetname] = str(date) if (self.now - date).days > self.ignoreolderthandays: break description[netsetname] += re.sub(r'^\[.*\] \(.*\) [a-zA-Z0-9.\- ]*$', '', l.lstrip('# '))\ @@ -103,7 +104,8 @@ def _check_ip(self, ip): else: try: if ipaddress.ip_address(ip) in ipaddress.ip_network(u'{}'.format(l.split('\n')[0])): - hits.append({'list': netsetname, 'description': description.get(netsetname), 'file_date': file_date.get(ipsetname)}) + hits.append({'list': netsetname, 'description': description.get(netsetname), + 'file_date': file_date.get(netsetname)}) break except ValueError as e: self.error('ValueError occured. Used values: ipnetwork {}, ip to check {}, file {}.'