To see if the service works, you can connect to the admin interface
through <https://localhost:9090> (TODO: use real IP/hostname
here?) with a normal web browser. The username is `admin` and the
password is in `/etc/default/minio` on the server (currently
`minio-01`).
through <http://localhost:9090> (TODO: use real IP/hostname
here?) with a normal web browser.
The username is `admin` and the password is in `/etc/default/minio` on
the server (currently `minio-01`). You should use that account only to
create or manage other, normal user accounts with lesser access
policies. See [authentication](#authentication) for details.
## Configuring the local mc client
You *must* use the web interface (above) to create a first access
key.
key for the admin user.
This was done through the web interface, and then the access key was
recorded on the UNIX `root` account with:
@@ -37,6 +40,74 @@ Notice how we currently use container images to run the `mc` tool. The
above configuration will make further commands possible, see for
example [creating a bucket](#creating-a-bucket).
## Creating a user
To create a new user, you can use the `mc` client configured
above. Here, for example, we create a `gitlab` user:
podman run -v /root/.mc:/root/.mc --rm -it quay.io/minio/mc admin user add admin/gitlab
By default, a user has no privileges. You can grant it access by
attaching a policy, see below.
## Defining and grand an access policy
The [default policies](https://min.io/docs/minio/container/administration/identity-access-management/policy-based-access-control.html#built-in-policies) are quite broad and give access to *all*
buckets on the server, which is almost as the admin user except for
the [admin:* namespace](https://min.io/docs/minio/container/administration/identity-access-management/policy-based-access-control.html#policy-action.admin). So we need to make a bucket policy. First
create a file with this JSON content:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:*"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::gitlab/*", "arn:aws:s3:::gitlab"
],
"Sid": "BucketAccessForUser"
}
]
}
This was inspired by [Jai Shri Ram's Minio Bucket Policy Notes](https://blog.nikhilbhardwaj.in/2020/02/25/minio-bucket-policy/),
but we actually grant all `s3:*` privileges on the given `gitlab`
bucket space, as we want the `gitlab` user to be able to create
buckets and manage their policies.
That policy needs to be fed to MinIO using the web interface or `mc`