Skip to content

SSRF guard and outbound proxy ​

Symptoms of the SSRF guard (checks on URLs in requests) and the outbound proxy (egress control for the application's own outbound requests).

Saving SSRF settings is refused ​

  • Symptom: 422 from the SSRF page, waap ssrf set or PUT .../ssrf.
  • Cause: the proxy address (egress.listen) is not a loopback address with a port or an absolute unix socket path, or another application or data-plane listener already uses it; a port is outside 1 to 65535; Host is listed under headers; a network is not in CIDR form; or a duration is outside its range.
  • Check: the message names the setting. waap ssrf get -app A shows the allowed values.
  • Fix: give each application its own loopback port (15080, 15081, and so on), and correct the value.

"Check a URL" flags a value that the application sends without trouble ​

  • Cause: the check uses the application's settings. A value under a parameter name in url_names is read as a destination, and an internal address is flagged unless it is in allow_networks or allow_hosts. The result says whether the request would be refused or only logged (detect mode, action log).
  • Check: waap ssrf check -app A -name NAME -value VALUE. Try another -name to see whether the name matters.
  • Fix: see the entry for a legitimate internal fetch that is flagged, below this one.

The application's outbound requests do not use the proxy ​

  • Cause: the application does not read HTTP_PROXY and HTTPS_PROXY; it runs on another host than the node (the proxy listens on loopback only); or the proxy is off.
  • Check: the Outbound proxy tab on the SSRF page shows the address to give. ss -ltn on the node shows whether it listens. Events with rule ssrf.egress.denied appear only for requests that reached it.
  • Fix: set the variables for the application's process, run it on the node, or enable egress.enabled.

A legitimate internal fetch is flagged (ssrf.private, ssrf.internal_name, ...) ​

  • Symptom: events with an ssrf.* rule on a parameter that the application really uses to fetch an internal service (an image store, or a partner callback on the private network).
  • Cause: the destination is internal by design, and the module cannot know that the application is meant to reach it.
  • Check: the event's message gives the decoded destination. Confirm that it is the intended service.
  • Fix: add the address range to policy.ssrf.allow_networks, or the name to allow_hosts (*.corp.example for a domain). For one endpoint only, add an exception for the rule and field (arg:url). Keep mode: detect until the events are clean.

An ordinary value is flagged under a URL-like name ​

  • Symptom: ssrf.internal_name or ssrf.scheme on a parameter such as target or next whose values are not URLs.
  • Cause: the name matched url_names (a whole name, or one of its words), so scheme-less hosts and other schemes are checked there.
  • Fix: remove the entry from url_names, or set bare_hosts: false. To keep a non-http scheme such as ftp, add it to schemes.

An attack URL was not flagged ​

  • Symptom: a URL that should be caught passes.
  • Cause: under names outside url_names, only dangerous schemes are flagged, so a field such as mechanic_api needs a matching entry (api is in the defaults). The location (where), the categories, or a host in allow_hosts or allow_networks can also let it through. A host name that resolves to an internal address is caught only with dns.enabled: true, and in async mode only from its second sight. Also, a request with more than 64 candidate values has its later values unchecked.
  • Check: the settings above on the application's SSRF page, and waap ssrf check with the same name and value.
  • Fix: adjust those settings (url_names, where, categories, the allow lists, or dns.enabled), then retest with waap ssrf check.

ssrf.dns_timeout events ​

  • Cause: dns.mode: sync is set and the resolver did not answer within dns.timeout. The request passed.
  • Fix: check the inspection node's resolver (/etc/resolv.conf and its reachability). Raise dns.timeout (at most 500 ms, added to the request's latency on first sight), or use async mode.

The application cannot reach the outbound proxy ​

  • Symptom: the application's outbound requests fail with "connection refused" at the proxy address.
  • Cause: policy.ssrf.egress.enabled is off (the default), or policy.ssrf is turned off; the application points at another address than egress.listen; or it runs on another host (the proxy listens on loopback or a unix socket only, on each node).
  • Check: the data plane's listeners include listener/egress/<application> (Envoy admin /listeners on the node), and the application's HTTP_PROXY and HTTPS_PROXY.
  • Fix: turn the proxy on, use the same address in the application, and run the application on the node (or reach the unix socket path from its container).

Outbound requests are refused with 403 (ssrf.egress.denied) ​

  • Symptom: the proxy answers 403 with a reference; the event's message gives the reason.
  • Cause and fix, by message:
    • "not an allowed destination port": add the port to egress.allow_ports.
    • "not in the allowed destinations": add the host to egress.allow_hosts, or empty the list.
    • "internal destination": the host is, or resolves to, an internal address. If the application is meant to reach it, add the range to policy.ssrf.allow_networks, or the name to policy.ssrf.allow_hosts.
    • "https URL sent without a tunnel": the client sent GET https://... to the proxy. Configure it as an HTTPS proxy (HTTPS_PROXY) so that it opens a tunnel.
    • "tunnels (CONNECT) are turned off": set egress.connect: true.
  • Check: in detect mode the same events are logged and the requests still pass. Review them before setting mode: block.

Outbound requests fail with 502 "could not be resolved" ​

  • Cause: the destination name has no DNS answer from the inspection node, or the answer took longer than egress.dns_timeout. Failed lookups are kept for dns.cache_ttl (default 60 seconds), so a name that has only just started to resolve keeps failing until then.
  • Check: resolve the name on the inspection node (not on the application's host): /etc/resolv.conf and the reachability of its DNS servers.
  • Fix: fix the node's resolver; raise egress.dns_timeout (at most 5 seconds); or shorten dns.cache_ttl.

Outbound requests fail with 503 "could not be checked" ​

  • Cause: the inspection service was unreachable and the application fails closed (on_inspection_failure: fail_closed); or the data plane and the inspection service run different policy versions, so the proxy exists in one but not the other ("outbound proxy is not configured").
  • Check: the inspection service is running; the access log's details field (an ext_proc error, or waap_egress_unknown_app); waap overview for the versions each part runs.
  • Fix: restore the inspection service, and wait for the new version to reach both parts.

During an inspection outage some destinations work and internal ones do not ​

  • Cause: the application fails open. Requests go out without inspection through the data plane's own resolver, which still drops internal answers when deny_internal is on. Allowed internal services, allow_hosts and allow_ports are not applied on that path.
  • Fix: this is expected. Restore inspection. If internal services must keep working during an outage, or the allow list must always hold, choose fail_open or fail_closed for the application deliberately.

The application's tunnel or download is cut after a while ​

  • Cause: the proxy ends a stream that sent nothing for 5 minutes, and a connection idle for 5 minutes is closed. The per-node connection limit (egress.max_connections) closes new connections beyond it.
  • Check: the access log entry's flags (SI for an idle stream, UO for the cap on connections to destinations), and the connection limit statistics of the egress listener (limited_connections, prefix egress_<application>).
  • Fix: have the client reuse connections or send keep-alive data, or raise egress.max_connections.