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

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

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

tigrato
Copy link
Contributor

@tigrato tigrato commented Aug 1, 2024

Backport #44893 to branch/v16

changelog: Prevent Kubernetes per-Resource RBAC from blocking access to namespaces when denying access to a single resource kind in every namespace.

…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.
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from bl-nero August 1, 2024 18:55
@tigrato tigrato added this pull request to the merge queue Aug 1, 2024
Merged via the queue into branch/v16 with commit bcddb6d Aug 1, 2024
38 checks passed
@tigrato tigrato deleted the bot/backport-44893-branch/v16 branch August 1, 2024 20:05
This was referenced Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants