Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IP whitelist #1447

Closed
uniduan opened this issue May 25, 2023 · 10 comments
Closed

Support IP whitelist #1447

uniduan opened this issue May 25, 2023 · 10 comments
Labels
area/api API-related issues area/policy area/translator Issues related to Gateway's translation service, e.g. translating Gateway APIs into the IR. help wanted Extra attention is needed kind/decision A record of a decision made by the community. road-to-ga
Milestone

Comments

@uniduan
Copy link

uniduan commented May 25, 2023

Description:
Does envoy gateway support IP whitelist?
How to use it?

@uniduan uniduan changed the title Does envoy gateway support whitelist? Does envoy gateway support IP whitelist? May 25, 2023
@oowl
Copy link
Contributor

oowl commented May 27, 2023

I see that the code base only supports JWT authentication for now, but luckily Envoy has an RBAC filter that can meet your needs, we need to do some development work to support this. https://www.envoyproxy.io/docs/envoy/v1.9.0/api-v2/config/rbac/v2alpha/rbac.proto#envoy-api-field-config-rbac-v2alpha-principal-source-ip
https://www.envoyproxy.io/docs/envoy/v1.9.0/api-v2/config/filter/http/rbac/v2/rbac.proto#config-filter-http-rbac-v2-rbacperroute

@oowl
Copy link
Contributor

oowl commented May 27, 2023

If possible, I can try to support this. What do you think? @arkodg

@arkodg
Copy link
Contributor

arkodg commented May 29, 2023

thanks for raising this issue, here's how I think we should approach this feature.

  • Long Term - Add Support to Upstream Gateway API. There already seems to be an open issue
    Enhancement: add HTTPRoute IP ACL's kubernetes-sigs/gateway-api#1141 . Since upstream API consensus takes a while, this might not be available for use any time soon.
  • Mid Term - Similar to JWT Authentication Filter, EG can create another Extension API called IPBlockList, but this will result in many CRDs, one for each feature, which is hard to mantain in this repo. @kflynn & @AliceProxy have been looking into building higher level nouns (e.g. NetworkingFilter , GatewayPolicy, RoutePolicy) so we can build one high level CRD, and add these features as top level fields within them.
  • Short Term - As a workaround, you should be able to directly edit/patch xDS Filters using Allow users to configure xDS resources #24 / feat: EnvoyPatchPolicy API #1410 which should be part of v0.5.0 that will be released in July 2023

@uniduan uniduan closed this as completed May 31, 2023
@uniduan
Copy link
Author

uniduan commented May 31, 2023

Thanks for your help. I'll try the RBAC filter.

@arkodg arkodg reopened this Oct 4, 2023
@arkodg
Copy link
Contributor

arkodg commented Oct 4, 2023

reopening this issue, and adding the help-wanted label in case someone from the community wants to take this forward

We now have an API to be able to hold this feature - ClientTrafficPolicy which is a good home for this feature

Temporary solution: we've added support for EnvoyPatchPolicy https://gateway.envoyproxy.io/latest/user/envoy-patch-policy.html which can be used to directly configure the RBAC Filter
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/rbac/v3/rbac.proto#envoy-v3-api-msg-config-rbac-v3-rbac

@arkodg arkodg added this to the Backlog milestone Oct 4, 2023
@arkodg arkodg added help wanted Extra attention is needed area/api API-related issues area/translator Issues related to Gateway's translation service, e.g. translating Gateway APIs into the IR. area/policy labels Oct 4, 2023
@Xunzhuo Xunzhuo modified the milestones: Backlog, v1.0.0-rc1 Dec 7, 2023
@Xunzhuo Xunzhuo changed the title Does envoy gateway support IP whitelist? support IP whitelist Dec 7, 2023
@Xunzhuo Xunzhuo moved this from Todo to Backlog in Envoy Gateway: The Road to GA Dec 7, 2023
@Xunzhuo Xunzhuo changed the title support IP whitelist Support IP whitelist Dec 7, 2023
@Xunzhuo
Copy link
Member

Xunzhuo commented Dec 7, 2023

Should be better to add into SecurityPolicy ? @envoyproxy/gateway-maintainers

@arkodg arkodg added the kind/decision A record of a decision made by the community. label Dec 18, 2023
@arkodg
Copy link
Contributor

arkodg commented Dec 18, 2023

a decision needs to be made here on whether ip blocking is part of SecurityPolicy or ClientTrafficPolicy . This boils down to use cases -

  • if ip blocking is handled primarily by network admin / platform admin, it should be included in ClientTrafficPolicy
  • if ip blocking is defined by app devs, it should be made part of SecurityPolicy

I vote to make it part of ClientTrafficPolicy because Ive seen network/infra admins perform this op. App Devs can always use rate limiting to limit requests from a specific subset of IPs to a small value or 0 for their business use case

@zzjin
Copy link
Contributor

zzjin commented Dec 19, 2023

May GEP-713 can solve this problem?

eg:

  • app devs can define ip whitelist/blacklist policy and attach it to *route
  • sysadm can also define these policy and attach to gateway(and/or sub route), and even drop app devs policy.

@arkodg
Copy link
Contributor

arkodg commented Dec 19, 2023

@zzjin SecurityPolicy & ClientTrafficPolicy are implementations of https://gateway-api.sigs.k8s.io/geps/gep-713/

@arkodg
Copy link
Contributor

arkodg commented Jan 31, 2024

dup of #2462

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api API-related issues area/policy area/translator Issues related to Gateway's translation service, e.g. translating Gateway APIs into the IR. help wanted Extra attention is needed kind/decision A record of a decision made by the community. road-to-ga
Projects
No open projects
Development

No branches or pull requests

5 participants