问题
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