CloudTrail Multi Region Disabled

  • Query id: 6ad087d7-a509-4b20-b853-9ef6f5ebaa98
  • Query name: CloudTrail Multi Region Disabled
  • Platform: Ansible
  • Severity: Medium
  • Category: Observability
  • URL: Github

Description

CloudTrail multi region should be enabled, which means attribute 'is_multi_region_trail' should be set to true
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - yaml file
- name: example1
  community.aws.cloudtrail:
    state: present
    name: default
    s3_bucket_name: mylogbucket
    region: us-east-1
    is_multi_region_trail: false
    enable_log_file_validation: true
    cloudwatch_logs_role_arn: "arn:aws:iam::123456789012:role/CloudTrail_CloudWatchLogs_Role"
    cloudwatch_logs_log_group_arn: "arn:aws:logs:us-east-1:123456789012:log-group:CloudTrail/DefaultLogGroup:*"
    kms_key_id: "alias/MyAliasName"
    tags:
      environment: dev
      Name: default

Code samples without security vulnerabilities

Negative test num. 1 - yaml file
- name: example1
  community.aws.cloudtrail:
    state: present
    name: default
    s3_bucket_name: mylogbucket
    region: us-east-1
    is_multi_region_trail: true
    enable_log_file_validation: true
    cloudwatch_logs_role_arn: arn:aws:iam::123456789012:role/CloudTrail_CloudWatchLogs_Role
    cloudwatch_logs_log_group_arn: arn:aws:logs:us-east-1:123456789012:log-group:CloudTrail/DefaultLogGroup:*
    kms_key_id: alias/MyAliasName
    tags:
      environment: dev
      Name: default