Cloud Armor 与 GKE 一起限制对 Ingress 的访问

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

我们正在与 GKE 一起实施 Cloud Armor 策略,以限制对 Ingress 的访问,并仅允许 Armor 策略中列入白名单的 IP 范围。 步骤如下:

  1. 创建了云装甲策略以将某些范围列入白名单并拒绝 所有其他的。
  2. 创建带有安全策略的 BackendConfig 参考装甲政策。
  3. 添加 backendconfig 作为 k8s 的注释 服务。

向节点服务帐户和 Kubernetes Engine 服务代理添加了

Security admin

感谢任何帮助,TIA!

Error syncing to GCP: error running backend syncing routine: failed to set security policy from "" to "armor-policy-name" for backend service backend-service-name (namespace/serverice-name:&ServiceBackendPort{Name:,Number:80,}): googleapi: Error 400: Invalid value for field 'resource': '{ "securityPolicy": "https://www.googleapis.com/compute/v1/projects/gcp_project_name/global/s...'. deny action is only supported for TCP and SSL load balancers., invalid

google-cloud-platform google-kubernetes-engine google-cloud-armor
1个回答
0
投票

问题是您只能将

deny
操作与 TCP 或 SSL 负载均衡器结合使用。由于您要将策略附加到 Ingress,因此您需要使用
deny-403
deny-404
deny-502
作为规则中的操作。

https://cloud.google.com/sdk/gcloud/reference/compute/security-policies/rules/create#--action

© www.soinside.com 2019 - 2024. All rights reserved.