HTTPS proxy¶
A connection to port 443 of a host with http rules, or of a credential's host, goes through hallpass's proxy, which decides each request. The host is known by the names of the address. For the rules and the credentials, see HTTPS requests and Credentials.
The swap¶
The monitor does not let the kernel connect: it puts one end of a loopback TCP connection in place of the program's socket (SECCOMP_IOCTL_NOTIF_ADDFD), and gives the other end to the proxy.
The swap happens at the connect, in lite and strict mode alike: no kernel connect happens for a swapped socket. http rules are the proxy's alone, never in the kernel.
Costs of the swap:
- socket options set before the
connectare lost; - a non-blocking
connectsucceeds at once instead ofEINPROGRESS; - one more loopback connection per connection.
Kubernetes¶
hallpass-node runs in the node's network namespace, but makes the loopback pair, and its own connections to the servers, in the pod's: the servers see the pod's address, and NetworkPolicy applies as if the container connected.
The servers are checked with hallpass-node's roots, never the container's. A container that may have CAP_NET_RAW can forge its names: see CAP_NET_RAW.
Credentials¶
The sandbox gets a placeholder; the proxy holds the token and puts it on the wire, only towards the credential's hosts.
Without the proxy¶
A session with http rules or credentials but no proxy, or no names its rules can match (--dns=off, names for display only), is denied port 443, TCP and UDP (reason no-proxy), whatever its connect rules allow. Its http rules are not ignored, nor a placeholder sent. Other ports follow the rules.