How to disable the public list of files in Minio

Minio is an open-source Amazon S3 clone that you can install on your server.

When you set a bucket access policy as public, you are also exposing the list of files to the public. This is often not what you want. Luckily, it’s quite easy to fix.

First, open “Access policy” and set it as “custom”.

See “Access policy”

You need to insert a custom policy here. You can copy & paste this one after modifying the bucket name (BUCKET_NAME_HERE).

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": [
                    "*"
                ]
            },
            "Action": [
                "s3:GetBucketLocation"
            ],
            "Resource": [
                "arn:aws:s3:::BUCKET_NAME_HERE"
            ]
        },
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": [
                    "*"
                ]
            },
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::BUCKET_NAME_HERE/*"
            ]
        }
    ]
}

After this, your bucket files should be still accessible in public but the actual file listing is not.

Leave a Reply

Your email address will not be published. Required fields are marked *