Module parser

Module parser 

Source
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§

ControlAction
Control actions.
Lexer
Lexer for ModSecurity configuration.
OperatorSpec
An operator specification in a SecRule.
Parser
Parser for ModSecurity configuration files.
SecAction
A SecAction directive.
SecMarker
A SecMarker directive.
SecRule
A SecRule directive.
SetVarSpec
SetVar specification.
Token
Token produced by the lexer.
VariableSpec
A variable specification in a SecRule.

Enums§

Action
An action in a SecRule.
DataAction
Data actions.
Directive
A parsed ModSecurity directive.
DisruptiveAction
Disruptive actions.
FlowAction
Flow control actions.
LoggingAction
Logging actions.
MetadataAction
Metadata actions.
OperatorName
Operator names supported by ModSecurity.
RuleEngineMode
Rule engine mode.
Selection
Selection mode for collection variables.
SetVarValue
SetVar value types.
TokenKind
Types of tokens.
VariableName
Variable names supported by ModSecurity.

Functions§

parse_actions
Parse an action list from a string.