pub struct EgressPolicy {
pub allowed_cidrs: Vec<String>,
pub allowed_tcp_ports: Vec<u16>,
pub allowed_udp_ports: Vec<u16>,
pub log_denied: bool,
pub allow_dns: bool,
}Expand description
Egress policy for audited outbound network access.
When set, iptables OUTPUT chain rules restrict which destinations the
container process can connect to. Use EgressPolicy::deny_all when no
outbound connections, including DNS, should be permitted.
Fields§
§allowed_cidrs: Vec<String>Allowed destination CIDRs (e.g., “10.0.0.0/8”, “192.168.1.0/24”).
allowed_tcp_ports: Vec<u16>Allowed destination TCP ports. Empty means all ports on allowed CIDRs.
allowed_udp_ports: Vec<u16>Allowed destination UDP ports.
log_denied: boolWhether to log denied egress attempts (rate-limited).
allow_dns: boolWhether to add implicit DNS (port 53 UDP/TCP) allow rules for configured
resolvers. Defaults to true for explicit allowlist usability.
Implementations§
Source§impl EgressPolicy
impl EgressPolicy
Sourcepub fn with_allowed_cidrs(self, cidrs: Vec<String>) -> Self
pub fn with_allowed_cidrs(self, cidrs: Vec<String>) -> Self
Allow egress to the given CIDRs on any port.
pub fn with_allowed_tcp_ports(self, ports: Vec<u16>) -> Self
pub fn with_allowed_udp_ports(self, ports: Vec<u16>) -> Self
Trait Implementations§
Source§impl Clone for EgressPolicy
impl Clone for EgressPolicy
Source§fn clone(&self) -> EgressPolicy
fn clone(&self) -> EgressPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EgressPolicy
impl Debug for EgressPolicy
Auto Trait Implementations§
impl Freeze for EgressPolicy
impl RefUnwindSafe for EgressPolicy
impl Send for EgressPolicy
impl Sync for EgressPolicy
impl Unpin for EgressPolicy
impl UnsafeUnpin for EgressPolicy
impl UnwindSafe for EgressPolicy
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