Limit Firebase Cloud Function To IP Addresses

五迷三道 提交于 2021-02-17 06:17:04

问题


I have several Cloud Functions that are all setup and working well, each of type https.onRequest(....

I am trying to figure out the best / easiest way to allow the https.onRequest functions to be called only by specified IP addresses.


Can this be accomplished? I am guessing I need to create a service account with conditions, but I haven't been able to achieve the results I want.


回答1:


You could use a GCE VM as proxy with a firewall rule to only accept incoming traffic form the IP that you want

The GCE VM could hit to the functions and to avoid that public traffic hit your functions you could apply the internal traffic flag on them.

Or you can move your functions to an App Engine Service, it allows use Firewall rules



来源:https://stackoverflow.com/questions/62329759/limit-firebase-cloud-function-to-ip-addresses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!