nuclei-templates/cloud/aws/cloudtrail/cloudtrail-logs-not-encrypt...

56 lines
1.7 KiB
YAML
Raw Normal View History

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:
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[*].KmsKeyId'
matchers:
- type: word
words:
- "[]"
extractors:
- type: dsl
dsl:
- '"CloudTrail trail" + trail + " is not configured to encrypt log files using SSE-KMS encryption"'
# digest: 490a004630440220615ff60f92dc1540ae499c543e657c18d430e7b6b08291befb395d465b0dfa280220748efe3b2771beb250f0c50040e94c8c0a9a37f60fcb6c88bbe9ff55b5362fa1:922c64590222798bb761d5b6d8e72950