probator_auditor_cloudtrail.
CloudTrailAuditor
¶CloudTrail auditor
Ensures that CloudTrail is enabled and logging to a central location and that SNS/SQS notifications are enabled and being sent to the correct queues for the CloudTrail Logs application
run
(*args, **kwargs)¶Entry point for the scheduler
Parameters: |
|
---|---|
Returns: | None |
validate_sqs_policy
(accounts)¶Given a list of accounts, ensures that the SQS policy allows all the accounts to write to the queue
Parameters: | accounts (list of Account ) – List of accounts |
---|---|
Returns: | None |
probator_auditor_cloudtrail.
CloudTrail
(account, bucket_name, bucket_region, logger)¶CloudTrail object
validate_trail_settings
(ct, aws_region, trail)¶Validates logging, SNS and S3 settings for the global trail.
Has the capability to:
create_sns_topic
(region)¶Creates an SNS topic if needed. Returns the ARN if the created SNS topic
Parameters: | region (str) – Region name |
---|---|
Returns: | str |
validate_sns_topic_subscription
(region)¶Validates SQS subscription to the SNS topic. Returns True if subscribed or False if not subscribed or topic is missing
Parameters: | region (str) – Name of AWS Region |
---|---|
Returns: | bool |
subscribe_sns_topic_to_sqs
(region)¶Subscribe SQS to the SNS topic. Returns the ARN of the SNS Topic subscribed
Parameters: | region (str) – Name of the AWS region |
---|---|
Returns: | str |
create_cloudtrail
(region)¶Creates a new CloudTrail Trail
Parameters: | region (str) – Name of the AWS region |
---|---|
Returns: | None |
enable_sns_notification
(region, trailName)¶Enable SNS notifications for a Trail
Parameters: |
|
---|---|
Returns: | None |
start_logging
(region, name)¶Turn on logging for a CloudTrail Trail
Parameters: |
|
---|---|
Returns: | None |
set_s3_prefix
(region, name)¶Sets the S3 prefix for a CloudTrail Trail
Parameters: |
|
---|---|
Returns: | None |
set_s3_bucket
(region, name, bucketName)¶Sets the S3 bucket location for logfile delivery
Parameters: |
|
---|---|
Returns: | None |
create_s3_bucket
(bucket_name, bucket_region, bucket_account, template)¶Creates the S3 bucket on the account specified as the destination account for log files
Parameters: |
|
---|---|
Returns: | None |