google-cloud-platform - Google Cloud VPC 配置:隔离后端服务器的防火墙规则
问题描述
这是我的设置以及我要完成的工作-
我有一个前端服务器 [FE],后端服务器 [BE]。我正在尝试设置自己的 VPC。FE和BE在同一个Region的不同Zone。FE 有自己的服务账号——fe-sa,BE 有自己的服务账号——be-sa。
通过阅读文档,我了解我们可以根据服务帐户设置防火墙规则,以允许/拒绝访问一组实例。
我试过切换目标和过滤器,但没有帮助。我尝试用 FE 服务器 IP 替换过滤器 - 这似乎有效(但我知道这不是正确的方法)我也尝试删除所有内容并尝试重新尝试
Name Type Target Filters Protocol Action Priority
fe-to-be Ingress be-sa fe-sa icmp ALLOW 999
where,
be-sa - is the Service account associated with Back end.
fe-sa - is the service account associated with Front end.
Below are complete list of other Firewall Rules, which work as expected:
Name Type Target Filters Protocol Action Priority
be-disable-internet egress be-sa 0.0.0.0/0 icmp DENY 1000
fe-enable-internet egress fe-sa 0.0.0.0/0 icmp ALLOW 1000
allow-ssh-for-all ingress open-ssh-tag 0.0.0.0/0 tcp 22 ALLOW 1000
fe-incoming ingress fe-sa 0.0.0.0/0 icmp ALLOW 1000
然而,这似乎阻止了所有来自任何来源(内部和外部 IP)的对 BE 的传入请求。
我希望来自 FE -> BE 的成功 ping 以及来自本地笔记本电脑的 ping -> 被阻止。
目前使用上述规则,我看到 FE -> BE 和笔记本电脑 -> BE 都被阻止。
解决方案
推荐阅读
- ajax - wp_send_json* functions do a weird float values conversion
- java - 多个 JComboBox 侦听器
- python - Getting the name of a class which has a meta class
- sql - How to retrieve all user tables, corresponding columns and data types in SQL Server?
- html - 从 HTML 片段中删除任何视频
- javascript - My modal is not appearing, having difficulty targeting a button within a table using selectors
- python - 根据条件退出 Jupyter Notebook .ipynb 单元
- fluentd - 在 GKE 中实现默认的堆栈驱动程序行为
- rxjs - Creating an Observable that gets its value from a subscriptions calculation
- php - 辅助类中的列排序方法在一个表上工作,但在同一个应用程序中不是另一个表