56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
id: cloudtrail-log-integrity
|
|
info:
|
|
name: CloudTrail Log Integrity Validation not Enabled
|
|
author: princechaddha
|
|
severity: high
|
|
description: |
|
|
Ensure CloudTrail log file integrity validation is enabled to detect unauthorized file modifications.
|
|
impact: |
|
|
Without log file integrity validation, it's harder to detect if CloudTrail logs have been tampered with, potentially hiding malicious activity.
|
|
remediation: |
|
|
Enable log file integrity validation on all CloudTrail trails to ensure the integrity and authenticity of your logs.
|
|
reference:
|
|
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-log-file-validation-intro.html
|
|
tags: cloud,devops,aws,amazon,cloudtrail,aws-cloud-config
|
|
|
|
variables:
|
|
region: "ap-south-1"
|
|
|
|
flow: |
|
|
code(1)
|
|
for(let CloudTrail of iterate(template.cloudtrailname)){
|
|
set("trail", CloudTrail)
|
|
code(2)
|
|
}
|
|
|
|
self-contained: true
|
|
code:
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
aws cloudtrail list-trails --region $region --query 'Trails[*].Name' --output json
|
|
|
|
extractors:
|
|
- type: json
|
|
name: cloudtrailname
|
|
internal: true
|
|
json:
|
|
- '.[]'
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
aws cloudtrail describe-trails --region $region --trail-name-list $trail --query 'trailList[*].LogFileValidationEnabled'
|
|
|
|
matchers:
|
|
- type: word
|
|
words:
|
|
- "false"
|
|
|
|
extractors:
|
|
- type: dsl
|
|
dsl:
|
|
- '"The log file integrity validation is not enabled for CloudTrail trail" + trail'
|
|
# digest: 4a0a00473045022100facdee59eb1d2eca53313cf4f8de941c2f7a0857645f153ad2a64c81b51d9a67022059981aa1842b49de13fc78b6673e74c755632f673f08c402ad66f59074cc2e37:922c64590222798bb761d5b6d8e72950 |