I want to prevent unsafe requested to reach my application running in GCP GKE with Google Ingress (not nginx) and trying to do this using path rules. I know nginx Ingress can configure paths using regex but I don know the best way to do with Google Ingress. Right now I am just duplicating the same rules change the path prefix like this:
spec:
rules:
- http:
paths:
- backend:
service:
name: my-api-service
port:
number: 80
path: /api
pathType: Prefix
- backend:
service:
name: my-api-service
port:
number: 80
path: /auth
pathType: Prefix
- backend:
service:
name: my-api-service
port:
number: 80
path: /admin
pathType: Prefix
Is there a better way to do this?