OpenParable
Skip to content
← Back to skills

Cis AWS Foundations 4.4

DevOps & Security
cis-aws-foundations-4.4

Cis AWS Foundations 4.4 is an Agent Skill for devops & security published in the CyberStrikeus/CyberStrike repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Ensure that server access logging is enabled on the CloudTrail S3 bucket

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/CyberStrikeus/CyberStrike/blob/HEAD/.cyberstrike/skill/CIS_benchmarks/Cloud_Providers/AWS/CIS_Amazon_Web_Services_Foundations_Benchmark_v7.0.0/cis-aws-foundations-4.4/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/cis-aws-foundations-4-4, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Ensure that server access logging is enabled on the CloudTrail S3 bucket

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 server access logging on target S3 buckets, it is possible to capture all events that may affect objects within any target bucket. Configuring the logs to be placed in a separate bucket allows access to log information that can be useful in security and incident response workflows. In some environments (e.g., AWS Control Tower), logs may be delivered to the same bucket with appropriate prefixes, which is also an acceptable configuration.

Impact

N/A

Audit Procedure

Using AWS Console

  1. Go to the Amazon CloudTrail console at https://console.aws.amazon.com/cloudtrail/home.
  2. In the API activity history pane on the left, click Trails.
  3. In the Trails pane, note the bucket names in the S3 bucket column.
  4. Sign in to the AWS Management Console and open the S3 console at https://console.aws.amazon.com/s3.
  5. Under All Buckets click on a target S3 bucket.
  6. Click on Properties in the top right of the console.
  7. Scroll down to Server access logging.
  8. Ensure Server access logging is Enabled.
  9. Verify the Target bucket where logs are delivered.

Using AWS CLI

  1. Get the name of the S3 bucket that CloudTrail is logging to:
aws cloudtrail describe-trails --query 'trailList[*].S3BucketName'
  1. Ensure logging is enabled on the bucket:
aws s3api get-bucket-logging --bucket <s3-bucket-for-cloudtrail>

Ensure the command does not return an empty output.

Sample output for a bucket with logging enabled:

{
  "LoggingEnabled": {
    "TargetPrefix": "<log-file-prefix>",
    "TargetBucket": "<logging-bucket>"
  }
}

Expected Result

The CloudTrail S3 bucket has server access logging enabled with a valid TargetBucket and TargetPrefix configured.

Remediation

Using AWS Console

  1. Sign in to the AWS Management Console and open the S3 console at https://console.aws.amazon.com/s3.
  2. Under All Buckets click on the target S3 bucket.
  3. Click on Properties in the top right of the console.
  4. Under Server access logging, click Edit.
  5. Configure bucket logging:
    • Check the Enabled box.
    • Select a Target Bucket from the list.
    • Enter a Target Prefix.
  6. Click Save.

Using AWS CLI

  1. Get the name of the S3 bucket that CloudTrail is logging to:
aws cloudtrail describe-trails --region <region-name> --query trailList[*].S3BucketName
  1. Create a logging configuration file and populate the following values:
{
  "LoggingEnabled": {
    "TargetBucket": "<TargetBucket>",
    "TargetPrefix": "<TargetPrefix>",
    "TargetGrants": [
      {
        "Grantee": {
          "Type": "AmazonCustomerByEmail",
          "EmailAddress": ""
        },
        "Permission": "FULL_CONTROL"
      }
    ]
  }
}
  1. Save the file as <file>.json
  2. Apply the logging configuration:
aws s3api put-bucket-logging --bucket <bucket-name> --bucket-logging-status file://<file>.json

Default Value

By default, server access logging is disabled on S3 buckets, including those used for CloudTrail. Without enabling this setting, no record of access requests to the CloudTrail bucket is captured, leaving organizations without visibility into who accessed log files or how they were used.

References

  1. CCE-78918-0
  2. https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html
  3. https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html

CIS Controls

Controls VersionControlIG 1IG 2IG 3
v83.14 Log Sensitive Data Access - Log sensitive data access, including modification and disposal.x
v88.2 Collect Audit Logs - Collect audit logs. Ensure that logging, per the enterprise's audit log management process, has been enabled across enterprise assets.xxx
v76.2 Activate audit logging - Ensure that local logging has been enabled on all systems and networking devices.xxx
v714.9 Enforce Detail Logging for Access or Changes to Sensitive Data - Enforce detailed audit logging for access to sensitive data or changes to sensitive data.x

MITRE ATT&CK Mappings

Techniques / Sub-techniquesTacticsMitigations
TA0005, TA0009M1047

Profile

Level 1 | Manual