Documentation
¶
Overview ¶
Package escapeguard is the Escape guard (see CONTEXT.md): a proxy that OpenTofu and gcloud runs in the acceptance tests go through, so that an Escaped request fails the test, naming the host, instead of reaching Google.
The guard never forwards a request off the machine. It refuses every request, except that after Tunnel a CONNECT to a host Host mode serves goes to the Google front end, which runs on this machine. A client reaches it through HTTPS_PROXY and HTTP_PROXY (Env), or a JVM through JAVA_TOOL_OPTIONS (JavaEnv). Requests to the API gateway bypass it: Go never proxies loopback addresses, and NO_PROXY exempts them for clients such as gcloud that otherwise would. The guard only sees traffic that would leave the machine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescribeGcloud ¶
DescribeGcloud explains why a request from gcloud to host escaped: gcloud sends an API without a CLOUDSDK_API_ENDPOINT_OVERRIDES_<API> to <api>.gcpemu.invalid, or to <api>.googleapis.com outside the Invalid universe.
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard is a running Escape guard.
func (*Guard) Addr ¶ added in v0.12.0
Addr is the guard's host:port, for an in-process client that sends its non-loopback requests to it as a proxy.
func (*Guard) Env ¶
Env returns the variables that send a client's outbound requests to the guard. They override any proxy set in the environment, and set NO_PROXY so that only loopback is exempt.
func (*Guard) JavaEnv ¶ added in v0.12.0
JavaEnv returns Env plus JAVA_TOOL_OPTIONS, which carries the same settings as system properties: the JVM ignores the proxy variables. http.nonProxyHosts is loopback in the JVM's syntax.
func (*Guard) Tunnel ¶ added in v0.10.0
Tunnel passes each CONNECT to one of hosts on to ip, at the port the client asked for, instead of refusing it. Host mode serves hosts at ip, the Google front end's address on this machine, so a client that resolves Google hostnames through the guard reaches Host mode without a change to /etc/hosts or the system resolver.