Description
What would you like to be added:
An option for defining a list of IP ranges that should be allowed/denied to call a certain HTTPRoute
Why this is needed:
When using the Gateway API for http requests it is possible to create a single http handler for all http traffic, which is delegated to the various backends.
In some instances it might be necessary to add additional ACL's in order to control which source IP's are allowed to call those endpoints.
I might have a route for https://gw.company.tld/public that should be accesible for all but https://gw.company.tld/internal that I want to restrict to IP ranges owned by my employer.
In ingress controllers that can typically be configured by adding an annotiation on the Ingress object eg:
nginx.ingress.kubernetes.io/whitelist-source-range: 10.0.0.0/24,172.10.0.1
There are several problems with this approach that I think can be solved better in Gateway API
- the annotation name is not standardized - so the whitelist is not portable accross ingress implementations
- the behaviour is not standardized - some implementations only have an allow/whitelist whereas others have both an allowlist and a denylist
- enummerating multiple IPs or ranges in a single annotation becomes harder to read as the list grows
Ref:
https://haproxy-ingress.github.io/docs/configuration/keys/#allowlist
https://www.haproxy.com/documentation/kubernetes/latest/configuration/ingress/#whitelist
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#whitelist-source-range