Skip to main content

NetworkActivity

Struct NetworkActivity 

Source
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: u16

Always 4001.

§category_uid: u8

Always 4 (Network Activity).

§type_uid: u32

class_uid * 100 + activity_id.

§activity_id: u8

Activity ID.

§activity_name: Option<String>

Human-readable activity name.

§time: i64

Event time as epoch milliseconds.

§severity_id: u8

Severity ID (0-6, 99).

§severity: Option<String>

Human-readable severity label.

§status_id: u8

Status ID (0=Unknown, 1=Success, 2=Failure).

§status: Option<String>

Human-readable status label.

§message: Option<String>

Human-readable event message.

§metadata: Metadata

Metadata (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

Source

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.

Source

pub fn with_src_endpoint(self, ep: NetworkEndpoint) -> Self

Set the source endpoint.

Source

pub fn with_dst_endpoint(self, ep: NetworkEndpoint) -> Self

Set the destination endpoint.

Source

pub fn with_connection_info(self, ci: ConnectionInfo) -> Self

Set connection info.

Source

pub fn with_message(self, msg: impl Into<String>) -> Self

Set the event message.

Source

pub fn with_actor(self, actor: Actor) -> Self

Set the actor.

Source

pub fn with_action_id(self, action_id: u8) -> Self

Set action ID.

Source

pub fn with_disposition_id(self, disposition_id: u8) -> Self

Set disposition ID.

Trait Implementations§

Source§

impl Clone for NetworkActivity

Source§

fn clone(&self) -> NetworkActivity

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NetworkActivity

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NetworkActivity

Source§

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

Source§

fn eq(&self, other: &NetworkActivity) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for NetworkActivity

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for NetworkActivity

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,