mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
fix: permission checks for editing access keys (#18928)
With this change, only a user with `UpdateServiceAccountAdminAction` permission is able to edit access keys. We would like to let a user edit their own access keys, however the feature needs to be re-designed for better security and integration with external systems like AD/LDAP and OpenID. This change prevents privilege escalation via service accounts.
This commit is contained in:
committed by
GitHub
parent
4cd777a5e0
commit
0ae4915a93
@@ -158,8 +158,8 @@ func checkKeyValid(r *http.Request, accessKey string) (auth.Credentials, bool, A
|
||||
// Check if the access key is part of users credentials.
|
||||
u, ok := globalIAMSys.GetUser(r.Context(), accessKey)
|
||||
if !ok {
|
||||
// Credentials will be invalid but and disabled
|
||||
// return a different error in such a scenario.
|
||||
// Credentials could be valid but disabled - return a different
|
||||
// error in such a scenario.
|
||||
if u.Credentials.Status == auth.AccountOff {
|
||||
return cred, false, ErrAccessKeyDisabled
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user