CloudTrail SNS Topic Name Undefined

  • Query id: 5ba316a9-c466-4ec1-8d5b-bc6107dc9a92
  • Query name: CloudTrail SNS Topic Name Undefined
  • Platform: Ansible
  • Severity: Medium
  • Category: Observability
  • URL: Github

Description

Check if SNS topic name is set for CloudTrail
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - yaml file
- name: no sns topic name
  community.aws.cloudtrail:
    state: present
    name: default
    s3_bucket_name: mylogbucket
    s3_key_prefix: cloudtrail
    region: us-east-1
- name: sns topic name defined
  community.aws.cloudtrail:
    state: present
    name: default
    s3_bucket_name: mylogbucket
    s3_key_prefix: cloudtrail
    region: us-east-1
    sns_topic_name:

Code samples without security vulnerabilities

Negative test num. 1 - yaml file
- name: sns topic name defined
  community.aws.cloudtrail:
    state: present
    name: default
    s3_bucket_name: mylogbucket
    s3_key_prefix: cloudtrail
    region: us-east-1
    sns_topic_name: some_topic_name