Skip to content

[v13] Prevent remote proxies from impersonating users from different clusters#33540

Merged
tigrato merged 2 commits intobranch/v13from
bot/backport-33536-branch/v13
Oct 16, 2023
Merged

[v13] Prevent remote proxies from impersonating users from different clusters#33540
tigrato merged 2 commits intobranch/v13from
bot/backport-33536-branch/v13

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Oct 16, 2023

Backport #33536 to branch/v13

This PR prevents root proxies from impersonating users from different clusters when accessing a leaf cluster.

During authentication, the proxy presents its certificate and sends the impersonation header.

A malicious attacker in possession of the root cluster proxy cert-key pair could bypass the root-leaf cluster permissions boundary by impersonating local users. This PR prevents that and remote proxies can only impersonate users belonging to their cluster.

KubeCSR Flow:
```mermaid
sequenceDiagram
    ROOT PROXY->>+LEAF PROXY: Forward the request identity cert
    LEAF PROXY ->> LEAF AUTH SRV: Sign identity via KubeCSR
    LEAF AUTH SRV -->> LEAF PROXY: Identity cert
    LEAF PROXY ->> LEAF KUBE SERVICE: Forward the request using cert
    LEAF KUBE SERVICE -->> LEAF PROXY: Return response
    LEAF PROXY -->> ROOT PROXY: Return response
```

Impersonation Flow:
```mermaid
sequenceDiagram
    ROOT PROXY->>+LEAF PROXY: Forward the request identity by Impersonating
    LEAF PROXY ->> LEAF KUBE SERVICE: Forward the request identity by Impersonating
    LEAF KUBE SERVICE -->> LEAF PROXY: Return response
    LEAF PROXY -->> ROOT PROXY: Return response
```

Fixes gravitational/teleport-private#968
Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
@tigrato tigrato added this pull request to the merge queue Oct 16, 2023
Merged via the queue into branch/v13 with commit e266e3b Oct 16, 2023
@tigrato tigrato deleted the bot/backport-33536-branch/v13 branch October 16, 2023 19:57
@camscale camscale mentioned this pull request Oct 18, 2023
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