Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parsing of new snort3 rule types #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nilsrennebarth
Copy link

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant