Skip to content

Support destination port range in config.rbac.Permission #16039

Closed

Description

@lexh

I am using config.rbac.Permission to configure RBAC for a dynamic forward proxy.

My proxy configuration needs to support allowing large port ranges.

Today, I can achieved this by combining thousands of Permission.destination_port rules using Permission.Set.or_rules,
similar to this (modified) snippet from the config.rbac.RBAC docs.

  "product-viewer":
    permissions:
        - and_rules:
            rules:
              - header: { name: ":method", exact_match: "GET" }
              - url_path:
                  path: { prefix: "/products" }
              - or_rules:
                  rules:
                    - destination_port: 1000
                    - destination_port: 1001
                    # .
                    # ... a lot of lines
                    # .
                    - destination_port: 1999

This is functional but cumbersome.

It would be more ergonomic if Permission had a destination port range field, similar to what exists in config.listener.ListenerFilterChainMatchPredicate.

Activity

  1. added
    enhancement
    triage
    on Apr 16, 2021
  2. added
    help wanted
    and removed
    triage
    on Apr 18, 2021
  3. yangminzhu commented on Apr 20, 2021

    @yangminzhu
    Contributor

    +1 to this. This not only makes the config simpler but also has the potential to greatly improve the performance by using some highly efficient data structure and algorithm for the matching.

    In the future we probably could/should expand this design to other fields like path/header/IP where we know some people puts hundreds and thousands values in these fields.

  4. zhxie commented on Jul 14, 2021

    @zhxie
    Contributor

    I think it is reasonable, since rules are too complicated to write currently. I will try to improve it.

  5. added a commit that references this issue on Aug 1, 2021
    0d2418e
  6. added a commit that references this issue on Sep 30, 2021
    08842ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/rbacenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions