Announcement: msc_pyparser

Skip to first unread message

Ervin Hegedüs

Sep 26, 2019, 5:49:54 AM9/26/19
to CRS Mailinglist
Hi all,

(sorry for the cross posting)

let me announce the msc_pyparser tool, a ModSecurity ruleset parser. msc_pyparser can made a full lexical and syntactic analisys on the rules (currently it tested only on CRS and some custom rules). Note, that msc_pyparser supports only four MSC keyword (and the comments) - see the docs.
Beyond these abilities, msc_pyparser builds an AST (abstract syntax tree), and made an own structure in memory - especially a list of dictionaries. Every dict item stores several datas about the recognized token, including number of line.

You can dump this structure (eg. JSON, YAML - or SQL), or can make any contextual depend modification. After this, you can save back the modified version to the original ModSecurity format.

There are some usefull examples in source.

I think this tool can helps you to maintain your rulesets, eg. merge with custom modifications, formatting, or - as above - make any context dependent changes. Please review the examples directory.

If you have any question, issue, bugreport or other feedback, please contact me at the given e-mail address in README, or open an issue on Github (do not disturb this list).

The tool available here:

Reply all
Reply to author
0 new messages