Skip to main content

Crate syara_x

Crate syara_x 

Source
Expand description

SYARA-X — Super YARA in Rust.

Extends the YARA rule format with semantic, ML-classifier, and LLM-based matching.

§Example

use syara_x;

let rules = syara_x::compile_str(r#"
    rule test_rule {
        strings:
            $s1 = "hello world" nocase
        condition:
            $s1
    }
"#).unwrap();

let matches = rules.scan("Hello World");
assert_eq!(matches.iter().filter(|m| m.matched).count(), 1);

Re-exports§

pub use compiled_rules::CompiledRules;
pub use error::SyaraError;
pub use models::Match;
pub use models::MatchDetail;
pub use models::Rule;

Modules§

compiled_rules
engine
error
models

Functions§

compile
Compile rules from a .syara file.
compile_str
Compile rules from a string.