Skip to content

Commit 09786e4

Browse files
committed
doc/rgw/logging: add documentation for bucket logging policy
* updated restriction of the features and differences with the restrictions documented by AWS. * document quota handling Signed-off-by: Yuval Lifshitz <[email protected]>
1 parent de64166 commit 09786e4

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

doc/radosgw/bucket_logging.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ in different objects in the log bucket.
2020
- The log bucket must be created before enabling logging on a bucket
2121
- The log bucket cannot be the same as the bucket being logged
2222
- The log bucket cannot have logging enabled on it
23+
- The log bucket cannot have any encryption set on in (including SSE-S3 with AES-256)
24+
- The log bucket cannot have any compression set on it
25+
- The log bucket must not have RequestPayer enabled
26+
- Source and log bucket must be in the same zonegroup
27+
- Source and log buckets may belong to different accounts (with proper bucket policy set)
28+
- The log bucket may have object lock enabled with default retention period
2329

2430

2531
.. toctree::
@@ -51,6 +57,46 @@ Journal mode supports filtering out records based on matches of the prefixes and
5157
Note that it may happen that the log records were successfully written, but the bucket operation failed, since the logs are written.
5258

5359

60+
Bucket Logging Policy
61+
---------------------
62+
On the source bucket, only its owner is allowed to enable or disable bucket logging.
63+
For a bucket to be used as a log bucket, it must have bucket policy that allows that (even if the source bucket and the log bucket are owned by the same user or account).
64+
The bucket policy must allow the `s3:PutObject` action for the log bucket, to be perfomed by the `logging.s3.amazonaws.com` service principal.
65+
It should also specify the source bucket and account that are expected to write logs to it. For example:
66+
67+
::
68+
69+
{
70+
"Version": "2012-10-17",
71+
"Statement": [
72+
{
73+
"Sid": "AllowLoggingFromSourceBucket",
74+
"Effect": "Allow",
75+
"Principal": {
76+
"Service": "logging.s3.amazonaws.com"
77+
},
78+
"Action": "s3:PutObject",
79+
"Resource": "arn:aws:s3:::log-bucket-name/prefix*",
80+
"Condition": {
81+
"StringEquals": {
82+
"aws:SourceAccount": "source-account-id"
83+
},
84+
"ArnLike": {
85+
"aws:SourceArn": "arn:aws:s3:::source-bucket-name"
86+
}
87+
}
88+
}
89+
]
90+
}
91+
92+
93+
Bucket Logging Quota
94+
--------------------
95+
Bucket and user quota are applied on the log bucket. Quota is checked every time a log record is written,
96+
and updated when the log object is added to the log bucket. In "Journal" mode, if the quota is exceeded, the logging operation will fail
97+
and as a result the bucket operation will also fail. In "Standard" mode, the logging operation will be skipped, but the bucket operation will continue.
98+
99+
54100
Bucket Logging REST API
55101
-----------------------
56102
Detailed under: `Bucket Operations`_.

0 commit comments

Comments
 (0)