Esta guía fue creada para el lanzamiento de MinIO RELEASE.2025-05-24T17-08-30Z
.
bash
mc alias set myminio https://minio.example.com YOUR_ACCESS_KEY YOUR_SECRET_KEY
mc mb myminio/public
bash
mc anonymous set download myminio/public
Esto hace lo siguiente:
Primero, ejecuta el siguiente comando para obtener la política JSON actual creada por el paso anterior.
bash
mc anonymous get-json myminio/public
La salida se verá de la siguiente manera: “Esa es la política definida por el ajuste 'download'.
json
{
"Statement": [
{
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket"
],
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Resource": [
"arn:aws:s3::: public"
]
},
{
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Resource": [
"arn:aws:s3::: public/*"
]
}
],
"Version": "2012-10-17"
}
La línea que permite a cualquiera listar los archivos disponibles en el bucket es s3:ListBucket
en la propiedad 'Action'. Simplemente elimínala y sube la política nuevamente con el siguiente comando.
bash
mc anonymous set-json /path-to-your-edited-json-policy.json myminio/public
Donde el archivo /path-to-your-edited-json-policy.json
contiene la versión editada de tu política.
json
{
"Statement": [
{
"Action": [
"s3:GetBucketLocation"
],
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Resource": [
"arn:aws:s3::: public"
]
},
{
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Resource": [
"arn:aws:s3:::public/*"
]
}
],
"Version": "2012-10-17"
}
Abre la raíz de tu endpoint MinIO S3. Por ejemplo, 'tubucket.s3.tudominio.com'. Si obtienes un error en formato XML que dice ‘Access Denied’, ¡entonces todo está funcionando como se esperaba!