docs: Add comprehensive MinIO access key retrieval instructions

- Added 5 methods to obtain MinIO access keys and secrets
- Included MinIO Console, mc client, server startup, Docker, and Kubernetes methods
- Added best practices for credential management
- Provided example of creating limited service accounts
- Included sample IAM policy for MinIO WebUI operations
- Emphasized security practices like not using root credentials
This commit is contained in:
2025-07-22 16:52:07 +02:00
parent a6ee4346be
commit 53de1f6bff
+111
View File
@@ -194,6 +194,117 @@ JWT_SECRET=Km5F2p9kXx7Nw3Qr8vBz4Ht6Lj9Mn2Sf5Yd8Gc3Vb7Nx4Wq9Rt6Yh3Kp8Zx2Cv5
- JWT secrets should be at least 256 bits (32 bytes) of entropy
- Store the `.env` file securely with restricted permissions: `chmod 600 .env`
### Getting MinIO Access Keys
To connect to your MinIO server, you need the access key and secret key. Here's how to obtain them:
#### Method 1: From MinIO Console (Web UI)
1. Access your MinIO Console at `http://YOUR_MINIO_SERVER:9001`
2. Login with your root credentials
3. Navigate to **Identity****Service Accounts**
4. Click **Create Service Account**
5. Save the generated Access Key and Secret Key
#### Method 2: Using MinIO Client (mc)
```bash
# First, configure your MinIO alias if not already done
mc alias set myminio https://YOUR_MINIO_SERVER ROOTUSER ROOTPASSWORD
# Create a new service account
mc admin user svcacct add myminio YOUR_USERNAME
# This will output:
# Access Key: XXXXXXXXXXXXXXXXXXXX
# Secret Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```
#### Method 3: From MinIO Server Startup
If you're running MinIO server locally:
```bash
# Default credentials when starting MinIO
export MINIO_ROOT_USER=minioadmin
export MINIO_ROOT_PASSWORD=minioadmin
minio server /data
# Or check existing environment variables
echo $MINIO_ROOT_USER
echo $MINIO_ROOT_PASSWORD
```
#### Method 4: From Docker/Docker Compose
If MinIO is running in Docker:
```bash
# Check docker-compose.yml for environment variables
grep -E "MINIO_ROOT_USER|MINIO_ROOT_PASSWORD" docker-compose.yml
# Or inspect running container
docker inspect <minio-container-name> | grep -E "MINIO_ROOT_USER|MINIO_ROOT_PASSWORD"
```
#### Method 5: From Kubernetes Secrets
If MinIO is running in Kubernetes:
```bash
# Get secret name
kubectl get secrets -n <namespace> | grep minio
# Decode the secret
kubectl get secret <minio-secret-name> -n <namespace> -o jsonpath='{.data.accesskey}' | base64 -d
kubectl get secret <minio-secret-name> -n <namespace> -o jsonpath='{.data.secretkey}' | base64 -d
```
#### Best Practices for MinIO Credentials
1. **Don't use root credentials**: Create a dedicated service account for the WebUI
2. **Limit permissions**: Create a policy that only allows necessary operations
3. **Rotate regularly**: Change service account credentials periodically
4. **Use environment variables**: Store credentials in environment variables, not in code
Example of creating a limited service account for MinIO WebUI:
```bash
# Create a policy for WebUI operations
mc admin policy create myminio webui-policy /path/to/policy.json
# Create a user and attach the policy
mc admin user add myminio webui-user webui-password
mc admin policy attach myminio webui-policy --user webui-user
# Or create a service account for an existing user
mc admin user svcacct add myminio webui-user
```
Example policy for MinIO WebUI (save as `webui-policy.json`):
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:CreateBucket",
"s3:DeleteBucket",
"s3:GetBucketLocation",
"s3:ListBucket",
"s3:PutBucketPolicy",
"s3:GetBucketPolicy",
"admin:*"
],
"Resource": ["arn:aws:s3:::*"]
}
]
}
```
### Security Settings
```env