# 3.4 Ensure Server Access Logging is Enabled on the CloudTrail S3 Bucket (Automated)

- Source: https://support.icompaas.com/support/solutions/articles/62000233146-3-4-ensure-server-access-logging-is-enabled-on-the-cloudtrail-s3-bucket-automated-
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [AWS CIS V.4 Level 1 Benchmarks](https://support.icompaas.com/support/solutions/62000112671) › [CIS Control 3](https://support.icompaas.com/support/solutions/folders/62000169197)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

## Profile Applicability:

Level 1

## Description:

AWS Server Access Logging for CloudTrail S3 buckets provides detailed records of requests made to an S3 bucket, including:

-   The request type (e.g., PUT, GET, DELETE).
    
-   The resources accessed.
    
-   The time and date of the request.
    
-   The source IP address of the requestor.
    

By enabling access logging, you ensure visibility into API activity related to CloudTrail logs, enhancing security monitoring and incident response.

## Rationale:

1.  Provides detailed logs for all access to CloudTrail S3 buckets.
    
2.  Detects unauthorized access or suspicious activity.
    
3.  Helps ensure compliance with CIS, SOC 2, PCI-DSS, HIPAA, and ISO 27001.
    
4.  Aids in forensic analysis of security incidents.
    

Without S3 access logging, security teams have no way to monitor or audit access to CloudTrail logs!

## Impact:

Pros:

1.  Improves visibility into who accessed CloudTrail logs.
    
2.  Helps investigate unauthorized access attempts.
    
3.  Supports security auditing and compliance monitoring.
    

Cons:  
  1. Additional storage costs for logging S3 access events. Requires proper IAM permissions for logging configuration.

## Default Value:

S3 Server Access Logging is NOT enabled by default. Must be manually enabled for CloudTrail S3 buckets.

## Pre-Requisites:

 IAM permissions required:

-   s3:PutBucketLogging
    
-   s3:GetBucketLogging
    
-   s3:PutBucketAcl
    
-   s3:GetBucketAcl
    

AWS CLI installed for automation.

## Remediation:

## Test Plan:

Using AWS Console

Step 1: Check if CloudTrail S3 Bucket Has Logging Enabled

1.  Log in to the AWS Management Console
    
2.  Navigate to CloudTrail Console
    

      ![](https://support.icompaas.com/assets/kb/11f27910afd062d6.png)

3.  Click Trails in the left navigation pane
    

           ![](https://support.icompaas.com/assets/kb/93ee27ccf44c769f.png)

4.  Identify the S3 bucket name where CloudTrail logs are stored
    
5.  Open the S3 Console 
    

         ![](https://support.icompaas.com/assets/kb/51447b74a717dc79.png)

6.  Select the CloudTrail S3 bucket
    
7.  Click Properties
    
8.  Under Server Access Logging, ensure:
    
    -    Logging is enabled
        
    -    A Target Bucket is configured
        
9.  Repeat for all AWS Regions
    

-     If logging is enabled, no further action is needed.
-   If logging is disabled, follow remediation steps.

Using AWS CLI

Step 1: Identify CloudTrail S3 Bucket

aws cloudtrail describe-trails --query 'trailList\[\*\].S3BucketName'

 Expected Output:

\[

    "cloudtrail-logs-bucket"

\]

If output is empty, CloudTrail logging is not configured!

Step 2: Check If Logging Is Enabled on CloudTrail S3 Bucket

aws s3api get-bucket-logging --bucket <cloudtrail-logs-bucket>

Expected Output (if logging is enabled):

{

    "LoggingEnabled": {

        "TargetBucket": "s3-access-logs-bucket",

        "TargetPrefix": "cloudtrail-logs/"

    }

}

If output is empty, logging is NOT enabled on the CloudTrail bucket!

##   

## Implementation Steps:

**Method 1**: Enable S3 Server Access Logging via AWS Console

Step 1: Enable Logging on CloudTrail S3 Bucket

1.  Log in to the AWS Management Console
    
2.  Navigate to S3 Console → [AWS S3 Console](https://console.aws.amazon.com/s3)
    

![](https://support.icompaas.com/assets/kb/e3fd0d75cee0c03a.png)

3.  Select the CloudTrail S3 bucket
    

![](https://support.icompaas.com/assets/kb/d927b0e3624c3bc4.png)

4.  Click Properties
    

    ![](https://support.icompaas.com/assets/kb/464d1c9af9b116d7.png)

5.  Under Server Access Logging, click Edit
    

    ![](https://support.icompaas.com/assets/kb/91454574d4ddb937.png)

6.  Check "Enable Logging" 
    

      ![](https://support.icompaas.com/assets/kb/ef085a30060a02c5.png)

7.  Set Target Bucket (Choose a dedicated bucket for storing logs)
    
8.  Set Target Prefix (Optional, e.g., cloudtrail-logs/)
    
9.  Click Save
    

-    Repeat for all AWS Regions
    

**Method 2:** Enable S3 Server Access Logging via AWS CLI

Step 1: Set Up Logging Configuration File

Create a JSON configuration file (logging-config.json):

{
    "LoggingEnabled": {
        "TargetBucket": "s3-access-logs-bucket",
        "TargetPrefix": "cloudtrail-logs/"
    }
}

Step 2: Apply the Logging Configuration

aws s3api put-bucket-logging --bucket <cloudtrail-logs-bucket> --bucket-logging-status file://logging-config.json

-    Test successful if access logs are being generated.
    

## Backout Plan:

-   If enabling S3 access logging causes issues: Disable Logging via AWS CLI

 aws s3api put-bucket-logging --bucket <cloudtrail-logs-bucket> --bucket-logging-status '{}'

1.  Remove logging configurations via AWS Console
    
    -   Go to S3 Console
        
    -   Select CloudTrail S3 bucket
        
    -   Navigate to Properties
        
    -   Disable Logging
        

-    Ensure disabling logging is justified before proceeding.

##  References:

-   [AWS S3 Access Logging Documentation](https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html)
    
-   [AWS CLI Reference (S3 Bucket Logging)](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-logging.html)
    
-   [AWS CloudTrail Best Practices](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-best-practices.html)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
