Este contenido no está disponible en el idioma seleccionado.
Chapter 8. Bucket policies in the Multicloud Object Gateway
OpenShift Data Foundation supports AWS S3 bucket policies. Bucket policies allow you to grant users access permissions for buckets and the objects in them.
8.1. Introduction to bucket policies Copiar enlaceEnlace copiado en el portapapeles!
Bucket policies are an access policy option available for you to grant permission to your AWS S3 buckets and objects. Bucket policies use JSON-based access policy language. For more information about access policy language, see AWS Access Policy Language Overview.
8.2. Using bucket policies in Multicloud Object Gateway Copiar enlaceEnlace copiado en el portapapeles!
Prerequisites
- A running OpenShift Data Foundation Platform.
- Access to the Multicloud Object Gateway (MCG), see Chapter 2, Accessing the Multicloud Object Gateway with your applications
- A valid Multicloud Object Gateway user account. See Creating a user in the Multicloud Object Gatewayfor instructions to create a user account.
Procedure
To use bucket policies in the MCG:
Create the bucket policy in JSON format.
For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
john.doe@example.com
with a valid Multicloud Object Gateway user account.Using AWS S3 client, use the
put-bucket-policy
command to apply the bucket policy to your S3 bucket:aws --endpoint ENDPOINT --no-verify-ssl s3api put-bucket-policy --bucket MyBucket --policy file://BucketPolicy
# aws --endpoint ENDPOINT --no-verify-ssl s3api put-bucket-policy --bucket MyBucket --policy file://BucketPolicy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
ENDPOINT
with the S3 endpoint. -
Replace
MyBucket
with the bucket to set the policy on. -
Replace
BucketPolicy
with the bucket policy JSON file. Add
--no-verify-ssl
if you are using the default self signed certificates.For example:
aws --endpoint https://s3-openshift-storage.apps.gogo44.noobaa.org --no-verify-ssl s3api put-bucket-policy -bucket MyBucket --policy file://BucketPolicy
# aws --endpoint https://s3-openshift-storage.apps.gogo44.noobaa.org --no-verify-ssl s3api put-bucket-policy -bucket MyBucket --policy file://BucketPolicy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information on the
put-bucket-policy
command, see the AWS CLI Command Reference for put-bucket-policy.NoteThe principal element specifies the user that is allowed or denied access to a resource, such as a bucket. Currently, Only NooBaa accounts can be used as principals. In the case of object bucket claims, NooBaa automatically create an account
obc-account.<generated bucket name>@noobaa.io
.NoteBucket policy conditions are not supported.
-
Replace
Additional resources
- There are many available elements for bucket policies with regard to access permissions.
- For details on these elements and examples of how they can be used to control the access permissions, see AWS Access Policy Language Overview.
- For more examples of bucket policies, see AWS Bucket Policy Examples.
-
OpenShift Data Foundation version 4.17 introduces the bucket policy elements
NotPrincipal
,NotAction
, andNotResource
. For more information on these elements, see IAM JSON policy elements reference.
8.3. Creating a user in the Multicloud Object Gateway Copiar enlaceEnlace copiado en el portapapeles!
Prerequisites
- A running OpenShift Data Foundation Platform.
Download the Multicloud Object Gateway (MCG) command-line interface binary from the customer portal and make it executable.
NoteChoose the correct product variant according to your architecture. Available platforms are Linux(x86_64), Windows, and Mac OS.
Procedure
Execute the following command to create an MCG user account:
noobaa account create <noobaa-account-name> [--allow_bucket_create=true] [--allowed_buckets=[]] [--default_resource=''] [--full_permission=false]
noobaa account create <noobaa-account-name> [--allow_bucket_create=true] [--allowed_buckets=[]] [--default_resource=''] [--full_permission=false]
<noobaa-account-name>
- Specify the name of the new MCG user account.
--allow_bucket_create
- Allows the user to create new buckets.
--allowed_buckets
- Sets the user’s allowed bucket list (use commas or multiple flags).
--default_resource
- Sets the default resource.The new buckets are created on this default resource (including the future ones).
--full_permission
- Allows this account to access all existing and future buckets.
You need to provide permission to access atleast one bucket or full permission to access all the buckets.