如何限制计算引擎仅接受来自app引擎的请求

时间:2017-01-28 19:44:13

标签: google-app-engine google-cloud-platform google-compute-engine

我正在Google App engine上运行我的服务器,我正在使用nodejs,我在mongoDB, Elasticsearch and Redis上部署了Compute engine等所有其他服务。

现在由于安全问题,在所有数据库实例(MongoDB,ES,Redis)上,我不想接受来自App engine的任何地方的请求。

我可以使用VPN OR Networks Or Firewall(Using Target tags and Source tags)或任何东西来接受仅来自app引擎的请求吗?

我读到了在防火墙部分使用标签,我可以将app引擎实例定义为源标签,并将引擎标签计算为目标标签,这样我的目标标签只能收听源标签

请帮助我们,我很长一段时间都在寻找这个,但是没有找到任何有用的东西。

更新

I tried to set my app_engine instance tag and then used that tag to the firewall rule associated with all services(MongoDB, ES, Redis) so that only services will get connected by app engine only, but it is not working now i am not able to connect to my app engine to all of my services.

我只有一个default network(auto-created by google)的网络,我的所有实例(例如MongoDB以及我的app engine都在同一个default network上。

我在app.yaml

中添加了以下行
network:
  instance_tag: app-tag

下面我坐在app-tagfirewall rule的源标记对于我的MongoDB数据库。

enter image description here

1 个答案:

答案 0 :(得分:3)

您可以灵活使用app引擎。 https://cloud.google.com/appengine/docs/flexible/

然后将serivce机器设置在与数据库相同的网络上。

在此类配置中,您无需将公共IP设置为数据库,因此无法从内部网络外部访问它们。

相关问题