mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Restrict access keys for users and groups to not allow '=' or ',' (#19749)
* initial commit * Add UTF check --------- Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
@@ -1273,6 +1273,10 @@ func (sys *IAMSys) CreateUser(ctx context.Context, accessKey string, ureq madmin
|
||||
return updatedAt, auth.ErrInvalidAccessKeyLength
|
||||
}
|
||||
|
||||
if auth.ContainsReservedChars(accessKey) {
|
||||
return updatedAt, auth.ErrContainsReservedChars
|
||||
}
|
||||
|
||||
if !auth.IsSecretKeyValid(ureq.SecretKey) {
|
||||
return updatedAt, auth.ErrInvalidSecretKeyLength
|
||||
}
|
||||
@@ -1766,6 +1770,10 @@ func (sys *IAMSys) AddUsersToGroup(ctx context.Context, group string, members []
|
||||
return updatedAt, errServerNotInitialized
|
||||
}
|
||||
|
||||
if auth.ContainsReservedChars(group) {
|
||||
return updatedAt, errGroupNameContainsReservedChars
|
||||
}
|
||||
|
||||
updatedAt, err = sys.store.AddUsersToGroup(ctx, group, members)
|
||||
if err != nil {
|
||||
return updatedAt, err
|
||||
|
||||
Reference in New Issue
Block a user