Policy Document
Best Practice
Each Action domain administrators are allowed to perform can be listed to create a policy for them having broad permissions. It is easier and less error-prone to list the few actions they cannot perform (such as DeleteDomain and CopyDomain) by replacing the entire Action statement with the NotAction statement:
{
"Version": "2016-10-17",
"Statement": [
{
"Sid": "Grant all except excluded domain operations to admins2",
"Resource": "/*",
"Effect": "Allow",
"Principal": {
"group": [
"admins2"
]
},
"NotAction": [
"CopyDomain",
"DeleteDomain"
]
}
]
}Policy Document Fields
Policy documents are JSON-formatted objects.
Field | Sub-field | Description |
|---|---|---|
Version | optional; if used must be "2012-10-17" or "2008-10-17" to match S3 | |
Id | optional name to describe the policy | |
Statement | a list of rules | |
Sid | unique identifier for each statement | |
Effect | whether the rule allows or denies an operation | |
Principals | defines users and groups to which the rule applies | |
Action | content operation (request) | |
NotAction | logical inverse of Action; supports all Action values | |
Resource | path for which the rule applies; "/" prefix is optional | |
Condition | conditional requirements for the request |
Policy Example
{
"Version": "2008-10-17",
"Id": "Comics-and-Superheros",
"Statement": [
{
"Effect": "Allow",
"Sid": "1",
"Principal": {
"group": [
"Development",
"QA",
"testers@partner.net"
],
"user": [
"jdoe",
"gcarlin@funny.com",
"tony+starkindustries"
]
},
"Action": [
"GetObject"
],
"Resource": "/*",
"Condition": {
"StringLike": {
"Referer": [
"*example.com"
]
}
}
}
]
}Policy Format
The format of Gateway's Policy document is modeled after Amazon S3 bucket policies. There is one policy document per tenant, per storage domain, and per bucket. Updating a policy document completely replaces any existing document. The root Policy plus the relevant tenant, storage domain, and bucket policies are all first merged together when evaluating a request.
The policy is a set of rules specifying the conditions under which a request is allowed or denied within the storage API or the management API (such as create a domain, bucket, or object). Each statement in a policy specifies the principals allowed or denied the ability to perform an action on a resource. These are examples of each of these elements of a policy specification.
Principals: user "jdoe", group "Development"
Action: GetObject, DeleteObject
NotAction: CopyDomain, DeleteDomain
Resource: "mybucket/private/*", "mybucket/photos/picture01.jpg"
Condition: "StringLike" : { "Referer" : ["*example.com"]} }
Effect: "Allow", "Deny"
Best Practice
Make the Policy documents as small as reasonable for best performance. Performance is affected because the statements need to be evaluated for each request to check if the resource matches. Choose the most efficient definitions; NotAction lists may be shorter than Action lists.
The Id field is provided for end-user use only and is ignored by the policy evaluation. The Version field is optional and the sole valid value is "2008-10-17" if defined.
Caution
Do not prefix resources with "arn:aws:s3:::" and actions with "s3:" strings. These are ignored by the policy evaluation and negatively impact performance.
Principals
Principals are users or groups to whom the access control statement applies. This includes the specification of an anonymous user that has not authenticated. The format is:
Specifying Authenticated Users
"{user|group}":[{list- of- principals}]These notation formats are recognized for anonymous principals:
Anonymous Principals
Principal: "*"
Principal: { "anonymous" : ["*"] }
Principal: { "anonymous" : "*" }
Principal: { "AWS" : ["*"] }
Principal: { "AWS" : "*" }This is an example that includes users and groups from other storage domains and tenants.
Including Users and Groups
"Principal" : {
"user":["vcerf", "timbl", "ltorvalds@kernel.org"],
"group":["Development", "QA+acme", "Development+acme"],
}See Cross-tenant Access Control below for the meaning of the @domain and +tenantsuffixes for users and groups.
The following table explains the meaning of the different forms of the principal specifications.
Principal | Description |
|---|---|
"anonymous":["*"] | An anonymous, unauthenticated user |
"user":["*"] | Any authenticated user from the context’s IDSYS scope |
"user":["*@austin"] | Any authenticated user in the ‘austin’ domain’s idsys (or inherited IDSYS if applicable). |
"user":["*+texas"] | Any authenticated user in the ‘texas’ tenant’s idsys (or inherited IDSYS if applicable). |
"user":["gcarlin"] | A user named 'gcarlin' from this scope's IDSYS (or inherited IDSYS if applicable). This is a non-qualified user name since no domain, tenant, or root scope is specified. |
"user":["gcarlin@cars"] | A user named 'gcarlin' from the 'cars' storage domain's IDSYS (or its inherited IDSYS if applicable) |
"user":["gcarlin+movies"] | A user named 'gcarlin' from the 'movies' tenant's IDSYS (or its inherited IDSYS if applicable) |
"user":["gcarlin@"] | A user named 'gcarlin' only from the root IDSYS |
"group":["admins"] | Any member of the group named 'admins' from this scope's IDSYS (or inherited IDSYS if applicable). This is a non-qualified group name since no domain, tenant, or root scope is specified. |
"group":["admins@hockey"] | Any member of the group named 'admins' from the 'hockey' storage domain's IDSYS (or its inherited IDSYS if applicable) |
"group":["admins+sports"] | Any member of the group named 'admins' from the 'sports' tenant's IDSYS (or its inherited IDSYS if applicable) |
"group":["admins@"] | Any member of the group named 'admins' only from the root IDSYS |
In many cases it is unnecessary to explicitly grant permissions to the user named by the X-Owner-Meta header, of a tenant, storage domain, or bucket because they are granted permission for all operations by default. This default permission means that careful consideration should be given when assigning ownership to another user — especially for tenants or storage domains.
Linux Root User
The root user (uid=0) is not allowed to authenticate to Gateway using Linux PAM.
User and group principals can be written as fully-qualified or non-qualified within Policy documents. A fully-qualified principal is one that defines the domain, tenant, or root scope (example: "gcarlin@cars"). A non-qualified principal does not include the scope for the principal (example: "gcarlin"). The scope of a principal defined the starting point for looking for the first available IDSYS definition with which to look for the principal. The starting point for the IDSYS search starts from the point of the resource being requested if the principal is non-qualified.
The IDSYS precedence model allows the root scope to be overridden by the tenant and the domain scopes. The search order when looking for the first available IDSYS is to search backwards from domain to tenant to root. The Gateway looks for the first IDSYS that is defined at the domain, then the tenant, then at the root if a group is specified as "admins@hockey" for requests within the "hockey" storage domain. The group "admins" from only that IDSYS are used upon finding the first IDSYS definition.
Request Actions
Policy documents are used to control actions with both the Management API and the Storage API. The policy actions that apply to a given request depends upon the API being used, management or storage. The list of Policy documents that are merged together for policy evaluation is determined by the path in the API hierarchy being accessed.
Request actions are included in the Effect field result when listed within an Action field. The listed actions are explicitly denied if the effect is "Deny". Request actions are excluded from the Effect field results when listed within a NotAction field. All actions other than those listed are explicitly denied if the effect is "Deny".
Policy Actions for Administration (Management API)
These are the Management API actions that can be controlled within a Policy document and the applicable scope where the actions are used. If an action is granted or denied within a scope where not applicable, it has no effect.
Scope indicates where the policy action is applicable: (R) root, (T) tenant, (D) domain, (B) bucket.
Manage | Action | Scope | Description |
|---|---|---|---|
Global | * | R,T,D,B | all actions |
Tenants | ListTenants | R | List all tenants |
CreateTenant | R | Create a new or change an existing tenant | |
GetTenant | R,T | Retrieve tenant properties | |
DeleteTenant | R,T | Permanently remove tenant properties | |
ListEtc | R,T | List documents associated with a tenant | |
Domains | ListDomains | R,T | List the domains owned by the _system tenant |
CreateDomain | R,T | Create a domain for the _system tenant | |
GetDomain | R,T,D | GET a domain | |
DeleteDomain | R,T,D | Delete a domain | |
Policies | ListEtc | R,T,D | List documents associated with a tenant or a storage domain |
PutPolicy | R,T,D | Create or update an access control policy JSON document | |
GetPolicy | R,T,D | Read an access control policy JSON document | |
DeletePolicy | R,T,D | Permanently remove an access control policy JSON document | |
ImportantThe actions | |||
Authentication | TokenAdmin | R,T,D | Create and list authorization tokens for other users in the same scope |
CreateToken | R,T,D | Create an authentication token | |
ListTokens | R,T,D | List user authentication tokens | |
ValidateToken | R,T,D | Read an authentication token | |
DeleteToken | R,T,D | Delete an authentication token | |
Policy Actions for Content (Storage API)
This table defines the Storage SCSP API actions that can be controlled within a Policy document and the applicable scope where the actions are used. An action has no effect if granted or denied within a scope where not applicable.
See http://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html in the AWS documentation for Amazon S3 operation permissions.
Scope indicates where the policy action is applicable: (R) root, (T) tenant, (D) domain, (B) bucket.
Storage | Action | Scope | Description |
|---|---|---|---|
Global | * | R,T,D,B | all actions |
Quotas | PutQuota | R,T,D,B | Create or update quota configuration settings on a tenant, domain, or bucket. This is not granted by "*"; it must be granted explicitly. |
GetQuota | R,T,D,B | Retrieve quota configuration settings on a tenant, domain, or bucket. This is not granted by "*"; it must be granted explicitly. | |
Objects | GetObject | R,T,D,B | Retrieve an object and its metadata |
GetObjectAcl | R,T,D,B | Retrieve the Access Control List (ACL) settings on an object | |
CreateObject | R,T,D,B | Add a new object and metadata to a domain (unnamed) or bucket (named). There is no S3 equivalent, and it is permissioned separately here because Swarm distinguishes POST and PUT. | |
AppendObject | R,T,D,B | Append to an object | |
CopyObject | R,T,D,B | Update metadata on an object while keeping the same object name | |
PutObject | R,T,D,B | Update an object PutObject, unlike S3, is for overwriting an existing object, not creating new one (CreateObject). | |
PutObjectAcl | R,T,D,B | Set an object's access control list | |
DeleteObject | R,T,D,B | Permanently remove an object and its metadata | |
Buckets | CreateBucket | R,T,D | Create a bucket |
PutBucket | R,T,D | Synonym for CreateBucket | |
PutBucketAcl | R,T,D | Set bucket access control list | |
PutBucketCORS | R,T,D,B | Set CORS configuration on a bucket | |
GetBucket | R,T,D,B | GET or HEAD a bucket | |
GetBucketAcl | R,T,D,B | Get bucket access control list | |
GetBucketCORS | R,T,D,B | Get CORS configuration on a bucket | |
CopyBucket | R,T,D,B | Update the metadata on a bucket while keeping the same bucket name | |
DeleteBucket | R,T,D,B | Delete a bucket | |
ListBucket | R,T,D,B | List and search the objects contained in a bucket | |
Bucket | PutPolicy | R,T,D,B | Create or update a policy, xform, sub-resource for a bucket. While an owner of bucket can always overwrite the policy, this allows a group to be granted this permission. |
GetPolicy | R,T,D,B | GET or HEAD the policy, xform, sub-resource for a bucket | |
DeletePolicy | R,T,D,B | Permanently remove a policy, xform, sub-resource for a bucket | |
Domains | CreateDomain | R * | Create a domain |
GetDomain | R,T,D | GET or HEAD a domain | |
CopyDomain | R,T,D | Update the metadata on a domain while keeping the same domain name | |
DeleteDomain | R,T,D | Permanently remove a domain | |
ListDomain | R,T,D | List and search all objects (buckets and unnamed objects) within the domain | |
ListDomains | R * | List all domains that exist in the cluster | |
Domain | PutPolicy | R,T,D | Create or update a policy, xform, idsys, sub-resource for a domain |
GetPolicy | R,T,D | GET or HEAD policy, xform, idsys, sub-resource for a domain | |
DeletePolicy | R,T,D | Permanently remove a policy, xform, idsys, sub-resource from a domain | |
Authentication | CreateToken | R,T,D | Add a new authentication token |
ListTokens | R,T,D | Search for and list authentication tokens | |
ValidateToken | R,T,D | Read and verify an authentication token | |
DeleteToken |
© DataCore Software Corporation. · https://www.datacore.com · All rights reserved.