π AWS CloudTrail S3 Bucket Access Logging is not enabled. π’
- Contextual name: π S3 Bucket Access Logging is not enabled. π’
- ID:
/ce/ca/aws/cloudtrail/s3-bucket-access-logging
- Located in: π AWS CloudTrail
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
RELIABILITY
Similar Policiesβ
- Cloud Conformity
- Internal
dec-x-e0014333
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-e0014333 | 2 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Server access logging generates a log that contains access records for each request made to your S3 bucket. An access log record contains details about the request, such as the request type, the resources specified in the request worked, and the time and date the request was processed. It is recommended that server access logging be enabled on the CloudTrail S3 bucket.
Rationaleβ
By enabling S3 bucket logging on target S3 buckets, it is possible to capture all events which may affect objects within any target buckets. Configuring logs to be placed in a separate bucket allows access to log information which can be useful in security and incident response workflows.
Auditβ
Perform the following ensure the CloudTrail S3 bucket has access logging is enabled:
From Consoleβ
- Go to the Amazon CloudTrail console at https://console.aws.amazon.com/cloudtrail/home.
- In the API activity history pane on the left, click
Trails
.- In the Trails pane, note the bucket names in the
S3 bucket
column.- Sign in to the AWS Management Console and open the S3 console at https://console.aws.amazon.com/s3.
... see more
Remediationβ
Remediationβ
Perform the following to enable S3 bucket logging:
From Consoleβ
- Sign in to the AWS Management Console and open the S3 console at https://console.aws.amazon.com/s3.
- Under
All Buckets
click on the target S3 bucket.- Click on
Properties
in the top right of the console.- Under
Bucket: <s3_bucket_for_cloudtrail>
click onLogging
.- Configure bucket logging:
- Click on the
Enabled
checkbox.- Select Target Bucket from list.
- Enter a Target Prefix.
- Click
Save
.From Command Lineβ
- Get the name of the S3 bucket that CloudTrail is logging to:
aws cloudtrail describe-trails --region <region-name> --query trailList[*].S3BucketName
- Copy and add target bucket name at
<Logging_BucketName>
, Prefix for logfile at<LogFilePrefix>
and optionally add an email address in the following template and save it as<FileName.Json>
:{
"LoggingEnabled": {
"TargetBucket": "<Logging_BucketName>",
"TargetPrefix": "<LogFilePrefix>",
"TargetGrants": [
... [see more](remediation.md)