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

[kube] fix greedy deny rule blocking namespace list when blocking other resources #44893

Merged
merged 3 commits into from
Aug 1, 2024

Commits on Aug 1, 2024

  1. [kube] fix greedy deny rule blocking namespace list when blocking oth…

    …er resources
    
    This PR fixes an edge case where the deny rule for blocking access to a resource becomes greedy and blocks access to the whole namespace.
    
    eg:
    
    ```
      allow:
        kubernetes_labels:
          '*': '*'
        kubernetes_resources:
        - kind: '*'
          name: '*'
          namespace: '*'
          verbs:
          - '*'
      deny:
        kubernetes_resources:
        - kind: secret
          name: '*'
          namespace: '*'
          verbs:
          - '*'
    
    ```
    
    With the example above, access to secrets must be blocked but the user is allowed to access every other resource in any namespace.
    The previous model was greedy and blocked access to namespace list.
    tigrato committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    37fadae View commit details
    Browse the repository at this point in the history
  2. add extra test

    tigrato committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    efcae62 View commit details
    Browse the repository at this point in the history
  3. handle comments

    tigrato committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    324d775 View commit details
    Browse the repository at this point in the history