pub struct MirrorPayload {Show 15 fields
pub request_id: String,
pub timestamp: String,
pub source_ip: String,
pub ja4_fingerprint: Option<String>,
pub ja4h_fingerprint: Option<String>,
pub risk_score: f32,
pub matched_rules: Vec<String>,
pub campaign_id: Option<String>,
pub method: String,
pub uri: String,
pub headers: HashMap<String, String>,
pub body: Option<String>,
pub site_name: String,
pub sensor_id: String,
pub protocol_version: String,
}Expand description
JSON payload sent to honeypot endpoints.
Contains all relevant request context for threat analysis:
- Client identification (IP, fingerprints)
- Risk assessment (score, matched rules, campaign correlation)
- Full request details (method, URI, headers, body)
Fields§
§request_id: StringUnique request identifier (UUID v4)
timestamp: StringTimestamp of original request (RFC 3339)
source_ip: StringSource IP address of the client
ja4_fingerprint: Option<String>JA4 TLS fingerprint (if available)
ja4h_fingerprint: Option<String>JA4H HTTP fingerprint (if available)
risk_score: f32Risk score that triggered mirroring (0-100)
matched_rules: Vec<String>IDs of rules that matched this request
campaign_id: Option<String>Campaign ID if correlated to a known threat campaign
method: StringHTTP method (GET, POST, etc.)
uri: StringRequest URI (path + query string)
headers: HashMap<String, String>Request headers (filtered based on configuration)
body: Option<String>Request body (if include_body enabled and within max size)
site_name: StringWAF site/vhost name that processed the request
sensor_id: StringSynapse sensor ID for multi-sensor deployments
protocol_version: StringVersion of the mirror payload protocol
Implementations§
Source§impl MirrorPayload
impl MirrorPayload
Sourcepub fn new(
request_id: String,
source_ip: String,
risk_score: f32,
method: String,
uri: String,
site_name: String,
sensor_id: String,
) -> Self
pub fn new( request_id: String, source_ip: String, risk_score: f32, method: String, uri: String, site_name: String, sensor_id: String, ) -> Self
Creates a new MirrorPayload with required fields.
Sourcepub fn with_rules(self, rules: Vec<String>) -> Self
pub fn with_rules(self, rules: Vec<String>) -> Self
Sets the matched rules.
Sourcepub fn with_campaign(self, campaign_id: Option<String>) -> Self
pub fn with_campaign(self, campaign_id: Option<String>) -> Self
Sets the campaign ID.
Sourcepub fn with_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_headers(self, headers: HashMap<String, String>) -> Self
Sets the request headers after sanitizing sensitive credentials.
Automatically strips Authorization, Cookie, and other credential headers to prevent leaking user credentials to honeypot systems.
Sourcepub fn with_headers_unsanitized(self, headers: HashMap<String, String>) -> Self
pub fn with_headers_unsanitized(self, headers: HashMap<String, String>) -> Self
Sets the request headers without sanitization.
§Safety
This method bypasses header sanitization. Only use this when headers have already been sanitized or when intentionally including all headers (e.g., for internal testing honeypots).
Sourcepub fn to_json_string(&self) -> Result<String, Error>
pub fn to_json_string(&self) -> Result<String, Error>
Serializes the payload to a JSON string.
Trait Implementations§
Source§impl Clone for MirrorPayload
impl Clone for MirrorPayload
Source§fn clone(&self) -> MirrorPayload
fn clone(&self) -> MirrorPayload
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MirrorPayload
impl Debug for MirrorPayload
Source§impl<'de> Deserialize<'de> for MirrorPayload
impl<'de> Deserialize<'de> for MirrorPayload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MirrorPayload
impl RefUnwindSafe for MirrorPayload
impl Send for MirrorPayload
impl Sync for MirrorPayload
impl Unpin for MirrorPayload
impl UnsafeUnpin for MirrorPayload
impl UnwindSafe for MirrorPayload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more