π‘οΈ AWS OpenSearch Domain error logging is not enabledπ’
- Contextual name: π‘οΈ Domain error logging is not enabledπ’
- ID:
/ce/ca/aws/opensearch/domain-error-logging - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logicβ
- π§ prod.logic.yamlπ’
Similar Policiesβ
- AWS Security Hub: [Opensearch.4] OpenSearch domain error logging to CloudWatch Logs should be enabled
- AWS Security Hub: [ES.4] Elasticsearch domain error logging to CloudWatch Logs should be enabled
Descriptionβ
Descriptionβ
This policy identifies AWS OpenSearch Domains that are not configured to publish error logs (
ES_APPLICATION_LOGS) to Amazon CloudWatch Logs.Rationaleβ
AWS OpenSearch Service error logs provide critical visibility into errors and warnings generated by domain nodes. Enabling these logs is essential for the following reasons:
- Incident Response: Facilitates rapid identification and troubleshooting of issues that may lead to service disruptions or failed queries.
- Cluster Health Monitoring: Helps detect internal warnings and anomalies that could indicate potential stability or performance issues before they escalate.
Auditβ
This policy flags an AWS OpenSearch Service domain as
INCOMPLIANTwhen theLog Publishing Optionsconfiguration is either empty or does not have the ES_APPLICATION_LOGS option enabled.
Remediationβ
Remediationβ
Enable Error Log Publishing for OpenSearch Domainβ
To enable publishing of OpenSearch Service error logs (
ES_APPLICATION_LOGS) to Amazon CloudWatch Logs, perform the following steps.Step 1: Create a CloudWatch Log Groupβ
If a log group does not already exist, create one using the AWS CLI:
aws logs create-log-group \
--log-group-name {{log-group-name}}Step 2: Retrieve the Log Group ARNβ
Obtain the ARN of the log group, which will be required in later steps:
aws logs describe-log-groups \
--log-group-name-prefix {{log-group-name}}
--query logGroups[*].arnStep 3: Grant OpenSearch Service Permission to Write Logsβ
Attach a resource-based policy to CloudWatch Logs that allows OpenSearch Service to create log streams and publish log events. Replace
cw_log_group_arnwith your actual log group ARN.aws logs put-resource-policy \
--policy-name {{opensearch-log-publishing-policy}} \
--policy-document '{
"Version": "2012-10-17",
"Statement": [
{
... [see more](remediation.md)