More Info:

Your AWS CloudTrail logging bucket should use the Multi-Factor Authentication (MFA) Delete feature in order to prevent the deletion of any versioned log files.

Risk Level

High

Address

Security

Compliance Standards

AWSWAF

Triage and Remediation

Remediation

Sure, here are the step-by-step instructions to remediate the issue of CloudTrail Logging Bucket Should Use MFA Delete Feature in AWS:

  1. Log in to your AWS console.
  2. Navigate to the S3 service.
  3. Find the S3 bucket that is being used for CloudTrail logging.
  4. Click on the bucket name to open its properties.
  5. Click on the Permissions tab.
  6. Scroll down to the “Bucket Policy” section.
  7. Click on “Edit”.
  8. Add the following JSON code to the Bucket Policy:
{
  "Version": "2012-10-17",
  "Id": "PutObjPolicy",
  "Statement": [
    {
      "Sid": "DenyUnEncryptedObjectUploads",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*",
      "Condition": {
        "Null": {
          "s3:x-amz-server-side-encryption": "true"
        }
      }
    },
    {
      "Sid": "DenyUnEncryptedObjectMultiPartUploads",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*",
      "Condition": {
        "Null": {
          "s3:x-amz-server-side-encryption": "true"
        },
        "NumericGreaterThanEquals": {
          "s3:x-amz-content-sha256": 1
        }
      }
    },
    {
      "Sid": "DenyDeleteWithoutMFA",
      "Effect": "Deny",
      "Principal": "*",
      "Action": [
        "s3:DeleteObject",
        "s3:DeleteObjectVersion",
        "s3:PutLifecycleConfiguration",
        "s3:PutBucketVersioning",
        "s3:PutBucketAcl",
        "s3:PutBucketPolicy",
        "s3:PutBucketCors",
        "s3:PutBucketLifecycleConfiguration",
        "s3:PutBucketReplication",
        "s3:DeleteBucket",
        "s3:PutObject"
      ],
      "Resource": "arn:aws:s3:::your-bucket-name/*",
      "Condition": {
        "Null": {
          "s3:authType": "MFA"
        }
      }
    }
  ]
}
  1. Replace “your-bucket-name” with the actual name of your S3 bucket.
  2. Click on “Save Changes” to update the Bucket Policy.

This will add a DenyDeleteWithoutMFA policy statement to the bucket policy, which will prevent any deletion of objects or modification of bucket policies without MFA authentication.

Additional Reading: