refined-architect-59368
03/03/2025, 12:41 PMDoes Oathkeeper have any restrictions on which IPs it can trigger requests to?Scenario: We have a
hydrator
mutator set up for Oathkeeper running within Docker.
The API endpoint we want to call is running on the host, so we set up the URL as:
mutators:
noop:
enabled: true
hydrator:
enabled: true
config:
api:
url: <http://host.docker.internal>:{some-port}/some-endpoint
With this set up, Oathkeeper fails to call the endpoint, failing with an error:
prohibited IP address: 0.250.250.254 is not a permitted destination (denied by: 0.0.0.0/8)
(I'm assuming that this is the IP host.docker.internal
is resolving to)
However, if we expose the same service publicly (e.g. using ngrok)
ngrok http {some-port}
> <https://some-random-ngrok-endpoint.ngrok.app>
and update the config:
mutators:
noop:
enabled: true
hydrator:
enabled: true
config:
api:
url: <https://some-random-ngrok-endpoint.ngrok.app/some-endpoint>
then the endpoint gets called.gray-library-49237
03/03/2025, 10:57 PMgray-library-49237
03/03/2025, 10:58 PMrefined-architect-59368
03/04/2025, 5:42 AMnslookup
from within the Oathkeeper container:
/ $ nslookup host.docker.internal
Server: 127.0.0.11
Address: 127.0.0.11:53
Non-authoritative answer:
Non-authoritative answer:
Name: host.docker.internal
Address: 0.250.250.254
However, I don't think this is unusual, since this is related to Docker networking. I think there's an application level check that's preventing calls to this host.
I say this because using curl/wget to make a request to this host works; it's only Oathkeeper that's unable to make this call.gray-library-49237
03/04/2025, 5:46 AMrefined-architect-59368
03/04/2025, 5:50 AM<http://host.docker.internal>:{some-port}/some-endpoint
works when I perform it from within the Docker container
However, Oathkeeper is unable to make the same API call.
(host.docker.internal
is how Docker recommends accessing the host from the container - ref https://docs.docker.com/desktop/features/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host)gray-library-49237
03/04/2025, 6:04 AMrefined-architect-59368
03/04/2025, 7:34 AMrefined-architect-59368
03/09/2025, 6:14 PMhost.internal.docker
to the IP address we were seeing in the logs (0.250.250.254
).
Since this IP is not included in that allow-list, this request gets denied.
Therefore, I think the combination of Ory starting to have the IP address restriction, combined with using Orbstack, is the cause of this problem.magnificent-energy-493
refined-architect-59368
03/11/2025, 10:13 AMngrok
I've also asked the Orbstack team whether there's a way to configure the IP that's assigned to that domain: https://github.com/orgs/orbstack/discussions/1829refined-architect-59368
03/11/2025, 10:13 AMmagnificent-energy-493