encoredev / encore

Open Source Development Platform for building robust type-safe distributed systems with declarative infrastructure
https://encore.dev
Mozilla Public License 2.0
7.73k stars 327 forks source link

Is it possible to make requests from a static IP Address with Encore Cloud? #1540

Closed echarrod closed 3 weeks ago

echarrod commented 3 weeks ago

Hello,

I have a project deployed with Encore Cloud.

I am calling an API which requires static IP addresses to be specified, and will reject any requests not from this IP address list.

Looking through the traces of the failed request, example below, I see a

15 Request Headers
Accept-Encoding: gzip
Authorization: [REDACTED]
Cdn-Loop: cloudflare; loops=1; subreqs=1
Cf-Connecting-Ip: [REDACTED]
Cf-Ew-Via: 15
Cf-Ray: 8db4ce69a1e8c981-IAD
Cf-Visitor: {"scheme":"https"}
Cf-Worker: encr.app
Date: Thu, 31 Oct 2024 15:51:24 GMT
Forwarded: for="[REDACTED]";proto=https
Traceparent: 00-da7a2a62d3acddf6eb52ae62bfdc34b4-e61e671ad7cb08e5-01
User-Agent: Go-http-client/2.0
X-Cloud-Trace-Context: da7a2a62d3acddf6eb52ae62bfdc34b4/16581804243011963109;o=1
X-Forwarded-For: [REDACTED],[REDACTED]
X-Forwarded-Proto: https

I've tried whitelisting both the Cf-Connecting-Ip specified, and the Forwarded for, but I notice the latter seems to change with each request.

I believe I will be able to address this by upgrading and using either:

But I'm just wondering if something similar is possible with Encore Cloud? 🙏 Thanks in advance.

eandre commented 3 weeks ago

Hi, no sorry, this is not something we can offer on Encore Cloud at the moment. It's easily supported when deploying to your own cloud however, as you noted.

echarrod commented 2 weeks ago

Thanks André. Would you be able to let me know if the IPs Encore Cloud uses are within a set range?