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 matching route metadata in the HTTP RBAC filter #34913

Open
henrymwang opened this issue Jun 25, 2024 · 1 comment
Open

Support matching route metadata in the HTTP RBAC filter #34913

henrymwang opened this issue Jun 25, 2024 · 1 comment
Labels

Comments

@henrymwang
Copy link
Contributor

Title: Support matching on route metadata in the HTTP RBAC filter

Description:

We have two types of routes which exist on the same routing table and want to be able to apply RBAC rules based on the route metadata to allow for fine-grained RBAC based on route type, https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#config-route-v3-route. Currently the RBAC filter only supports matching on dynamic metadata which is added by previous filters or based on headers and while we could rewrite route metadata to dynamic metadata by using the Lua filter, we would like to avoid coupling the two filters together.

This is similar to #13269, which adds support for deriving ratelimit descriptors in the ratelimit filter from route metadata.

The approach would be:

  1. add another field to the RBAC Principal / Permission protobufs to specify fetching the request's dynamic metadata or from the route metadata

  2. update the MetadataMatcher to use info.route()->metadata() instead if the metadata source is set to route,

    return matcher_.match(info.dynamicMetadata());

We can prepare a patch for this if it sounds reasonable.

[optional Relevant Links:]

Any extra documentation required to understand the issue.

@henrymwang henrymwang added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Jun 25, 2024
@mattklein123 mattklein123 added help wanted Needs help! area/rbac and removed enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Jun 26, 2024
@mathetake
Copy link
Member

relevant: #34092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants