-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support parsing of new snort3 rule types
snort3 introduces three new rule types: service rules, file rules and file identification rules. The options of these type have the same syntax, they only differ in the header: * Service rules have a two word header: _action_ _service_ where service is the name of an application level protocol, e.g. http, imap, ... * File rules have a two word header: _action_ `file` and action is one of the normal snort actions. * File identification rules have the fixed one word header `file_id`. The patch also adds support for the "rewrite" option that had already been introduced in snort2 The part of the `parse` function that deals with the header was moved into a separate function: `parse_header`. We note that the first two words of a snort rule can not contain spaces, so these can be split off immediately and allow us to handle all new cases. The rest of the header analysis starts with the 3rd word and is mostly unchanged from before. The new parse_header function returns the dict with the header keys or None if the header does not look like a valid snort rule.
- Loading branch information
1 parent
51aebc0
commit 232d6b7
Showing
1 changed file
with
77 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters