server: console user and role deletes leave the cached creation time

Aperta Adatta ai principianti
#787 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

@LeeroyHannigan ci sta già lavorando.

Dal 5/11/2026.

  • #846 di @LeeroyHannigan — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Inizia da delete_user in crates/server/src/console/pages/user_pages.rs (invalidazioni intorno alle righe 359-379) e da delete_role in crates/server/src/console/pages/role_pages.rs (righe 316-337). Confrontali con gli handler di gestione in management/iam_user.rs:212 e management/iam_role.rs:174, che chiamano invalidate_user_created_at e invalidate_role_created_at. Gli handler della console dovrebbero effettuare le stesse chiamate. È completato quando un principal ricreato con lo stesso nome entro il TTL riceve un nuovo aws:userid, verifica che un test sul percorso di eliminazione della console può controllare.

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

Descrizione

bug

The console's Delete user and Delete role handlers drop the deleted principal's cached credentials, policies, boundary and tags, but not its cached creation time. The management API handlers drop that too. A user or role that is deleted and then created again with the same name can therefore be evaluated with the old principal's creation time for up to auth.cache.ttl_seconds (60 s by default).

Mechanism

The creation time is an input to the principal's aws:userid (crates/auth/src/policy/principal_id.rs) and is read through the user_created_at and role_created_at caches (crates/server/src/authorization.rs:104, :206).

On main (2287d176):

  • management/iam_user.rs:212 calls invalidate_user_created_at, and management/iam_role.rs:174 calls invalidate_role_created_at, after the delete.
  • console/pages/user_pages.rs delete_user (invalidations at lines 359-379) and console/pages/role_pages.rs delete_role (lines 316-337) call every other invalidation but not these two.

So after a console delete, a same-name principal created within the TTL gets the deleted principal's aws:userid, and a policy condition on aws:userid written for the old principal matches the new one until the entry expires.

Reproduction

  1. Create user u with an access key, and make one request with it so the creation time is cached.
  2. Delete u in the console, create u again through the management API, and give it an access key.
  3. Within 60 s, make a request that is decided by an aws:userid condition. It is evaluated with the old user's id. After the TTL, or with the delete done through the management API, it uses the new id.

Expected

The console delete handlers drop the creation-time entry, as the management handlers do.

Found while writing #786.

Lingua principale
Rust
Stelle
517
Fork
60
Merge medio
5g 1h
PR unite (30g)
67

Preparare l'ambiente

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 ExtendDB/extenddb

Tutte le issue di ExtendDB/extenddb

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.