Appearance
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 setorPUT .../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;Hostis listed underheaders; a network is not in CIDR form; or a duration is outside its range. - Check: the message names the setting.
waap ssrf get -app Ashows 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_namesis read as a destination, and an internal address is flagged unless it is inallow_networksorallow_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-nameto 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_PROXYandHTTPS_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 -ltnon the node shows whether it listens. Events with rulessrf.egress.deniedappear 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 toallow_hosts(*.corp.examplefor a domain). For one endpoint only, add an exception for the rule and field (arg:url). Keepmode: detectuntil the events are clean.
An ordinary value is flagged under a URL-like name
- Symptom:
ssrf.internal_nameorssrf.schemeon a parameter such astargetornextwhose 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 setbare_hosts: false. To keep a non-http scheme such asftp, add it toschemes.
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 asmechanic_apineeds a matching entry (apiis in the defaults). The location (where), thecategories, or a host inallow_hostsorallow_networkscan also let it through. A host name that resolves to an internal address is caught only withdns.enabled: true, and inasyncmode 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 checkwith the same name and value. - Fix: adjust those settings (
url_names,where,categories, the allow lists, ordns.enabled), then retest withwaap ssrf check.
ssrf.dns_timeout events
- Cause:
dns.mode: syncis set and the resolver did not answer withindns.timeout. The request passed. - Fix: check the inspection node's resolver (
/etc/resolv.confand its reachability). Raisedns.timeout(at most 500 ms, added to the request's latency on first sight), or useasyncmode.
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.enabledis off (the default), orpolicy.ssrfis turned off; the application points at another address thanegress.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/listenerson the node), and the application'sHTTP_PROXYandHTTPS_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 topolicy.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.
- "not an allowed destination port": add the port to
- Check: in
detectmode the same events are logged and the requests still pass. Review them before settingmode: 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 fordns.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.confand the reachability of its DNS servers. - Fix: fix the node's resolver; raise
egress.dns_timeout(at most 5 seconds); or shortendns.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
detailsfield (anext_procerror, orwaap_egress_unknown_app);waap overviewfor 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_internalis on. Allowed internal services,allow_hostsandallow_portsare 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_openorfail_closedfor 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(SIfor an idle stream,UOfor the cap on connections to destinations), and the connection limit statistics of the egress listener (limited_connections, prefixegress_<application>). - Fix: have the client reuse connections or send keep-alive data, or raise
egress.max_connections.