Checks that OpenSearch domains are configured within a VPC and not publicly accessible, minimizing exposure to external threats.
Rule | OpenSearch domains should not be publicly accessible |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Critical |
OpenSearch domains should not be publicly accessible for AWS Foundational Security Best Practices
Description:
OpenSearch domains, which are used for searching, analyzing, and visualizing data, should not be publicly accessible to avoid unauthorized access and potential security breaches. Allowing public access to OpenSearch domains can expose sensitive data and configuration information to threat actors, compromising the integrity and confidentiality of the data stored in the domain.
Troubleshooting Steps:
Remediation Steps:
Relevant Code/CLI Commands:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": "es:*",
"Resource": "arn:aws:es:region:account-id:domain/domain-name/*",
"Condition": {
"IpAddress": {
"NotIpAddress": {
"aws:SourceIp": [
"x.x.x.x/x",
"y.y.y.y/y"
]
}
}
}
}
]
}
CLI Commands:
aws es update-elasticsearch-domain-config --domain-name example-domain --access-policies file://access-policy.json
aws es update-elasticsearch-domain-config --domain-name example-domain --vpc-options SubnetIds=subnet-123456,SecurityGroupIds=sg-789012
By following these steps and implementing the provided code snippets, you can ensure that your OpenSearch domains are not publicly accessible, enhancing the security posture of your AWS environment.