Access Management
Table of Contents
Overview
MinIO uses Policy-Based Access Control (PBAC) to define the authorized actions and resources to which an authenticated user has access. Each policy describes one or more actions and conditions that outline the permissions of a user or group of users.
MinIO PBAC is built for compatibility with AWS IAM policy syntax, structure, and behavior. The MinIO documentation makes a best-effort to cover IAM-specific behavior and functionality. Consider deferring to the IAM documentation for more complete documentation on AWS IAM-specific topics.
The
mc
admin
policy
command supports creation and management of policies on the MinIO deployment.
See the command reference for examples of usage.
Tag-Based Policy Conditions
Changed in version RELEASE.2022-10-02T19-29-29Z: Policies can use conditions to limit a user’s access only to objects with a specific tag.
MinIO supports
tag-based conditionals
for policies for
selected actions
.
Use the
s3:ExistingObjectTag/<key>
in the
Condition
statement of the policy.
Built-In Policies
MinIO provides the following built-in policies for assigning to users or groups :
- consoleAdmin
-
Grants complete access to all S3 and administrative API operations against all resources on the MinIO deployment. Equivalent to the following set of actions:
- readonly
-
Grants read-only permissions on any object on the MinIO deployment. The GET action must apply to a specific object without requiring any listing. Equivalent to the following set of actions:
For example, this policy specifically supports GET operations on objects at a specific path (e.g.
GET play/mybucket/object.file
), such as:The exclusion of listing permissions is intentional, as typical use cases do not intend for a “read-only” role to have complete discoverability (listing all buckets and objects) on the object storage resource.
- readwrite
-
Grants read and write permissions for all buckets and objects on the MinIO server. Equivalent to
s3:*
.
- diagnostics
-
Grants permission to perform diagnostic actions on the MinIO deployment. Specifically includes the following actions:
- writeonly
-
Grants write-only permissions to any namespace (bucket and path to object) the MinIO deployment. The PUT action must apply to a specific object location without requiring any listing. Equivalent to the
s3:PutObject
action.
Use
mc
admin
policy
set
to associate a policy to a
user or group on a MinIO deployment.
For example, consider the following table of users. Each user is assigned a built-in policy or a supported action . The table describes a subset of operations a client could perform if authenticated as that user:
User |
Policy |
Operations |
---|---|---|
|
PUT
and
GET
on
finance
bucket.
PUT
on
audit
bucket
|
|
|
readonly
on
audit
bucket
|
|
|
All
|
Each user can access only those resources and operations which are explicitly granted by the built-in role. MinIO denies access to any other resource or action by default.
Deny
overrides
Allow
MinIO follows the IAM policy evaluation rules where a
Deny
rule overrides
Allow
rule on the same action/resource. For example, if a user has an
explicitly assigned policy with an
Allow
rule for an action/resource
while one of its groups has an assigned policy with a
Deny
rule for that
action/resource, MinIO would apply only the
Deny
rule.
For more information on IAM policy evaluation logic, see the IAM documentation on Determining Whether a Request is Allowed or Denied Within an Account .
Policy Document Structure
MinIO policy documents use the same schema as AWS IAM Policy documents.
The following sample document provides a template for creating custom policies for use with a MinIO deployment. For more complete documentation on IAM policy elements, see the IAM JSON Policy Elements Reference .
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" : [ "s3:<ActionName>", ... ],
"Resource" : "arn:aws:s3:::*",
"Condition" : { ... }
},
{
"Effect" : "Deny",
"Action" : [ "s3:<ActionName>", ... ],
"Resource" : "arn:aws:s3:::*",
"Condition" : { ... }
}
]
}
-
For the
Statement.Action
array, specify one or more supported S3 API operations . -
For the
Statement.Resource
key, specify the bucket or bucket prefix to which to restrict the policy. You can use*
and?
wildcard characters as per the S3 Resource Spec .The
*
wildcard may result in unintended application of a policy to multiple buckets or prefixes based on the pattern match. For example,arn:aws:s3:::data*
would match the bucketsdata
,data_private
, anddata_internal
. Specifying only*
as the resource key applies the policy to all buckets and prefixes on the deployment. -
For the
Statement.Condition
key, you can specify one or more supported Conditions .
Supported S3 Policy Actions
MinIO policy documents support a subset of IAM S3 Action keys .
The following actions control access to common S3 operations. The remaining subsections document actions for more advanced S3 operations:
- s3:*
-
Selector for all MinIO S3 operations. Applying this action to a given resource allows the user to perform any S3 operation against that resource.
- s3:CreateBucket
-
Controls access to the CreateBucket S3 API operation.
- s3:DeleteBucket
-
Controls access to the DeleteBucket S3 API operation.
- s3:ForceDeleteBucket
-
Controls access to the DeleteBucket S3 API operation for operations with the
x-minio-force-delete
flag. Required for removing non-empty buckets.
- s3:GetBucketLocation
-
Controls access to the GetBucketLocation S3 API operation.
- s3:ListAllMyBuckets
-
Controls access to the ListBuckets S3 API operation.
- s3:DeleteObject
-
Controls access to the DeleteObject S3 API operation.
- s3:GetObject
-
Controls access to the GetObject S3 API operation.
- s3:ListBucket
-
Controls access to the ListObjectsV2 S3 API operation.
- s3:PutObject
-
Controls access to the PutObject S3 API operation.
- s3:PutObjectTagging
-
Controls access to the PutObjectTagging S3 API operation.
- s3:GetObjectTagging
-
Controls access to the GetObjectTagging S3 API operation.
- s3:DeleteObjectTagging
-
Controls access to the DeleteObjectTagging S3 API operation.
Bucket Configuration
- s3:GetBucketPolicy
-
Controls access to the GetBucketPolicy S3 API operation.
- s3:PutBucketPolicy
-
Controls access to the PutBucketPolicy S3 API operation.
- s3:DeleteBucketPolicy
-
Controls access to the DeleteBucketPolicy S3 API operation.
- s3:GetBucketTagging
-
Controls access to the GetBucketTagging S3 API operation.
- s3:PutBucketTagging
-
Controls access to the PutBucketTagging S3 API operation.
Multipart Upload
- s3:AbortMultipartUpload
-
Controls access to the AbortMultipartUpload S3 API operation.
- s3:ListMultipartUploadParts
-
Controls access to the ListParts S3 API operation.
- s3:ListBucketMultipartUploads
-
Controls access to the ListMultipartUploads S3 API operation.
Versioning and Retention
- s3:PutBucketVersioning
-
Controls access to the PutBucketVersioning S3 API operation.
- s3:GetBucketVersioning
-
Controls access to the GetBucketVersioning S3 API operation.
- s3:DeleteObjectVersion
-
Controls access to the DeleteObjectVersion S3 API operation.
- s3:DeleteObjectVersionTagging
-
Controls access to the DeleteObjectVersionTagging S3 API operation.
- s3:GetObjectVersion
-
Controls access to the GetObjectVersion S3 API operation.
- s3:BypassGovernanceRetention
-
Controls access to the following S3 API operations on objects locked under
GOVERNANCE
retention mode:-
PutObjectRetention
-
PutObject
-
DeleteObject
See the S3 documentation on s3:BypassGovernanceRetention for more information.
-
- s3:PutObjectRetention
-
Controls access to the PutObjectRetention S3 API operation.
Required for any
PutObject
operation that specifies retention metadata .
- s3:GetObjectRetention
-
Controls access to the GetObjectRetention S3 API operation.
Required for including object locking metadata as part of the response to a
GetObject
orHeadObject
operation.
- s3:GetObjectLegalHold
-
Controls access to the GetObjectLegalHold S3 API operation.
Required for including object locking metadata as part of the response to a
GetObject
orHeadObject
operation.
- s3:PutObjectLegalHold
-
Controls access to the PutObjectLegalHold S3 API operation.
Required for any
PutObject
operation that specifies legal hold metadata .
- s3:GetBucketObjectLockConfiguration
-
Controls access to the GetObjectLockConfiguration S3 API operation.
- s3:PutBucketObjectLockConfiguration
-
Controls access to the PutObjectLockConfiguration S3 API operation.
Bucket Notifications
- s3:GetBucketNotification
-
Controls access to the GetBucketNotification S3 API operation.
- s3:PutBucketNotification
-
Controls access to the PutBucketNotification S3 API operation.
Object Lifecycle Management
- s3:PutLifecycleConfiguration
-
Controls access to the PutLifecycleConfiguration S3 API operation.
- s3:GetLifecycleConfiguration
-
Controls access to the GetLifecycleConfiguration S3 API operation.
Object Encryption
- s3:PutEncryptionConfiguration
-
Controls access to the PutEncryptionConfiguration S3 API operation.
- s3:GetEncryptionConfiguration
-
Controls access to the GetEncryptionConfiguration S3 API operation.
Bucket Replication
- s3:GetReplicationConfiguration
-
Controls access to the GetBucketReplication S3 API operation.
- s3:PutReplicationConfiguration
-
Controls access to the PutBucketReplication S3 API operation.
- s3:ReplicateObject
-
MinIO Extension for controlling API operations related to Server-Side Bucket Replication .
Required for server-side replication.
- s3:ReplicateDelete
-
MinIO Extension for controlling API operations related to Server-Side Bucket Replication .
Required for synchronizing delete operations as part of server-side replication.
- s3:ReplicateTags
-
MinIO Extension for controlling API operations related to Server-Side Bucket Replication .
Required for server-side replication.
- s3:GetObjectVersionForReplication
-
MinIO Extension for controlling API operations related to Server-Side Bucket Replication .
Required for server-side replication.
Supported S3 Policy Condition Keys
MinIO policy documents support IAM conditional statements .
Each condition element consists of operators and condition keys. MinIO supports a subset of IAM condition keys. For complete information on any listed condition key, see the IAM Condition Element Documentation
MinIO supports the following condition keys for all supported actions :
-
aws:Referer
-
aws:SourceIp
-
aws:UserAgent
-
aws:SecureTransport
-
aws:CurrentTime
-
aws:EpochTime
-
aws:PrincipalType
-
aws:userid
-
aws:username
-
x-amz-content-sha256
Warning
The
aws:Referer
,
aws:SourceIp
, and
aws.UserAgent
keys may be easily spoofed and therefore pose a potential security risk.
MinIO recommends only using these condition keys to
deny
access as a secondary security measure.
Never use these three keys to grant access by themselves.
The following table lists additional supported condition keys for specific actions:
Action Key |
Condition Keys |
---|---|
x-amz-server-side-encryption
x-amz-server-side-encryption-customer-algorithm
s3:ExistingObjectTag/<key>
|
|
prefix
delimiter
max-keys
|
|
x-amz-copy-source
x-amz-server-side-encryption
x-amz-server-side-encryption-customer-algorithm
x-amz-metadata-directive
x-amz-storage-class
object-lock-retain-until-date
object-lock-mode
object-lock-legal-hold
s3:ExistingObjectTag/<key>
|
|
x-amz-object-lock-remaining-retention-days
x-amz-object-lock-retain-until-date
x-amz-object-lock-mode
|
|
|
|
object-lock-remaining-retention-days
object-lock-retain-until-date
object-lock-mode
object-lock-legal-hold
|
|
|
|
|
|
|
|
|
mc
admin
Policy Action Keys
MinIO supports the following actions for use with defining policies
for
mc
admin
operations. These actions are
only
valid for
MinIO deployments and are
not
intended for use with other S3-compatible
services:
- admin:SetTier
-
Allows creating and modifying remote storage tiers using the
mc ilm tier
commands.
- admin:ListTier
-
Allows listing configured remote storage tiers using the
mc ilm tier
commands.
- admin:Prometheus
-
Allows access to MinIO metrics . Only required if MinIO requires authentication for scraping metrics.
mc
admin
Policy Condition Keys
MinIO supports the following conditions for use with defining policies for
mc
admin
actions
.
-
aws:Referer
-
aws:SourceIp
-
aws:UserAgent
-
aws:SecureTransport
-
aws:CurrentTime
-
aws:EpochTime
For complete information on any listed condition key, see the IAM Condition Element Documentation