Skip to main content

More Info:

All your Elasticsearch Service (ES) clusters should be configured to allow access only to trusted AWS users and accounts in order to protect against unauthorized cross account access

Risk Level

High

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Well Architected Framework
  • 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
  • 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
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate the issue of Elasticsearch domains allowing cross-account access in AWS using the AWS console, follow these steps:
  1. Log in to the AWS Management Console.
  2. Navigate to the Elasticsearch service.
  3. Select the Elasticsearch domain that is allowing cross-account access.
  4. Click on the “Access” tab.
  5. In the “Access policies” section, click on the “Edit” button.
  6. Remove any entries that allow cross-account access.
  7. Add a new entry to the access policy that allows access only from trusted accounts.
  8. Click on the “Save changes” button to apply the new access policy.
  9. Verify that the Elasticsearch domain no longer allows cross-account access by attempting to access it from a different AWS account.
  10. Repeat the above steps for any other Elasticsearch domains that are allowing cross-account access.
By following these steps, you can remediate the issue of Elasticsearch domains allowing cross-account access in AWS.

To remediate the Elasticsearch Domains Should Not Allow Cross Account Access misconfiguration in AWS, you can follow the below steps using AWS CLI:
  1. Open the AWS CLI and run the following command to get the Elasticsearch domain ARN:
  2. Once you have the Elasticsearch domain ARN, run the following command to update the Elasticsearch domain access policy to restrict cross-account access:
    Replace <domain-name> with the name of your Elasticsearch domain and <domain-arn> with the ARN of your Elasticsearch domain.
  3. Verify that the access policy has been updated by running the following command:
    This command will return the current configuration of the Elasticsearch domain.
By following these steps, you can successfully remediate the Elasticsearch Domains Should Not Allow Cross Account Access misconfiguration in AWS.
To remediate the Elasticsearch Domains Should Not Allow Cross Account Access misconfiguration in AWS using Python, you can follow these steps:
  1. Create a new Elasticsearch Domain Policy that restricts cross-account access.
  1. Replace the existing Elasticsearch Domain Policy with the new policy.
Note: Replace the DomainName and Resource ARNs in the policy with your own Elasticsearch Domain and ARNs. Also, replace the PrincipalArn values in the policy with the ARNs of the IAM users or roles that should have access to the domain.
Changing access_policies does not force replacement of the domain, but misconfiguration can cause an outage by blocking legitimate access; review the principals and actions carefully before applying.For verification, terraform plan should show an in-place update on aws_opensearch_domain.this with a change only to the access_policies JSON (removal of any untrusted or cross-account principals and retention of only trusted ARNs).

Additional Reading: