suricatax-rule-parser 0.2.0-alpha.1

A parser for Suricata rules
Documentation
  • Coverage
  • 30%
    6 out of 20 items documented0 out of 4 items with examples
  • Size
  • Source code size: 32.63 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 664.46 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • jasonish/suricatax-rule-parser-rs
    13 4 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jasonish

suricatax-rule-parser

Experimental Rust scanner for Suricata rules.

The crate tokenizes a rule into header fields and raw option events. It does not try to fully interpret option semantics; applications can layer their own validation or higher-level parsing on top of the event stream.

Example

use suricatax_rule_parser::scanner::{RuleScanEvent, RuleScanner};

fn main() -> Result<(), suricatax_rule_parser::Error> {
    let rule = r#"alert tcp any any -> any any (msg:"TEST"; sid:1;)"#;

    for event in RuleScanner::new(rule) {
        match event? {
            RuleScanEvent::Action(action) => println!("action={action}"),
            RuleScanEvent::Option { name, value } => println!("{name}={value:?}"),
            _ => {}
        }
    }

    Ok(())
}

License

Licensed under either of:

at your option.