Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Ensure Rule Compliance: Object-level logging for read events in S3 bucket

Check and enable Object-level logging for read events in S3 bucket to ensure compliance with Logging standards.

RuleEnsure that Object-level logging for read events is enabled for S3 bucket
Frameworkcis_v130
Severity
Low

Ensure Object-level Logging for Read Events is Enabled for S3 Bucket (CIS v1.3.0)

Object-level logging records events at the object level for S3 buckets and can be used to track access to individual objects within your bucket. This level of logging is useful for security and compliance monitoring. According to the CIS AWS Foundations Benchmark v1.3.0, you should ensure that logging is enabled for all read events to help with post-incident analysis and forensic investigations.

Details of the Rule

  • Objective: To monitor and record all read (GET) events for the objects within an S3 bucket.
  • Rationale: Enables auditing of who has accessed what objects, which is critical for security and compliance.
  • CIS Benchmark ID: 2.7 "Ensure CloudTrail logs are enabled for all S3 bucket read events."

Troubleshooting Steps

If object-level logging for read events is not enabled, follow these steps to resolve:

  1. 1.

    Identify Affected Buckets: Detect which S3 buckets do not have object-level logging for read events enabled.

  2. 2.

    Verify AWS CloudTrail Configuration: Ensure that AWS CloudTrail is configured properly to log read events for the S3 buckets.

  3. 3.

    Enable Object-level Logging: For any buckets identified, you must enable object-level logging.

Necessary CLI Commands

Here's how to verify and enable object-level logging:

Verify Object-level Logging Status

aws s3api get-bucket-logging --bucket YOUR_BUCKET_NAME

Replace

YOUR_BUCKET_NAME
with the name of your bucket. If logging is enabled, you will see the logging configuration in the output.

Enable Object-level Logging

aws cloudtrail put-event-selectors \
  --trail-name YOUR_CLOUDTRAIL_NAME \
  --event-selectors '[{"ReadWriteType": "All","IncludeManagementEvents": true,"DataResources": [{"Type": "AWS::S3::Object","Values": ["arn:aws:s3:::YOUR_BUCKET_NAME/"]}], "ExcludeManagementEventSources": []}]'

Replace

YOUR_CLOUDTRAIL_NAME
and
YOUR_BUCKET_NAME
with your CloudTrail name and bucket name, respectively.

Step by Step Guide for Remediation

To ensure that object-level logging for read events is enabled for your bucket, perform the following steps:

Step 1: Configure CloudTrail

  • Go to the AWS Management Console.
  • Navigate to CloudTrail and choose Trails.
  • Select a trail or create a new one if one doesn’t exist.

Step 2: Enable Read Event Logging

  • Inside the Trail menu, look for Data Events and choose
    Add S3 bucket
    .
  • Specify the bucket that you need logging for.
  • Select
    Read
    write management events for that bucket.
  • Save the changes.

Step 3: Verify the Configuration

  • Ensure that the settings are correctly applied by running the CLI command to check bucket logging (as shown in the Verify Object-level Logging Status section).

Step 4: Monitor the Logs

  • Use CloudTrail event history or integrate with CloudWatch Logs to monitor and analyze the object-level logs.

By ensuring all steps are followed, the rule with respect to CIS v1.3.0 will be adhered to. This will facilitate meeting compliance requirements and improve your organization’s security posture on AWS. Remember, maintaining this logging is an ongoing effort and should be reviewed regularly as part of your security audits.

The process outlined improves SEO as it involves actionable CLI commands and steps that are search-relevant for users looking to enable S3 bucket logging in compliance with CIS benchmarks. The content is aimed to satisfy user intent and provide concise, step-by-step instructions, which enhances user experience and can contribute positively to SEO performance.

Is your System Free of Underlying Vulnerabilities?
Find Out Now