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] Fix downgrade logic of KubernetesResources to Role v6 #36009

Merged
merged 1 commit into from
Dec 22, 2023

Commits on Dec 22, 2023

  1. Fix downgrade logic of KubernetesResources to Role v6 (#35991)

    `KubernetesResources` were improperly downgraded when they grant access
    to all resources.
    
    In that case, the role was downgraded to something that can't be used to
    access Kubernetes clusters but they could have been downgraded to a
    `Role` v6 with the same permissions as the `KubernetesResources`.
    
    This commit fixes the downgrade logic to downgrade to a `Role` v6 with
    the same permissions as the `KubernetesResources`.
    
    A role v7 with
    
    ```json
    kubenretes_labels:
     '*': '*'
    kubernetes_resources:
    - kind: pod
      name: '*'
      namespace: '*'
      verbs:
      - '*'
    ```
    Is downgraded to a role v6 with
    
    ```json
    kubenretes_labels:
     '*': '*'
    kubernetes_resources:
    - kind: pod
      name: '*'
      namespace: '*'
    ```
    
    Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
    tigrato committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    ecadcc4 View commit details
    Browse the repository at this point in the history