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

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

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

tigrato
Copy link
Contributor

@tigrato tigrato commented Aug 1, 2024

Backport #44893 to branch/v14

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

…er resources (#44893)

* [kube] fix greedy deny rule blocking namespace list when blocking other 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.

* add extra test

* handle comments
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from bl-nero August 1, 2024 18:54
@tigrato tigrato added this pull request to the merge queue Aug 1, 2024
Merged via the queue into branch/v14 with commit b16da03 Aug 1, 2024
26 checks passed
@tigrato tigrato deleted the tigrato/fix-kube-rbac-v14 branch August 1, 2024 19:25
@camscale camscale mentioned this pull request Aug 9, 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