【问题标题】:How to restrict compute engine to accept requests only from app engine如何限制计算引擎仅接受来自应用引擎的请求
【发布时间】:2017-06-14 07:43:15
【问题描述】:

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

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

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

我在防火墙部分阅读了有关使用标签的信息,在这里我可以将应用引擎实例定义为源标签,并将计算引擎标签定义为目标标签,这样我的目标标签就只能监听源标签

请帮帮我,我正在寻找很长一段时间但没有找到任何有用的东西。

更新

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

下面我在 firewall rule 中为我的 MongoDB 数据库坐在上面的源标记 app-tag

【问题讨论】:

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


    【解决方案1】:

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

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

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

    【讨论】:

    • 还有by meaning same network i want only my instances on that same network 但我如何限制网络只包含我的实例?因为当您创建自己的网络时,它现在询问range of ips,如果您设置类似e.g 10.128.0.0/9 现在这个network 将接受region us-central-1 上的每个连接,但我只希望我的网络中的实例不是全部设置在谷歌云上的一个区域上定义的 ips ??
    • 当你创建一个网络时,你实际上是在创建一个私有网络。只有此网络中的实例才能相互访问。您可以在数据库服务器中使用防火墙来仅接受来自特定地址范围的流量。
    • 关于您更新的问题:从文档看来,只有当您对数据库和应用引擎实例使用相同的网络时,才会应用源标签。
    • 我只有一个网络 default network(auto-created by google),现在我的所有实例,例如 MongoDB 以及我的 app engine 都在同一个默认网络上,现在你能告诉我为什么我是无法将我的app engine 连接到我的compute engine instances。 ??为什么??
    • 我也遇到了同样的问题。我在使用网络标签部署的 App Engine Flexible (Python) 中有一项服务。我希望 Compute Engine 中的节点接收来自该服务的流量,但防火墙规则不起作用。
    猜你喜欢
    • 2012-05-07
    • 2018-11-15
    • 2016-03-02
    • 2021-07-27
    • 1970-01-01
    • 2012-01-17
    • 2015-09-18
    • 2023-04-09
    相关资源
    最近更新 更多