Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupChildNetworking ¶
SetupChildNetworking configures networking within the target process's network namespace. This runs inside the child process after it has been created and moved to its own network namespace.
func StartDummyDNSAndRedirect ¶
StartDummyDNSAndRedirect starts a dummy DNS server in-process (goroutine) listening on 127.0.0.1:5353 and redirects all DNS traffic (UDP/TCP port 53) in the namespace to it via iptables. This prevents DNS exfiltration: all DNS queries get a dummy response (6.6.6.6). Must be called from inside the network namespace.
Types ¶
type LinuxJail ¶
type LinuxJail struct {
// contains filtered or unexported fields
}
LinuxJail implements Jailer using Linux network namespaces
func NewLinuxJail ¶
func (*LinuxJail) Command ¶
Command returns an exec.Cmd configured to run within the network namespace.
func (*LinuxJail) ConfigureHost ¶
ConfigureBeforeCommandExecution prepares the jail environment before the target process is launched. It sets environment variables, creates the veth pair, and installs iptables rules on the host. At this stage, the target PID and its netns are not yet known.
func (*LinuxJail) ConfigureHostNsCommunication ¶
ConfigureHostNsCommunication finalizes host-side networking after the target process has started. It moves the jail-side veth into the target process's network namespace using the provided PID. This requires the process to be running so its PID (and thus its netns) are available.