Network

Struct Network 

Source
pub struct Network { /* private fields */ }
Expand description

The network is defined as the communication path over which a host or network event happens.

The network.* fields should be populated with details about the network activity associated with an event.

Implementations§

Source§

impl Network

Source

pub fn get_name(&self) -> Option<&String>

Name given by operators to sections of their network.

Source

pub fn set_name(&mut self, name_arg: String)

Name given by operators to sections of their network.

§Example

Guest Wifi

Source

pub fn get_type(&self) -> Option<&String>

In the OSI Model this would be the Network Layer. ipv4, ipv6, ipsec, pim, etc

The field value must be normalized to lowercase for querying.

Source

pub fn set_type(&mut self, type_arg: String)

In the OSI Model this would be the Network Layer. ipv4, ipv6, ipsec, pim, etc

The field value must be normalized to lowercase for querying.

§Example

ipv4

Source

pub fn get_iana_number(&self) -> Option<&String>

IANA Protocol Number (https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). Standardized list of protocols. This aligns well with NetFlow and sFlow related logs which use the IANA Protocol Number.

Source

pub fn set_iana_number(&mut self, iana_number_arg: String)

IANA Protocol Number (https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). Standardized list of protocols. This aligns well with NetFlow and sFlow related logs which use the IANA Protocol Number.

§Example

6

Source

pub fn get_transport(&self) -> Option<&String>

Same as network.iana_number, but instead using the Keyword name of the transport layer (udp, tcp, ipv6-icmp, etc.)

The field value must be normalized to lowercase for querying.

Source

pub fn set_transport(&mut self, transport_arg: String)

Same as network.iana_number, but instead using the Keyword name of the transport layer (udp, tcp, ipv6-icmp, etc.)

The field value must be normalized to lowercase for querying.

§Example

tcp

Source

pub fn get_application(&self) -> Option<&String>

When a specific application or service is identified from network connection details (source/dest IPs, ports, certificates, or wire format), this field captures the application’s or service’s name.

For example, the original event identifies the network connection being from a specific web service in a https network connection, like facebook or twitter.

The field value must be normalized to lowercase for querying.

Source

pub fn set_application(&mut self, application_arg: String)

When a specific application or service is identified from network connection details (source/dest IPs, ports, certificates, or wire format), this field captures the application’s or service’s name.

For example, the original event identifies the network connection being from a specific web service in a https network connection, like facebook or twitter.

The field value must be normalized to lowercase for querying.

§Example

aim

Source

pub fn get_protocol(&self) -> Option<&String>

In the OSI Model this would be the Application Layer protocol. For example, http, dns, or ssh.

The field value must be normalized to lowercase for querying.

Source

pub fn set_protocol(&mut self, protocol_arg: String)

In the OSI Model this would be the Application Layer protocol. For example, http, dns, or ssh.

The field value must be normalized to lowercase for querying.

§Example

http

Source

pub fn get_direction(&self) -> Option<&String>

Direction of the network traffic.

When mapping events from a host-based monitoring context, populate this field from the host’s point of view, using the values “ingress” or “egress”.

When mapping events from a network or perimeter-based monitoring context, populate this field from the point of view of the network perimeter, using the values “inbound”, “outbound”, “internal” or “external”.

Note that “internal” is not crossing perimeter boundaries, and is meant to describe communication between two hosts within the perimeter. Note also that “external” is meant to describe traffic between two hosts that are external to the perimeter. This could for example be useful for ISPs or VPN service providers.

Source

pub fn set_direction(&mut self, direction_arg: String)

Direction of the network traffic.

When mapping events from a host-based monitoring context, populate this field from the host’s point of view, using the values “ingress” or “egress”.

When mapping events from a network or perimeter-based monitoring context, populate this field from the point of view of the network perimeter, using the values “inbound”, “outbound”, “internal” or “external”.

Note that “internal” is not crossing perimeter boundaries, and is meant to describe communication between two hosts within the perimeter. Note also that “external” is meant to describe traffic between two hosts that are external to the perimeter. This could for example be useful for ISPs or VPN service providers.

§Example

inbound

Source

pub fn get_forwarded_ip(&self) -> Option<&String>

Host IP address when the source IP address is the proxy.

Source

pub fn set_forwarded_ip(&mut self, forwarded_ip_arg: String)

Host IP address when the source IP address is the proxy.

§Example

192.1.1.2

Source

pub fn get_community_id(&self) -> Option<&String>

A hash of source and destination IPs and ports, as well as the protocol used in a communication. This is a tool-agnostic standard to identify flows.

Learn more at https://github.com/corelight/community-id-spec.

Source

pub fn set_community_id(&mut self, community_id_arg: String)

A hash of source and destination IPs and ports, as well as the protocol used in a communication. This is a tool-agnostic standard to identify flows.

Learn more at https://github.com/corelight/community-id-spec.

§Example

1:hO+sN4H+MG5MY/8hIrXPqc4ZQz0=

Source

pub fn get_bytes(&self) -> Option<&u64>

Total bytes transferred in both directions.

If source.bytes and destination.bytes are known, network.bytes is their sum.

Source

pub fn set_bytes(&mut self, bytes_arg: u64)

Total bytes transferred in both directions.

If source.bytes and destination.bytes are known, network.bytes is their sum.

§Example

368

Source

pub fn get_packets(&self) -> Option<&u64>

Total packets transferred in both directions.

If source.packets and destination.packets are known, network.packets is their sum.

Source

pub fn set_packets(&mut self, packets_arg: u64)

Total packets transferred in both directions.

If source.packets and destination.packets are known, network.packets is their sum.

§Example

24

Source

pub fn get_inner(&self) -> Option<&Value>

Network.inner fields are added in addition to network.vlan fields to describe the innermost VLAN when q-in-q VLAN tagging is present. Allowed fields include vlan.id and vlan.name. Inner vlan fields are typically used when sending traffic with multiple 802.1q encapsulations to a network sensor (e.g. Zeek, Wireshark.)

Source

pub fn set_inner(&mut self, inner_arg: Value)

Network.inner fields are added in addition to network.vlan fields to describe the innermost VLAN when q-in-q VLAN tagging is present. Allowed fields include vlan.id and vlan.name. Inner vlan fields are typically used when sending traffic with multiple 802.1q encapsulations to a network sensor (e.g. Zeek, Wireshark.)

Trait Implementations§

Source§

impl Clone for Network

Source§

fn clone(&self) -> Network

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 Default for Network

Source§

fn default() -> Network

Returns the “default value” for a type. Read more
Source§

impl Serialize for Network

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

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> 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.