You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
server: console user and role deletes leave the cached creation time #787
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).
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.rsdelete_user (invalidations at lines 359-379) and console/pages/role_pages.rsdelete_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
Create user u with an access key, and make one request with it so the creation time is cached.
Delete u in the console, create u again through the management API, and give it an access key.
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.
Activity
docs(security-model): describe the credential and policy caches