Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / radosgw / bucketpolicy.rst
1 ===============
2 Bucket Policies
3 ===============
4
5 .. versionadded:: Luminous
6
7 The Ceph Object Gateway supports a subset of the Amazon S3 policy
8 language applied to buckets.
9
10
11 Creation and Removal
12 ====================
13
14 Bucket policies are managed through standard S3 operations rather than
15 radosgw-admin.
16
17 For example, one may use s3cmd to set or delete a policy thus::
18
19   $ cat > examplepol
20   {
21     "Version": "2012-10-17",
22     "Statement": [{
23       "Effect": "Allow",
24       "Principal": {"AWS": ["arn:aws:iam::usfolks:user/fred"]},
25       "Action": "s3PutObjectAcl",
26       "Resource": [
27         "arn:aws:s3:::happybucket/*"
28       ]
29     }]
30   }
31
32   $ s3cmd setpolicy examplepol s3://happybucket
33   $ s3cmd delpolicy s3://happybucket
34
35
36 Limitations
37 ===========
38
39 Currently, we support only the following actions:
40
41 - s3:AbortMultipartUpload
42 - s3:CreateBucket
43 - s3:DeleteBucketPolicy
44 - s3:DeleteBucket
45 - s3:DeleteBucketWebsite
46 - s3:DeleteObject
47 - s3:DeleteObjectVersion
48 - s3:DeleteReplicationConfiguration
49 - s3:GetAccelerateConfiguration
50 - s3:GetBucketAcl
51 - s3:GetBucketCORS
52 - s3:GetBucketLocation
53 - s3:GetBucketLogging
54 - s3:GetBucketNotification
55 - s3:GetBucketPolicy
56 - s3:GetBucketRequestPayment
57 - s3:GetBucketTagging
58 - s3:GetBucketVersioning
59 - s3:GetBucketWebsite
60 - s3:GetLifecycleConfiguration
61 - s3:GetObjectAcl
62 - s3:GetObject
63 - s3:GetObjectTorrent
64 - s3:GetObjectVersionAcl
65 - s3:GetObjectVersion
66 - s3:GetObjectVersionTorrent
67 - s3:GetReplicationConfiguration
68 - s3:ListAllMyBuckets
69 - s3:ListBucketMultiPartUploads
70 - s3:ListBucket
71 - s3:ListBucketVersions
72 - s3:ListMultipartUploadParts
73 - s3:PutAccelerateConfiguration
74 - s3:PutBucketAcl
75 - s3:PutBucketCORS
76 - s3:PutBucketLogging
77 - s3:PutBucketNotification
78 - s3:PutBucketPolicy
79 - s3:PutBucketRequestPayment
80 - s3:PutBucketTagging
81 - s3:PutBucketVersioning
82 - s3:PutBucketWebsite
83 - s3:PutLifecycleConfiguration
84 - s3:PutObjectAcl
85 - s3:PutObject
86 - s3:PutObjectVersionAcl
87 - s3:PutReplicationConfiguration
88 - s3:RestoreObject
89
90 We do not yet support setting policies on users, groups, or roles.
91
92 We use the RGW â€˜tenant’ identifier in place of the Amazon twelve-digit
93 account ID. In the future we may allow you to assign an account ID to
94 a tenant, but for now if you want to use policies between AWS S3 and
95 RGW S3 you will have to use the Amazon account ID as the tenant ID when
96 creating users.
97
98 Under AWS, all tenants share a single namespace. RGW gives every
99 tenant its own namespace of buckets. There may be an option to enable
100 an AWS-like 'flat' bucket namespace in future versions. At present, to
101 access a bucket belonging to another tenant, address it as
102 "tenant:bucket" in the S3 request.
103
104 In AWS, a bucket policy can grant access to another account, and that
105 account owner can then grant access to individual users with user
106 permissions. Since we do not yet support user, role, and group
107 permissions, account owners will currently need to grant access
108 directly to individual users, and granting an entire account access to
109 a bucket grants access to all users in that account.
110
111 Bucket policies do not yet support string interpolation.
112
113 Currently, the only condition keys we support are:
114 - aws:CurrentTime
115 - aws:EpochTime
116 - aws:PrincipalType
117 - aws:Referer
118 - aws:SecureTransport
119 - aws:SourceIp
120 - aws:UserAgent
121 - aws:username
122
123 More may be supported soon as we integrate with the recently rewritten
124 Authentication/Authorization subsystem.
125
126 Swift
127 =====
128
129 There is no way to set bucket policies under Swift, but bucket
130 policies that have been set govern Swift as well as S3 operations.
131
132 Swift credentials are matched against Principals specified in a policy
133 in a way specific to whatever backend is being used.