将Firebase Cloud功能限制为IP地址 [英] Limit Firebase Cloud Function To IP Addresses

查看:39
本文介绍了将Firebase Cloud功能限制为IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个都已设置并运行良好的Cloud Function,每种类型均为 https.onRequest(... .

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

我正在尝试找出最好/最简单的方法,以允许通过指定的IP地址仅调用 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.

推荐答案

您可以将GCE VM用作具有防火墙规则的代理,以仅接受来自所需IP的传入流量

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

GCE VM可以使用这些功能,为避免公共流量影响您的功能,您可以应用

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.

或者您可以将功能移至App Engine服务,它允许使用防火墙规则

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

这篇关于将Firebase Cloud功能限制为IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆