mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 10:12:53 +01:00
[fix] SID wildcards are not parsed by idstools, remove
This commit is contained in:
@@ -97,22 +97,20 @@ def write_pillar(pillar: str, content: dict):
|
|||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
|
|
||||||
def check_sid_pattern(sid_pattern: str, sid_only: bool = False):
|
def check_sid_pattern(sid_pattern: str):
|
||||||
message = f'SID {sid_pattern} is not valid, did you forget the \"re:\" prefix for a regex pattern?'
|
message = f'SID {sid_pattern} is not valid, did you forget the \"re:\" prefix for a regex pattern?'
|
||||||
|
|
||||||
if sid_pattern.startswith('re:') and not sid_only:
|
if sid_pattern.startswith('re:'):
|
||||||
r_string = sid_pattern[3:]
|
r_string = sid_pattern[3:]
|
||||||
if not valid_regex(r_string):
|
if not valid_regex(r_string):
|
||||||
print_err('Invalid regex pattern.')
|
print_err('Invalid regex pattern.')
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
elif sid_pattern == '*':
|
|
||||||
return True
|
|
||||||
else:
|
else:
|
||||||
sid: int
|
sid: int
|
||||||
try:
|
try:
|
||||||
sid = int(sid_pattern.replace('*', ''))
|
sid = int(sid_pattern)
|
||||||
except:
|
except:
|
||||||
print_err(message)
|
print_err(message)
|
||||||
return False
|
return False
|
||||||
@@ -350,7 +348,7 @@ def main():
|
|||||||
subparsers = main_parser.add_subparsers(title='commands', description=subcommand_desc, metavar='', dest='command')
|
subparsers = main_parser.add_subparsers(title='commands', description=subcommand_desc, metavar='', dest='command')
|
||||||
|
|
||||||
|
|
||||||
sid_or_regex_help = 'A valid SID with optional wildcard (ex: "4321" or "432*") or a regular expression pattern (ex: "re:heartbleed|spectre")'
|
sid_or_regex_help = 'A valid SID (ex: "4321") or regular expression pattern (ex: "re:heartbleed|spectre")'
|
||||||
|
|
||||||
# Disabled actions
|
# Disabled actions
|
||||||
disabled = subparsers.add_parser('disabled')
|
disabled = subparsers.add_parser('disabled')
|
||||||
|
|||||||
Reference in New Issue
Block a user