pub struct NetworkActivity {Show 19 fields
pub class_uid: u16,
pub category_uid: u8,
pub type_uid: u32,
pub activity_id: u8,
pub activity_name: Option<String>,
pub time: i64,
pub severity_id: u8,
pub severity: Option<String>,
pub status_id: u8,
pub status: Option<String>,
pub message: Option<String>,
pub metadata: Metadata,
pub src_endpoint: Option<NetworkEndpoint>,
pub dst_endpoint: Option<NetworkEndpoint>,
pub connection_info: Option<ConnectionInfo>,
pub actor: Option<Actor>,
pub action_id: Option<u8>,
pub disposition_id: Option<u8>,
pub unmapped: Option<Value>,
}Expand description
OCSF Network Activity event (class_uid = 4001).
Fields§
§class_uid: u16Always 4001.
category_uid: u8Always 4 (Network Activity).
type_uid: u32class_uid * 100 + activity_id.
activity_id: u8Activity ID.
activity_name: Option<String>Human-readable activity name.
time: i64Event time as epoch milliseconds.
severity_id: u8Severity ID (0-6, 99).
severity: Option<String>Human-readable severity label.
status_id: u8Status ID (0=Unknown, 1=Success, 2=Failure).
status: Option<String>Human-readable status label.
message: Option<String>Human-readable event message.
metadata: MetadataMetadata (required).
src_endpoint: Option<NetworkEndpoint>Source endpoint.
dst_endpoint: Option<NetworkEndpoint>Destination endpoint.
connection_info: Option<ConnectionInfo>Connection info.
actor: Option<Actor>Actor who initiated the network activity.
action_id: Option<u8>Action ID (1=Allowed, 2=Denied).
disposition_id: Option<u8>Disposition ID.
unmapped: Option<Value>Vendor-specific unmapped data.
Implementations§
Source§impl NetworkActivity
impl NetworkActivity
Sourcepub fn new(
activity: NetworkActivityType,
time: i64,
severity_id: u8,
status_id: u8,
metadata: Metadata,
) -> Self
pub fn new( activity: NetworkActivityType, time: i64, severity_id: u8, status_id: u8, metadata: Metadata, ) -> Self
Create a new Network Activity event with required fields.
Sourcepub fn with_src_endpoint(self, ep: NetworkEndpoint) -> Self
pub fn with_src_endpoint(self, ep: NetworkEndpoint) -> Self
Set the source endpoint.
Sourcepub fn with_dst_endpoint(self, ep: NetworkEndpoint) -> Self
pub fn with_dst_endpoint(self, ep: NetworkEndpoint) -> Self
Set the destination endpoint.
Sourcepub fn with_connection_info(self, ci: ConnectionInfo) -> Self
pub fn with_connection_info(self, ci: ConnectionInfo) -> Self
Set connection info.
Sourcepub fn with_message(self, msg: impl Into<String>) -> Self
pub fn with_message(self, msg: impl Into<String>) -> Self
Set the event message.
Sourcepub fn with_actor(self, actor: Actor) -> Self
pub fn with_actor(self, actor: Actor) -> Self
Set the actor.
Sourcepub fn with_action_id(self, action_id: u8) -> Self
pub fn with_action_id(self, action_id: u8) -> Self
Set action ID.
Sourcepub fn with_disposition_id(self, disposition_id: u8) -> Self
pub fn with_disposition_id(self, disposition_id: u8) -> Self
Set disposition ID.
Trait Implementations§
Source§impl Clone for NetworkActivity
impl Clone for NetworkActivity
Source§fn clone(&self) -> NetworkActivity
fn clone(&self) -> NetworkActivity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkActivity
impl Debug for NetworkActivity
Source§impl<'de> Deserialize<'de> for NetworkActivity
impl<'de> Deserialize<'de> for NetworkActivity
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for NetworkActivity
impl PartialEq for NetworkActivity
Source§impl Serialize for NetworkActivity
impl Serialize for NetworkActivity
impl StructuralPartialEq for NetworkActivity
Auto Trait Implementations§
impl Freeze for NetworkActivity
impl RefUnwindSafe for NetworkActivity
impl Send for NetworkActivity
impl Sync for NetworkActivity
impl Unpin for NetworkActivity
impl UnsafeUnpin for NetworkActivity
impl UnwindSafe for NetworkActivity
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