pub struct CrsModule { /* private fields */ }Expand description
A WafModule evaluating imported CRS/ModSecurity rules. Build with [CrsModule::from_str]
(one source) — the proxy loader concatenates the configured files in include order and
resolves the boot report.
Implementations§
Source§impl CrsModule
impl CrsModule
Sourcepub fn from_source(source: &str) -> Self
pub fn from_source(source: &str) -> Self
Parse + compile one seclang source (e.g. the configured files concatenated in
include order).
Sourcepub fn from_parsed(parsed: ParsedRuleset) -> Self
pub fn from_parsed(parsed: ParsedRuleset) -> Self
Compile an already-parsed ruleset (rules that fail to compile join skipped).
Sourcepub fn loaded_count(&self) -> usize
pub fn loaded_count(&self) -> usize
Number of rules successfully loaded (fast + slow).
Sourcepub fn skipped(&self) -> &[SkippedRule]
pub fn skipped(&self) -> &[SkippedRule]
Rules that could not be loaded into the v1 subset (with reasons).
Trait Implementations§
Source§impl WafModule for CrsModule
impl WafModule for CrsModule
Source§fn structural(&self) -> bool
fn structural(&self) -> bool
CRS rules carry external patterns the native ContentPrefilter does not know about,
so the fast-path cannot prove them inert → this module must run on every request.
fn id(&self) -> &str
fn phase(&self) -> Phase
Source§fn init(&mut self, _cfg: &Config)
fn init(&mut self, _cfg: &Config)
Called once at startup; compile/init rules here, never in
inspect.Source§fn inspect(&self, ctx: &RequestContext) -> Decision
fn inspect(&self, ctx: &RequestContext) -> Decision
Read-only access to context; pipeline owns mutation of
score.Auto Trait Implementations§
impl Freeze for CrsModule
impl RefUnwindSafe for CrsModule
impl Send for CrsModule
impl Sync for CrsModule
impl Unpin for CrsModule
impl UnsafeUnpin for CrsModule
impl UnwindSafe for CrsModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more