You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: check connections to discovered backends #339
Before each request to a TES instance discovered in a service registry, proTES checks its host with foca.utils.http.check_public_host() (resolve, then check the addresses). The request itself goes through requests (py-tes), which resolves the host again. A host whose addresses change between the check and the request (DNS rebinding, TTL 0) passes the check and then connects to an internal address (e.g., 10.0.0.5 or 169.254.169.254), with proTES' access token for discovered TES instances with auth: client_credentials.
This gap is not new: proTES's own discovery (until #332) had it too, and docs/configuration.md names it ("The host check doesn't protect against DNS rebinding"). FOCA 0.18 has a fix: foca.utils.http.GuardedClient checks the address of each connection itself. FOCA's docs recommend check_public_host() for URLs before they are stored, and the guarded client for requests.
Proposal
Send requests to discovered TES instances through FOCA's guarded HTTP client (or its adapter mounted on the session that TesClient uses), so that the address of each connection is checked. Keep the per-request check_public_host() only if it is still needed. This fits #333, where TesClient sends the forward phase's OutboundRequests. Then remove the DNS rebinding caveat from the docs.
Activity