-
Notifications
You must be signed in to change notification settings - Fork 5.5k
rbac: add unified matcher for RBAC filters #20877
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
Changes from 34 commits
bf2ab82
c848b96
ff1b72b
9135a9a
cf89fa7
d7a6269
96f4025
b65820e
979d2b6
338a1b9
cbc0b85
4e4d30c
0278ee2
4ac347e
d29b90e
ed02a8e
a404d4d
b1a8b94
f421ebe
c338e22
82b5f0f
029b64c
a537d0d
d6e0e49
1d7996a
57b55b7
a736dde
599a7b1
45f9054
2883dda
73fd6b5
9101f17
cdf18a4
85b4a32
8542e73
8e21851
4fc0b41
37a5f03
2a6a087
cc882e0
df2698e
acb054d
c01ce6d
73129a4
fc86357
c29042d
c6f805b
3928e84
0c6be24
8f93967
27fcb1e
434aab9
d22591f
af13fbf
0fcb32a
8810f89
9d7ec37
de7afaf
0e2cda6
a9b189a
fb613e9
2470731
d02f5ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,10 @@ package envoy.extensions.filters.http.rbac.v3; | |
|
|
||
| import "envoy/config/rbac/v3/rbac.proto"; | ||
|
|
||
| import "xds/annotations/v3/status.proto"; | ||
| import "xds/type/matcher/v3/matcher.proto"; | ||
|
|
||
| import "udpa/annotations/migrate.proto"; | ||
| import "udpa/annotations/status.proto"; | ||
| import "udpa/annotations/versioning.proto"; | ||
|
|
||
|
|
@@ -18,19 +22,41 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; | |
| // [#extension: envoy.filters.http.rbac] | ||
|
|
||
| // RBAC filter config. | ||
| // [#next-free-field: 6] | ||
| message RBAC { | ||
| option (udpa.annotations.versioning).previous_message_type = | ||
| "envoy.config.filter.http.rbac.v2.RBAC"; | ||
|
|
||
| // Specify the RBAC rules to be applied globally. | ||
| // If absent, no enforcing RBAC policy will be applied. | ||
| // If present and empty, DENY. | ||
| config.rbac.v3.RBAC rules = 1; | ||
| config.rbac.v3.RBAC rules = 1 | ||
| [(udpa.annotations.field_migrate).oneof_promotion = "rules_specifier"]; | ||
|
|
||
| // The match tree to use when resolving RBAC action for incoming requests. Requests do not | ||
| // match any matcher will be denied. | ||
| // If absent, no enforcing RBAC matcher will be applied. | ||
| // If present and empty, deny all requests. | ||
| // If both rules and matcher are configured, the matcher will be ignored. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should do this the opposite way, where matcher takes precedence over old-style rules? That will provide a safe way to transition to the new field: control planes can populate both fields, and old clients will continue to use the old rules field, but newer clients will use the new matcher field.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The matching API is still unstable. In the previous work, we have added matcher for filter chain, and it is also a secondary option which is an inferior of filter chain match.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand that it's not yet stable, but it's still up to the control plane as to whether or not it wants to use this unstable feature. If it doesn't want to do that, it can just not populate this field.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I will change the behavior. |
||
| xds.type.matcher.v3.Matcher matcher = 4 [ | ||
| (udpa.annotations.field_migrate).oneof_promotion = "rules_specifier", | ||
| (xds.annotations.v3.field_status).work_in_progress = true | ||
| ]; | ||
|
|
||
| // Shadow rules are not enforced by the filter (i.e., returning a 403) | ||
| // but will emit stats and logs and can be used for rule testing. | ||
| // If absent, no shadow RBAC policy will be applied. | ||
| config.rbac.v3.RBAC shadow_rules = 2; | ||
| config.rbac.v3.RBAC shadow_rules = 2 | ||
| [(udpa.annotations.field_migrate).oneof_promotion = "shadow_rules_specifier"]; | ||
|
|
||
| // The match tree to use for emitting stats and logs which can be used for rule testing for | ||
| // incoming requests. | ||
| // If absent, no shadow matcher will be applied. | ||
| // If both shadow rules and shadow matcher are configured, the shadow matcher will be ignored. | ||
| xds.type.matcher.v3.Matcher shadow_matcher = 5 [ | ||
|
kyessenov marked this conversation as resolved.
|
||
| (udpa.annotations.field_migrate).oneof_promotion = "shadow_rules_specifier", | ||
| (xds.annotations.v3.field_status).work_in_progress = true | ||
| ]; | ||
|
|
||
| // If specified, shadow rules will emit stats with the given prefix. | ||
| // This is useful to distinguish the stat when there are more than 1 RBAC filter configured with | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.