Expand description
SecRule parser module.
This module handles parsing of ModSecurity configuration directives including:
- SecRule: The main rule directive
- SecAction: Actions without matching
- SecMarker: Named markers for skipAfter
- SecRuleEngine: Enable/disable rule processing
- Include: File inclusion
§SecRule Syntax
SecRule VARIABLES "OPERATOR" "ACTIONS"Where:
- VARIABLES: Comma-separated list of variables to inspect
- OPERATOR: Pattern to match (e.g., @rx, @contains)
- ACTIONS: Comma-separated list of actions (e.g., id:1,deny,log)
Structs§
- Control
Action - Control actions.
- Lexer
- Lexer for ModSecurity configuration.
- Operator
Spec - An operator specification in a SecRule.
- Parser
- Parser for ModSecurity configuration files.
- SecAction
- A SecAction directive.
- SecMarker
- A SecMarker directive.
- SecRule
- A SecRule directive.
- SetVar
Spec - SetVar specification.
- Token
- Token produced by the lexer.
- Variable
Spec - A variable specification in a SecRule.
Enums§
- Action
- An action in a SecRule.
- Data
Action - Data actions.
- Directive
- A parsed ModSecurity directive.
- Disruptive
Action - Disruptive actions.
- Flow
Action - Flow control actions.
- Logging
Action - Logging actions.
- Metadata
Action - Metadata actions.
- Operator
Name - Operator names supported by ModSecurity.
- Rule
Engine Mode - Rule engine mode.
- Selection
- Selection mode for collection variables.
- SetVar
Value - SetVar value types.
- Token
Kind - Types of tokens.
- Variable
Name - Variable names supported by ModSecurity.
Functions§
- parse_
actions - Parse an action list from a string.