pub struct KillSwitch { /* private fields */ }Expand description
Egress kill-switch: everything is dropped except loopback, the tunnel interface, and the tunnel’s own UDP to the C2 endpoint on the underlay. Rules match interface names, so deleting the tunnel interface (VPN down) leaves traffic dropped instead of rerouted.
Implementations§
Source§impl KillSwitch
impl KillSwitch
pub const TABLE: &'static str = "hatchery_killswitch"
pub fn new(interface: &str, endpoint: &str) -> Result<Self, KillSwitchError>
pub fn interface(&self) -> &str
pub fn endpoint(&self) -> SocketAddr
Sourcepub fn nft_ruleset(&self) -> String
pub fn nft_ruleset(&self) -> String
nftables ruleset (nft -f -). The final counter drop rules make leaks measurable.
Sourcepub fn iptables_restore(&self) -> Option<String>
pub fn iptables_restore(&self) -> Option<String>
The same policy for hosts that only have iptables (iptables-restore, IPv4 endpoint only).
Trait Implementations§
Source§impl Clone for KillSwitch
impl Clone for KillSwitch
Source§impl Debug for KillSwitch
impl Debug for KillSwitch
impl Eq for KillSwitch
Source§impl PartialEq for KillSwitch
impl PartialEq for KillSwitch
impl StructuralPartialEq for KillSwitch
Auto Trait Implementations§
impl Freeze for KillSwitch
impl RefUnwindSafe for KillSwitch
impl Send for KillSwitch
impl Sync for KillSwitch
impl Unpin for KillSwitch
impl UnsafeUnpin for KillSwitch
impl UnwindSafe for KillSwitch
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