Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

added policy to check enable log validation for cloudtrail #1066

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
13 changes: 13 additions & 0 deletions avd_docs/aws/cloudtrail/AVD-AWS-0188/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

Cloudtrail log validation should be enabled to prevent tampering of log data

### Impact
<!-- Add Impact here -->

<!-- DO NOT CHANGE -->
{{ remediationActions }}

### Links
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-log-file-validation-intro.html


1 change: 1 addition & 0 deletions avd_docs/kubernetes/general/AVD-KSV-0108/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Services with external IP addresses allows direct access from the internet and m
### Impact
Kubernetes API server in all versions allow an attacker who is able to create a ClusterIP service and set the spec.externalIPs field, to intercept traffic to that IP address. Additionally, an attacker who is able to patch the status (which is considered a privileged operation and should not typically be granted to users) of a LoadBalancer service can set the status.loadBalancer.ingress.ip to similar effect.
https://www.cvedetails.com/cve/CVE-2020-8554/

SanaaYousaf marked this conversation as resolved.
Show resolved Hide resolved
<!-- DO NOT CHANGE -->
{{ remediationActions }}

Expand Down
2 changes: 1 addition & 1 deletion avd_docs/kubernetes/general/AVD-KSV-0109/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Storing secrets in configMaps is unsafe

### Impact
Unsafe storage of secret content in configMaps could lead to the information being compromised.
<!-- Add Impact here -->
SanaaYousaf marked this conversation as resolved.
Show resolved Hide resolved

<!-- DO NOT CHANGE -->
{{ remediationActions }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#METADATA
# title: "CloudTrail Log Validation"
# description: "Cloudtrail log validation should be enabled to prevent tampering of log data"
# scope: package
# schemas:
# - input: schema.input
# related_resources:
# - https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-log-file-validation-intro.html
# custom:
# avd_id: AVD-AWS-0188
# provider: aws
# service: cloudtrail
# severity: HIGH
# short_code: enable-log-validation
# recommended_action: "Log validation should be activated on Cloudtrail logs to prevent the tampering of the underlying data in the S3 bucket. It is feasible that a rogue actor compromising an AWS account might want to modify the log data to remove trace of their actions."
# input:
# selector:
# - type: cloud
package builtin.aws.cloudtrail.aws0188

deny[res] {
trail := input.aws.cloudtrail.trails[_]
not trail.enablelogfilevalidation.value
res := result.new("Trail does not have log validation enabled.", trail.enablelogfilevalidation)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package builtin.aws.cloudtrail.aws0188

test_detects_when_disabled {
r := deny with input as {"aws": {"cloudtrail": {"trails": [{"enablelogfilevalidation": {"value": false}}]}}}
count(r) == 1
}

test_when_enabled {
r := deny with input as {"aws": {"cloudtrail": {"trails": [{"enablelogfilevalidation": {"value": true}}]}}}
count(r) == 0
}