π‘οΈ AWS OpenSearch Domain audit logging is not enabledπ’
- Contextual name: π‘οΈ Domain audit logging is not enabledπ’
- ID:
/ce/ca/aws/opensearch/domain-audit-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.5] OpenSearch domains should have audit logging enabled
- AWS Security Hub: [ES.5] Elasticsearch domains should have audit logging enabled
Descriptionβ
Descriptionβ
This policy identifies AWS OpenSearch Domains that are not configured to publish audit logs (
AUDIT_LOGS) to Amazon CloudWatch Logs.Rationaleβ
Audit logs capture user access and activity within an OpenSearch Service domain and are a critical security control for the following purposes:
- Forensic Analysis: Enables investigation of user actions, including who accessed specific data and what operations were performed.
- Unauthorized Access Detection: Helps identify failed authentication attempts and unauthorized access to restricted indices.
- Compliance: Supports adherence to regulatory and industry standards (such as SOC 2, HIPAA, and PCI DSS) that require monitoring and auditing access to sensitive data.
Auditβ
This policy flags an AWS OpenSearch Service domain as
INCOMPLIANTwhen theLog Publishing Optionsconfiguration is either empty or does not have the AUDIT_LOGS option enabled.
Remediationβ
Remediationβ
Enable Audit Log Publishing for OpenSearch Domainβ
To enable publishing of OpenSearch Service audit logs (
AUDIT_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 the placeholders with your actual values.
aws logs put-resource-policy \
--policy-name {{opensearch-log-publishing-policy}} \
--policy-document '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
... [see more](remediation.md)