turbot/steampipe-mod-aws-compliance

Control: 5 Elasticsearch domains should have audit logging enabled

Description

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

You should enable error logs for Elasticsearch domains and send those logs to CloudWatch Logs for retention and response. Domain error logs can assist with security and access audits, and can help to diagnose availability issues.

Remediation

For information on how to enable log publishing, see Enabling log publishing (console) in the Amazon OpenSearch Service Developer Guide.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.foundational_security_es_5

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.foundational_security_es_5 --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_id
from
aws_elasticsearch_domain;

Tags