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

Pra*_*mar 7 google-app-engine google-compute-engine google-cloud-platform

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引擎实例定义为源标签,并将引擎标签计算为目标标签,这样我的目标标签只能监听源标签.

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

UPDATE

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
Run Code Online (Sandbox Code Playgroud)

app-tagfirewall rule我的MongoDB数据库中,我坐在上面的源代码标签.

在此输入图像描述

Avi*_*eir 3

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

然后将服务机器与数据库设置在同一网络中。

在这种配置中,您不需要为数据库设置公共 IP,因此不会从内部网络外部访问它们。

  • 我只有一个网络,即“默认网络(由谷歌自动创建)”,现在我的所有实例(例如“MongoDB”以及“应用程序引擎”)都位于同一个默认网络上,现在您能告诉我为什么我我无法将我的“应用程序引擎”连接到我的“计算引擎实例”。?? 为什么 ?? (2认同)