【发布时间】:2019-03-13 15:18:49
【问题描述】:
我们正在尝试基于此 Cloud Armor walk through 阻止除少数外部 IP 地址之外的所有非集群流量。
GKE 集群可识别规则,但仍会阻止允许的 IP。以下是遵循的步骤:
1) 创建策略+规则
gcloud beta compute security-policies create allow-team-only \
--description "Cloud Armor deny non-team IPs"
gcloud beta compute security-policies rules create 1000 \
--security-policy allow-team-only \
--description "Deny traffic from 0.0.0.0/0." \
--src-ip-ranges "0.0.0.0/0" \
--action "deny-404"
gcloud beta compute security-policies rules create 999 \
--security-policy allow-team-only \
--description "Allow traffic from <IP ADDRESS>." \
--src-ip-ranges "<IP ADDRESS>/32" \
--action "allow"
2) 将规则应用于我们的服务,这些服务位于端口 8080
metadata:
annotations:
beta.cloud.google.com/backend-config: '{"ports": {"8080":"allow-team-only"}}'
我忽略了什么?
谢谢!
【问题讨论】:
标签: google-cloud-platform google-kubernetes-engine google-cloud-networking google-cloud-armor