Overview
S3 bucket logging, or S3 server access logging, is a native S3 feature that VAST Cluster supports on S3-enabled views.
With S3 bucket logging, you can set up detailed recording of S3 operations on your bucket or bucket objects, with the logs written to another bucket.
Note
Operations performed through other access protocols are not subject to S3 bucket logging.
When the source bucket has S3 bucket logging enabled, VAST Cluster creates a log entry in AWS log format for each S3 request made to the source bucket, and periodically uploads the log objects to a destination bucket. The format of log object keys can be configured to allow for date-based partitioning of log objects.
You can set up S3 bucket logging in VAST Web UI, VAST CLI or via VAST Cluster S3 API.
Permissions for accessing the log objects in the destination bucket can be managed via a bucket policy, an identity policy, or when sending a PutBucketLogging request to the VAST Cluster S3 server.
To manage retention of log objects, configure VAST Web UI lifecycle rules on the destination bucket.
Destination Bucket Requirements
The destination bucket must meet the following requirements:
The destination bucket is on a view that has S3 protocol enabled.
The view policy of the destination bucket view is set to S3 Native security flavor.
The destination bucket has the same bucket owner as the source bucket.
The destination bucket is not the same as the source bucket.
The destination bucket does not have S3 object locking enabled.
Configuring S3 Bucket Logging in VAST Web UI
You configure S3 bucket logging for a bucket when creating or editing a view that exposes the bucket to be logged (the source bucket).
In the Bucket Logging tab of the Create View or Update View dialog, make the following settings:
Enable bucket logging | Toggle on or off to enable or disable S3 bucket logging for the bucket. By default, bucket logging is disabled. |
Destination bucket | Select the bucket to store the logs. |
Prefix | Optionally, specify a prefix that will be prepended to each key of a log object uploaded to the destination bucket. This prefix can be used to categorize log objects; for example, if you use the same destination bucket for multiple source buckets. The prefix can be up to 128 characters and must follow S3 object naming rules. |
Key format | Select the format for the log object keys:
In the formats:
|
Timestamp | If you specified the Key format that enables date-based partitioning of log objects, select the type of timestamp to be used when generating log object keys:
|
Configuring S3 Bucket Logging via VAST S3 API
VAST Cluster supports the following S3 requests that are specific to S3 bucket logging:
PutBucketLoggingis used to configure S3 bucket logging for a bucket and set permissions for accessing the log objects in the destination bucket (see here for an example).GetBucketLoggingreturns the S3 bucket logging configuration for the bucket (see here for an example).
The following users are able to configure S3 bucket logging and return logging configuration via VAST S3 API:
The bucket owner
Users allowed to do so by applicable identity or bucket policy
Setting Permissions for Log Objects in the Destination Bucket
Permissions for accessing the log objects in the destination bucket can be managed via a bucket policy, an identity policy, through a PutBucketLogging request, or based on the destination bucket ACL.
To set permissions through a PutBucketLogging request (see here for an example):
Ensure that the destination bucket has ACLs enabled. If ACLs are disabled for the destination bucket, a PutBucketLogging request that sets grantees for this bucket would fail.
In the
Granteeelement of the request, specify grantees byEmailAddress.In the
Permissionelement of the request, specify the permissions provided to the grantee.These permissions are mapped to bucket ACL entries as follows:
Permission in PutBucketLogging Request
Permission in Bucket ACL
FULL_CONTROL
FULL_CONTROL
READ
READ
WRITE
WRITE
READ_ACP
WRITE_ACP
Note
Permissions specified in the PutBucketLogging request override permissions in the existing bucket ACL.
Bucket Log Format
The S3 bucket log is created in AWS log format. Each entry in the log includes the following fields:
Field | Description |
|---|---|
Bucket owner | The owner of the bucket being logged, in the format |
Bucket | The name of the bucket being logged. |
Time | The UTC timestamp of when the request was received, in |
Remote IP | The IP address from which the request was received. |
Requester | The user which sent the request, in the format |
Request ID | The ID set by the server for this request. |
Operation | The requested operation in the |
Key | The name of the object specified in the request. |
Request URI | The |
HTTP status | The HTTP status code of the response. |
Error code |
|
Bytes sent | Response bytes sent, excluding HTTP protocol overhead. |
Object size | The size (in bytes) of the object specified in the request |
Total time | The time (in milliseconds) elapsed from when the server received the request to when it sent the last byte of the response. |
Turn-around time | The time (in milliseconds) elapsed from when the server received the last byte of the request to when it sent the first byte of the response. |
Referer | The value of the |
User agent | The value of the |
Version ID | The ID of the object version, if applicable. |
Host ID | This field is set to be the same as the Request ID. |
Signature version | The version of the signature used to authenticate the request ( |
Cipher suite | If HTTPS was used, this field specifies the negotiated SSL cipher. For HTTP, it is set to |
Authentication type | Whether the request was authenticated using the HTTP |
Host header | The value of the |
TLS version | The TLS version used, for example, |
Access point ARN | This field is set to |
aclRequired | Whether ACLs were used to authorize access: |
For example:
[myuser c-2024-09-12-111045-288000 [12/Sep/2024:11:18:21 +0000] 198.51.100.2 myuser 88033944677064 REST.PUT.TAGGING elbencho-198.51.100.4-S65536-10485760/dir0/dir1/r0/d1/r0-f2 "PUT /c-2024-09-12-111045-288000/elbencho-198.51.100.4-S65536-10485760/dir0/dir1/r0/d1/r0-f2?tagging HTTP/1.1" 200 0 - 1589570 10933984 10880249 "-" "aws-sdk-cpp/1.11.335 ua/2.0 md/aws-crt#0.26.8 os/Linux/3.10.0-957.27.2.el7.x86_64 md/arch#x86_64 lang/c++#C++17 md/GCC#13.2.1 cfg/retry-mode#standard api/S3ocore/1.34.61esource" 0 88033944677064 SigV4 - AuthHeader 198.51.100.3:9090090 - - Yes]