Control: Elasticsearch domains should have audit logging enabled
Description
This control checks whether Elasticsearch domains have audit logging enabled. This control fails if an Elasticsearch domain does not have audit logging enabled.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.es_domain_audit_logging_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.es_domain_audit_logging_enabled --share
SQL
This control uses a named query:
select arn as resource, case when log_publishing_options -> 'AUDIT_LOGS' -> 'Enabled' = 'true' and log_publishing_options -> 'AUDIT_LOGS' -> 'CloudWatchLogsLogGroupArn' is not null then 'ok' else 'alarm' end as status, case when log_publishing_options -> 'AUDIT_LOGS' -> 'Enabled' = 'true' and log_publishing_options -> 'AUDIT_LOGS' -> 'CloudWatchLogsLogGroupArn' is not null then title || ' audit logging enabled.' else title || ' audit logging disabled.' end as reason , region, account_idfrom aws_elasticsearch_domain;