turbot/steampipe-mod-aws-compliance

Control: Elasticsearch domain error logging to CloudWatch Logs should be enabled

Description

This control checks whether Elasticsearch domains are configured to send error logs to CloudWatch Logs.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.es_domain_error_logging_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.es_domain_error_logging_enabled --share

SQL

This control uses a named query:

select
arn as resource,
case
when
log_publishing_options -> 'ES_APPLICATION_LOGS' -> 'Enabled' = 'true'
and log_publishing_options -> 'ES_APPLICATION_LOGS' -> 'CloudWatchLogsLogGroupArn' is not null then 'ok'
else 'alarm'
end as status,
case
when
log_publishing_options -> 'ES_APPLICATION_LOGS' -> 'Enabled' = 'true'
and log_publishing_options -> 'ES_APPLICATION_LOGS' -> 'CloudWatchLogsLogGroupArn' is not null then title || ' error logging enabled.'
else title || ' error logging disabled.'
end as reason
, region, account_id
from
aws_elasticsearch_domain;

Tags