通过App Engine或使用防火墙和IAP运行的CLoud连接到Compute Engine

问题描述 投票:0回答:1

我有一个运行在Google Compute Engine上的SFTP服务器。防火墙已设置为允许来自身份识别代理的流量。

我可以在本地使用gcloud ssh连接到服务,但是无法从App Engine或Cloud Run连接。 Cloud Run和App引擎的服务帐户已经具有IAP隧道和Https权限。

后端使用ssh2-sftp-client写入Node。

如何保护Compute Engine的安全,并允许来自Cloud Run和App Engine在端口22上的TCP通信仍然通过?

node.js google-app-engine google-compute-engine firewall identity-aware-proxy
1个回答
0
投票

有两种可能的解决方法:

  • [如果使用App Engine Standard,则可以尝试Serverless VPC Access

    无服务器VPC访问使您可以通过App Engine应用进行连接直接到Compute Engine VM实例,Memorystore实例,云SQL实例和任何其他资源具有内部IP地址

    [很遗憾,目前无服务器无VPC访问不适用于Cloud Run(文档Services not yet supported中有更多信息,但是Google Public Issue Tracker中有一个Feature Request,您可以加入,评论和跟踪进度。此外,App Engine Flex也无法使用这种服务。

  • 如果使用App Engine Flex或Cloud Run,请执行以下步骤:

    1. [reserve外部静态IP
    2. [create f1-micro具有保留的外部IP地址的VM实例(这很可能适合Compute Engine free tier)]
    3. [create防火墙规则,允许从保留的外部IP连接到SFTP服务器
    4. 通过运行一个ssh客户端来创建SOCKS代理,该客户端通过此example来通过创建的VM路由通信量>
    5. [configure ssh2-sftp-client使用SOCKS代理
    6. 连接到SFTP
© www.soinside.com 2019 - 2024. All rights reserved.