Skip to content

Instantly share code, notes, and snippets.

@arsalanses
Last active November 6, 2024 11:45
Show Gist options
  • Save arsalanses/c58a8d2efc293f2265f378201a65dde2 to your computer and use it in GitHub Desktop.
Save arsalanses/c58a8d2efc293f2265f378201a65dde2 to your computer and use it in GitHub Desktop.
minio policy example
# create bucket
mc mb ALIAS/BUCKETNAME

# create user
mc admin user add ALIAS USERNAME SECRET-KEY
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
            "s3:ListBucket",
            "s3:PutObject",
            "s3:GetObject",
            "s3:DeleteObject"
        ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::BUCKETNAME/*",
        "arn:aws:s3:::BUCKETNAME"
      ],
      "Sid": "BucketAccessForUser"
    }
  ]
}

#TODO: check this action

  • ListBucketMultipartUploads
# create policy
mc admin policy create ALIAS POLICYNAME /tmp/POLICYNAME.json

# attach policy
mc admin policy attach ALIAS POLICYNAME --user USERNAME
mc admin policy attach ALIAS POLICYNAME --group GROUPNAME

# verify
mc admin user info ALIAS USERNAME
mc admin group info ALIAS GROUPNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment