-
Notifications
You must be signed in to change notification settings - Fork 360
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
api: Authorization API design #2652
Conversation
cc7f8d0
to
8de09c5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2652 +/- ##
==========================================
+ Coverage 66.51% 67.12% +0.61%
==========================================
Files 161 164 +3
Lines 22673 23803 +1130
==========================================
+ Hits 15080 15978 +898
- Misses 6720 6906 +186
- Partials 873 919 +46 ☔ View full report in Codecov by Sentry. |
8de09c5
to
6416777
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should another type of client identity be considered in this PR?
For example, EG likely needs to support fine-grained access control based on JWT claims, or peer identity extracted from client certificate attributes.
Under the hood, all types of client identities(IP, JWT, peer identity) will be backed by the envoy RBAC filter. There are a few other implementations that can be referenced:
- Ambassdar: similar to this PR, but I think Ambassdar doesn't support other type of credentials. https://www.getambassador.io/docs/edge-stack/latest/topics/running/ambassador#ip-allow-and-deny
- Istio: a fat authorization policy including all types of client identities https://istio.io/latest/docs/reference/config/security/authorization-policy/#Source
@envoyproxy/gateway-maintainers
@zhaohuabing yep, I was thinking to take that issue as next. However, in http filter level ACL is going to be handled before JWT filter. So there must be 2 different RBAC filters because of that? Otherwise it is not possible to make RBAC filter based on JWT (or other auth) results. At least I do not like the way that ACL is also handled after authentication etc. That will expose all auth providers to everyone and they can try to hack things before their request is finally denied by ACL filter. So my idea was to do two separated filters: btw I am not familiar with envoyproxy itself, so if my idea about filter chains are incorrect please enlight me. |
@envoyproxy/gateway-maintainers before implementing anything, could others give opinion also about the format in #2652 (comment) (usecases explained in previous post) |
c2b9033
to
8114eec
Compare
@arkodg @zhaohuabing updated the PR according the ideas.. but still not sure is everything like should. |
470aa26
to
00c8793
Compare
@arkodg I did some tests with the api spec. The authorization commit can be seen in zetaab@65885b5
Then cases that I tested with this (ips are modified little bit, not real ips for me): case 1:
result: both cidrs are allowed and other traffic outside of these are denied. case 2:
result: both cidrs are allowed and other traffic outside of these are denied. case 3:
result: none of the CIDRs are working. (difference to case 2 is that instead of having two objects of clientCIDR under same clientselector, this use separated clientselectors. Which is creating two RBAC filters (instead of one that was the case with 1 and 2) in envoy level with the example commit). case 4:
result: both cidrs are allowed and the specific ip is denied. Requests from that single ip is logged. as we can see multiple allow rules (multiple envoy rbac filters, instead of single) might be interesting (case 3), not sure is there really use-case for that. Maybe there is if we combine other components like user information. In case of IPs it might be not that useful. |
b614aaf
to
271577d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Co-authored-by: Arko Dasgupta <arkodg@users.noreply.github.com> Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @zhaohuabing & @zetaab for building this out !
// Permissions contains allowed HTTP methods. | ||
// If empty, all methods are matching. | ||
// | ||
// +optional | ||
// Permissions []string `json:"permissions,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this pass limiter, prefer to remove instead of commnet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, can you clean the comment code in following PR?
What type of PR is this?
api: Authorization API design
The below snippet is what an authorization config looks like, the first iteration only supports
ClientCIDR
as thePrincipal
. JWT Claims, custom headers, and client certs will be supported in the future.Related: #2462 #2250