【问题标题】:Is it possible to connect Google App engine Flexi with Cloud Nat是否可以将 Google App Engine Flexi 与 Cloud Nat 连接起来
【发布时间】:2019-11-07 10:13:32
【问题描述】:

由于 GAE 不提供静态 IP,是否有任何方法可以连接 Cloud NAT 以用于来自 Google App Engine 的所有出口连接。

将平台从 GAE 切换到 Compute Engine 或在 Compute Engine 中运行代理不在范围内。

【问题讨论】:

  • Cloud NAT 适用于在 VPC 中运行的系统。 App Engine 不在 VPC 中运行。因此,如果您想将 Cloud NAT 与 App Engine 一起使用(具有用于传出请求的公共 IP 地址),您将需要在 VPC 中启动 GCE 实例,设置 Cloud NAT,然后通过该 GCE 实例隧道传输您的 App Engine 流量.使用该设置,如果您为 GCE 实例分配公共 IP 地址,则不需要 NAT。设置 SSH 或 HTTP 隧道很容易,并且有许多库可以做到这一点。谷歌搜索。
  • @JohnHanley 感谢您的回答,但我已经在我的问题中提到了您所说的建议。我正在寻找其他一些调整。

标签: google-app-engine google-cloud-platform reverse-proxy nat


【解决方案1】:

Cloud NAT (network address translation) 主要设计用于 没有外部 IP 地址的 Google Cloud Platform (GCP) 虚拟机 (VM) 实例私有 Google Kubernetes Engine (GKE ) 集群连接到互联网


您说得对,App Engine 目前不提供将静态 IP 地址映射到应用程序的方法。相反,Google App Engine 将您的服务托管在 Google 负载平衡器的动态公共 IP 地址上。

如果您尝试在您的 Google App Engine 柔性环境中使用 Cloud NAT。我建议您按照 Stackoverflow thread 中的建议设置一个 Google Compute Engine VM 以用作您的 Google App Engine 应用程序的代理


正如 Official Documentation 所建议的,请注意,使用静态 IP 地址过滤并不是一种安全有效的保护手段。例如,攻击者可以设置恶意 App Engine 应用程序,该应用程序可以与您的应用程序共享相同的 IP 地址范围。相反,我们建议您使用 OAuth 和 Certs 采取深度防御方法。

【讨论】:

  • 感谢您的回答,但我已经在我的问题中提到了您所说的建议。我正在寻找其他一些调整
  • 嗨@Tibin,我的回答基于文档,因为我不知道任何其他替代方法。
猜你喜欢
  • 1970-01-01
  • 2016-09-05
  • 1970-01-01
  • 1970-01-01
  • 2016-11-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-09
相关资源
最近更新 更多