小编Bur*_*glu的帖子

如何在 nginx 入口控制器上使用云装甲?

首先,我使用带有 gke 舵的 Nginx 入口控制器,并使用 ModSecurity 作为 waf。尽管如此,我正在研究一种新型的waf来显示预防的结果,云甲看起来就是我正在寻找的东西。不幸的是,它仅适用于 HTTP/HTTPS 负载均衡器,但我的 Nginx 入口外部负载均衡器是 TCP 负载均衡器。据我研究,我无法将此负载均衡器的协议 TCP 转换为 HTTP/HTTPS。

- First Question, Is this conversation possible and if it is possible, Can I use cloud armor on it.
Run Code Online (Sandbox Code Playgroud)

其次,我尝试创建一个新的云负载均衡器来通过它路由流量。不幸的是,即使我可以在其上激活云装甲,路由也无法按​​我的预期工作,因为它无论如何都会返回 502,即使它的运行状况检查看起来还不错。

最后,我尝试将 BackendConfig 与 yaml 一起使用:

apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
  name: armor-backendconfig
spec:
  securityPolicy:
    name: "bla-armor"
Run Code Online (Sandbox Code Playgroud)
apiVersion: v1
kind: Service
metadata:
  annotations:
    cloud.google.com/backend-config: '{"ports": {"443":"bla-backendconfig"}}'
spec:
  clusterIP: xx.xx.xx.xx
  externalTrafficPolicy: Local
  healthCheckNodePort: xxxxxxx
  loadBalancerIP: xx.xx.xxxx.xx
  ports:
   - name: http
     nodePort: 31000
     port: 80 …
Run Code Online (Sandbox Code Playgroud)

load-balancing gcloud kubernetes nginx-ingress google-cloud-armor

6
推荐指数
1
解决办法
2670
查看次数