minio / console

Simple UI for MinIO Object Storage :abacus:
https://min.io/docs/minio/linux/index.html
GNU Affero General Public License v3.0
853 stars 282 forks source link

Fix Set Policy on Groups with spaces #3453

Closed cesnietor closed 1 month ago

cesnietor commented 1 month ago

It was not possible to set a policy on a group with spaces:

Screenshot 2024-10-14 at 1 48 04 PM

We had a regex to validate the group name in the request but current UI doesn't allow the user to define that manually, the groups should already exists, so technically is not necessary. Right now this regex is wrong cause it doesn't allow spaces and it should. We could fix it but it but it might not allow other stuff, here we can rely on the server to return that error if something was wrong.

Screenshot 2024-10-14 at 2 53 29 PM

Test Steps:

  1. First:

    • Create a group with spaces like e.g. some group
    • Click on new group then Policies
    • Click on Assign policies
    • Assign policies and click save
    • All should work
  2. Also: Creating two groups

    • In Listing Policies
    • Select the two new groups
    • Select ASsign policies
    • Select policies to attach
    • Save (should work fine)
ramondeklein commented 1 month ago

AWS IAM names have the following restriction (source):

Names of users, groups, roles, policies, instance profiles, server certificates, and paths must be alphanumeric, including the following common characters: plus (+), equals (=), comma (,), period (.), at (@), underscore (_), and hyphen (-).

I am surprised that MinIO accepts policy names with spaces. Not sure if that should be considered a bug. Fixing this in MinIO may result in issues for existing customers if they rely on this. It looks like there is only a check if a name is specified and there are no other checks (source).

@harshavardhana ^^^ What do you think? MinIO policies ≠ IAM policies and adding restrictions may cause issues for existing customers. But accepting policy names with arbitrary characters seems undesirable.