IDPS: simplify download parser a bit further as suggested by @Tra5is (38ea28d0ad)

This commit is contained in:
Ad Schellevis 2020-05-15 18:53:16 +02:00
parent 38ea28d0ad
commit 2d052a9bde

View File

@ -67,9 +67,9 @@ class Downloader(object):
flowbits_noalert = line.replace(' ', '').find('flowbits:noalert;') > -1
if flowbits_noalert:
pass
elif re.match("(\s?)*alert", line):
elif re.match("^\s*alert", line):
line = "drop %s" % line[line.find('alert')+5:]
elif re.match("#(\s?)*alert", line):
elif re.match("^#\s*alert", line):
line = '#drop %s' % line[line.find('alert')+5:]
output.append(line)
return '\n'.join(output)