cozystack preset: OIDC groups mapped without prefix allow the IdP to grant system:masters

Aperta
#267 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, helm, kubernetes

Direzione di ricerca

Read the cozystack preset’s Talos v1.14+ authentication renderer and its legacy OIDC renderer; the issue does not name their file paths. Start by tracing how each renderer maps the groups claim, then check the existing tests for both contract versions. Done means reserved system groups cannot be granted through the v1.14+ mapping, with coverage for that behavior; legacy handling remains an open design choice.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The cozystack preset passes the OIDC groups claim to Kubernetes as is:

  • Talos v1.14+: KubeAuthenticationConfig with claimMappings.groups: {claim: groups, prefix: ""}
  • older contracts: oidc-groups-claim: groups without oidc-groups-prefix

Thus any token from the issuer with system:masters in groups is cluster-admin, same for system:nodes and other reserved groups. Anyone who can create or assign groups in the IdP, or has the IdP signing key, gets the cluster. I think IdP admin should not be cluster admin automatically.

Adding a prefix would break Cozystack tenant RBAC, it binds unprefixed group names. For the v1.14+ renderer we can just drop reserved groups with CEL:

claimMappings:
  groups:
    expression: "has(claims.groups) ? claims.groups.filter(g, !g.startsWith('system:')) : []"

The legacy renderer has no CEL, there we can document it or add opt-in oidcGroupsPrefix value.

I can send a PR for the v1.14+ part.

Lingua principale
Go
Stelle
493
Fork
23
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cozystack/talm

Tutte le issue di cozystack/talm

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.