jasonish / py-idstools

idstools: Snort and Suricata Rule and Event Utilities in Python (Including a Rule Update Tool)
Other
277 stars 85 forks source link

support for spaces in list of hosts #65

Closed 0xmilkmix closed 6 years ago

0xmilkmix commented 6 years ago

problem

From suricata documentation, source-and-destination can be a list containing spaces in rules

solution

create regexp to match either single host or list of hosts

attempt

jasonish commented 6 years ago

Regular expressions aren't the best here. Can you try my "develop" branch? I've reduced the use of re's and added a simple state based parser for the header that works in about the same amount of time.

0xmilkmix commented 6 years ago

neat! indeed that the best way to do it. I'm writing a port of your lib in php for MISP (perform some validations on rules format). I'll switch to states/loops as well