Skip to main content

Crate cant_proxy

Crate cant_proxy 

Source
Expand description

The filtering proxy for network allow lists (Phase 6.3; docs/NETWORK-ALLOWLIST.md §6).

A cant with network = { allow = [...] } will run in a network namespace whose only way out is this proxy (Phase 6.4). It accepts CONNECT host:port only, checks the name against the allow list before any DNS lookup, resolves once, refuses a name with any answer in a private, loopback, link-local or otherwise special range (deny), dials the checked address (never the name), and splices bytes both ways. One log line per decision, never payload. Threads and std::net only: no async runtime, no dependency but the manifest’s canonicaliser, so the proxy and the manifest agree on what a name is.

Modules§

deny
Addresses the proxy never connects to, whatever a name resolves to: everything the IANA special-purpose registries mark as not globally reachable (checked against iana-ipv4-special-registry and iana-ipv6-special-registry on 2026-12-03), multicast, and a few that reach the machine or its cloud (NETWORK-ALLOWLIST.md §6). A name that resolves to one of these is refused, so an allowed name can’t be pointed at a printer, a router, a metadata service or this machine.

Structs§

Connect
A CONNECT the proxy may consider: a canonical host name and a port.
Limits
Time and size limits (NETWORK-ALLOWLIST.md §6).
Proxy
A configured proxy; Proxy::serve runs it on a listener.
Refusal
A refused request: the HTTP status to answer and why (for the log).
Rules
What the proxy allows and how.
Upstream
An upstream HTTP proxy to chain through (the user’s own HTTPS_PROXY).

Type Aliases§

Log
Receives one line per decision.