pub struct WafEngine { /* private fields */ }Expand description
The main WAF engine composing all sub-systems.
Implementations§
Source§impl WafEngine
impl WafEngine
Sourcepub fn check(&self, req: &WafRequest) -> WafDecision
pub fn check(&self, req: &WafRequest) -> WafDecision
Check a request through all WAF layers.
Returns the first non-Allow decision, or WafDecision::Allow.
Sourcepub fn check_with_headers(
&self,
req: &WafRequest,
) -> (WafDecision, Vec<(String, String)>)
pub fn check_with_headers( &self, req: &WafRequest, ) -> (WafDecision, Vec<(String, String)>)
Check a request and also return rate-limit response headers if applicable.
Sourcepub fn record_connection(&self, ip: IpAddr)
pub fn record_connection(&self, ip: IpAddr)
Record a DDoS connection start.
Sourcepub fn release_connection(&self, ip: IpAddr)
pub fn release_connection(&self, ip: IpAddr)
Record a DDoS connection end.
Sourcepub fn audit_log(&self) -> &WafAuditLog
pub fn audit_log(&self) -> &WafAuditLog
Get the audit log.
Sourcepub fn recent_events(&self, count: usize) -> Vec<WafEvent>
pub fn recent_events(&self, count: usize) -> Vec<WafEvent>
Get recent audit events.
Sourcepub fn prometheus_metrics(&self) -> String
pub fn prometheus_metrics(&self) -> String
Get Prometheus metrics.
Sourcepub fn reload_ip_filter(&self, config: IpFilterConfig)
pub fn reload_ip_filter(&self, config: IpFilterConfig)
Hot-reload the IP filter configuration.
Auto Trait Implementations§
impl !Freeze for WafEngine
impl !RefUnwindSafe for WafEngine
impl Send for WafEngine
impl Sync for WafEngine
impl Unpin for WafEngine
impl UnsafeUnpin for WafEngine
impl UnwindSafe for WafEngine
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