S3 Users and Authentication
This page describes how to gain and obtain access permissions to the S3 protocol.
Last updated
This page describes how to gain and obtain access permissions to the S3 protocol.
Last updated
To access the Weka cluster through the S3 protocol, a user with an S3 user role must be created (see for details on creating users in Weka).
When accessing data with S3 and other protocols (e.g., POSIX), it is possible to control the POSIX UID/GID of the underlying file representation of objects created with a specific S3 user access/secret keys. Use --posix-uid
and --posix-gid
flags for a local user with an S3 user role.
Once an S3 user has been created, it cannot run any S3 command or API. The Cluster Admin must attach an IAM policy to allow this user to operate (within the policy limits).
A set of pre-defined policies can be attached to an S3 user, or new custom policies can be created and attached to an S3 user. To create a custom policy you can use , and select IAM Policy
as the policy type and Amazon S3
as the AWS service.
Once an S3 user is created and an IAM policy is attached, it is possible to gain temporary credentials to access the S3 API. This is done by calling the Assume Role command.
The result of calling the API is an access key, secret key, and session token tuple that can be used to access S3 APIs. The permissions for the temporary credentials will be the permissions induced by the user's IAM policy. Furthermore, it is possible to supply a different (with reduced capabilities only) IAM policy for the temporary credentials request.
Command: weka s3 policy list
Use this command to list the existing IAM policies.
The command lists both the pre-defined policies and custom policies that the Cluster Admin has added.
Command: weka s3 policy show <policy-name>
Use this command to see the JSON definition of the selected IAM policy.
The pre-defined policies value are:
Command: weka s3 policy create
Use the following command line to create an S3 IAM policy:
weka s3 policy create <policy-name> <policy-file>
Parameters in Command Line
Name
Type
Value
Limitations
Mandatory
Default
policy-name
String
The name of the new IAM policy
Yes
policy-file
String
A path to a custom policy JSON file for anonymous access.
A JSON file representing an IAM policy.
Yes
Command: weka s3 policy remove
Use the following command line to delete an S3 IAM policy:
weka s3 policy remove <policy-name>
Parameters in Command Line
Name
Type
Value
Limitations
Mandatory
Default
policy-name
String
The name of the IAM policy to remove
Yes
Command: weka s3 policy attach
Use the following command line to attach an IAM policy to an S3 user:
weka s3 policy attach <policy> <user>
Parameters in Command Line
Name
Type
Value
Limitations
Mandatory
Default
policy
String
The name of an existing IAM policy
Yes
user
String
The name of an existing S3 user
Yes
Command: weka s3 policy detach
Use the following command line to detach an IAM policy from an S3 user:
weka s3 policy detach <user>
Parameters in Command Line
Name
Type
Value
Limitations
Mandatory
Default
user
String
The name of an existing S3 user
Yes
Command: weka s3 sts assume-role
Use the following command line to generate a temporary security token:
weka s3 sts assume-role <--access-key access-key> [--secret-key secret-key] [--policy-file policy-file] <--duration duration>
Parameters in Command Line
Name
Type
Value
Limitations
Mandatory
Default
access-key
String
An S3 user access key
Yes
secret-key
String
An S3 user secret key
No
If not supplied, the command will prompt to supply the secret-key
policy-file
String
A path to a custom policy JSON file for anonymous access.
A JSON file representing an IAM policy.
No
duration
String
Duration for the token validity
Between 15 minutes and 1 week. Format: 900s
, 60m
, 2d
, 1w
Yes
An example response:
For supported actions, refer to the section.
For supported actions, refer to the section. You cannot gain additional capabilities to the IAM policy attached to this S3 user.