pub struct Cuckoo;Expand description
cuckoo module.
To use the module, the json report must be provided before the scan:
use boreal::module::{Cuckoo, CuckooData};
use boreal::compiler::CompilerBuilder;
let mut compiler = CompilerBuilder::new().add_module(Cuckoo).build();
compiler.add_rules_str(r#"
import "cuckoo"
rule a {
condition: cuckoo.network.host(/crates.io/)
}"#).unwrap();
let mut scanner = compiler.finalize();
let report = r#"{ "network": { "hosts": ["crates.io"] } }"#;
let cuckoo_data = CuckooData::from_json_report(report).unwrap();
scanner.set_module_data::<Cuckoo>(cuckoo_data);
let result = scanner.scan_mem(b"").unwrap();
assert_eq!(result.rules.len(), 1);Trait Implementations§
Source§impl Module for Cuckoo
impl Module for Cuckoo
Source§fn get_static_values(&self) -> HashMap<&'static str, StaticValue>
fn get_static_values(&self) -> HashMap<&'static str, StaticValue>
Static values exported by the module. Read more
Source§fn get_dynamic_types(&self) -> HashMap<&'static str, Type>
fn get_dynamic_types(&self) -> HashMap<&'static str, Type>
Type of the dynamic values exported by the module. Read more
Source§fn setup_new_scan(&self, data_map: &mut ModuleDataMap<'_>)
fn setup_new_scan(&self, data_map: &mut ModuleDataMap<'_>)
Setup data when a new scan is started. Read more
Source§fn get_dynamic_values(
&self,
_ctx: &mut ScanContext<'_, '_, '_>,
_values: &mut HashMap<&'static str, Value>,
)
fn get_dynamic_values( &self, _ctx: &mut ScanContext<'_, '_, '_>, _values: &mut HashMap<&'static str, Value>, )
Values computed dynamically. Read more
Source§impl ModuleData for Cuckoo
impl ModuleData for Cuckoo
Source§type PrivateData = ()
type PrivateData = ()
Private Data to associate with the module. Read more
Source§type UserData = CuckooData
type UserData = CuckooData
Data that the user can provide to the module. Read more
Auto Trait Implementations§
impl Freeze for Cuckoo
impl RefUnwindSafe for Cuckoo
impl Send for Cuckoo
impl Sync for Cuckoo
impl Unpin for Cuckoo
impl UnwindSafe for Cuckoo
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