2024-04-11 14:23:07 +00:00
|
|
|
id: cloudtrail-logs-not-encrypted
|
|
|
|
info:
|
|
|
|
name: CloudTrail Logs Not Encrypted
|
|
|
|
author: princechaddha
|
|
|
|
severity: medium
|
|
|
|
description: |
|
|
|
|
Ensure Amazon CloudTrail logs are encrypted at rest using AWS Key Management Service (KMS) to secure log data.
|
|
|
|
impact: |
|
|
|
|
Non-encrypted CloudTrail logs pose a risk of unauthorized access, compromising the integrity and confidentiality of log data.
|
|
|
|
remediation: |
|
|
|
|
Enable Server-Side Encryption (SSE) for CloudTrail logs using an AWS KMS key through the CloudTrail console or AWS CLI.
|
|
|
|
reference:
|
|
|
|
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html
|
|
|
|
tags: cloud,devops,aws,amazon,cloudtrail,aws-cloud-config
|
|
|
|
|
|
|
|
variables:
|
2024-05-13 15:30:13 +00:00
|
|
|
region: "us-east-1"
|
2024-04-11 14:23:07 +00:00
|
|
|
|
|
|
|
flow: |
|
|
|
|
code(1)
|
|
|
|
for(let CloudTrail of iterate(template.cloudtrailname)){
|
|
|
|
set("trail", CloudTrail)
|
2024-05-13 15:30:13 +00:00
|
|
|
set("region", template.trailregion)
|
2024-04-11 14:23:07 +00:00
|
|
|
code(2)
|
|
|
|
}
|
|
|
|
|
|
|
|
self-contained: true
|
|
|
|
code:
|
|
|
|
- engine:
|
|
|
|
- sh
|
|
|
|
- bash
|
|
|
|
source: |
|
2024-05-10 04:20:23 +00:00
|
|
|
aws cloudtrail list-trails --region $region --query 'Trails[*].[Name, HomeRegion]' --output json
|
2024-04-11 14:23:07 +00:00
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: json
|
|
|
|
name: cloudtrailname
|
|
|
|
internal: true
|
|
|
|
json:
|
2024-05-10 04:20:23 +00:00
|
|
|
- '.[] | .[0]'
|
|
|
|
|
|
|
|
- type: json
|
|
|
|
name: trailregion
|
|
|
|
internal: true
|
|
|
|
json:
|
|
|
|
- '.[] | .[1]'
|
2024-04-11 14:23:07 +00:00
|
|
|
|
|
|
|
- engine:
|
|
|
|
- sh
|
|
|
|
- bash
|
|
|
|
source: |
|
|
|
|
aws cloudtrail describe-trails --region $region --trail-name-list $trail --query 'trailList[*].KmsKeyId'
|
|
|
|
|
|
|
|
matchers:
|
|
|
|
- type: word
|
|
|
|
words:
|
|
|
|
- "[]"
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: dsl
|
|
|
|
dsl:
|
2024-05-10 04:20:23 +00:00
|
|
|
- '"CloudTrail trail " + trail + " is not configured to encrypt log files using SSE-KMS encryption"'
|
2024-05-13 17:51:00 +00:00
|
|
|
# digest: 4b0a00483046022100b39586900f3cb7a7ce2582be709c7b3d1b25bceaf0f6d35887c3a3d62bfff8d80221009aa3a72ddade09b522655349a54b6cb7e6e0ebd3b36d85b30899b283e77dc90d:922c64590222798bb761d5b6d8e72950
|