Skip to main content

More Info:

ElasticSearch domains should be configured to log data to CloudWatch. ElasticSearch domains should be configured with logging enabled with logs sent to CloudWatch for analysis and long-term storage.

Risk Level

Low

Address

Operational Maturity, Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • GDPR
  • HIPAA
  • ISO 27001
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • Reserve Bank of India (RBI) Cyber Security Framework
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

Sure, here are the step-by-step instructions to remediate the Elasticsearch logging misconfiguration in AWS:
  1. Log in to your AWS Management Console.
  2. Navigate to the Elasticsearch service.
  3. Select the Elasticsearch domain that you want to remediate.
  4. Click on the “Actions” drop-down menu and select “Modify Domain.”
  5. Scroll down to the “Logging” section and ensure that the “Enabled” option is selected.
  6. In the “Log Publishing Options” section, select the desired log types that you want to publish to CloudWatch Logs.
  7. In the “Log Publishing Options” section, select the desired log retention period.
  8. Click on the “Submit” button to save the changes.
Once you have completed these steps, Elasticsearch logging will be enabled for the selected Elasticsearch domain, and logs will be published to CloudWatch Logs for the selected log types and retention period.

To remediate the ElasticSearch logging misconfiguration in AWS using AWS CLI, follow these steps:
  1. Open the AWS CLI on your local machine or EC2 instance.
  2. Run the following command to enable logging for your ElasticSearch domain:
Replace <domain-name> with the name of your ElasticSearch domain and <log-group-arn> with the ARN of the CloudWatch Logs log group where you want to store your ElasticSearch logs.
  1. Verify that logging is enabled by running the following command:
This will return the current configuration of your ElasticSearch domain. Check that the LogPublishingOptions property has the correct values for each log type.
  1. Wait for a few minutes for the changes to take effect and start seeing the logs in your CloudWatch Logs log group.
By following these steps, you have successfully remediated the ElasticSearch logging misconfiguration in AWS using AWS CLI.
To remediate the misconfiguration of ElasticSearch not having logging enabled in AWS using Python, you can follow these steps:
  1. Install the AWS SDK for Python (Boto3) using pip:
  1. Create an AWS ElasticSearch client using Boto3:
  1. Check if logging is enabled for the ElasticSearch domain:
  1. If logging is not enabled, enable it by updating the ElasticSearch domain configuration:
Note: You will need to replace your-domain-name and your-log-group-arn with your own domain name and CloudWatch Logs log group ARN, respectively.
This updates the domain’s log publishing configuration, enabling ES_APPLICATION_LOGS to a specified CloudWatch log group; Terraform will replace the entire log_publishing_options configuration on each apply, so all required log types must be included in this resource. The domain enters a processing state during update but is not replaced.Verification: terraform plan should show:
  • aws_cloudwatch_log_group.opensearch_app_logs and aws_cloudwatch_log_resource_policy.opensearch_logs to be created.
  • aws_opensearch_domain.MY_DOMAIN to be updated in-place with log_publishing_options adding ES_APPLICATION_LOGS set to enabled = true and pointing to the new log group ARN.

Additional Reading: