π‘οΈ AWS OpenSearch Domain has a public endpointπ’
- Contextual name: π‘οΈ Domain has a public endpointπ’
- ID:
/ce/ca/aws/opensearch/domain-vpc-endpoint - 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.2] OpenSearch domains should not be publicly accessible
- AWS Security Hub: [ES.2] Elasticsearch domains should not be publicly accessible
Descriptionβ
Descriptionβ
This policy identifies AWS OpenSearch Domains that are configured with a public endpoint, making them accessible from the internet instead of being deployed within a VPC, which provides an additional layer of network security.
Rationaleβ
Hosting OpenSearch domains within a VPC isolates them from the public internet and allows you to control access using security groups and network ACLs. Conversely, exposing an OpenSearch domain through a public endpoint increases its attack surface, making it more susceptible to unauthorized access, data exfiltration, and denial-of-service (DoS) attacks.
Impactβ
Even when protected by fine-grained access control policies, a public endpoint remains a less secure configuration compared to VPC isolation.
Remediation requires re-creating the domain within a VPC and migrating data from the existing public domain to the new, VPC-based one.
Auditβ
This policy flags an AWS OpenSearch Domain as
INCOMPLIANTif theEndpointfield is not empty, indicating that the domain is configured with a public endpoint and does not reside within a VPC.
Remediationβ
Remediationβ
OpenSearch Domain Migration: Public to VPCβ
Prerequisitesβ
- Existing snapshot repository registered and functional
- IAM roles & permissions already configured for snapshot operations
- S3 bucket with appropriate access policies
- VPC infrastructure prepared (subnets, security groups, route tables)
- Application team engaged for coordinated cutover
Migration Stepsβ
1. Create a Snapshotβ
Take a manual snapshot from the existing public domain:
curl -XPUT -u {{master-username}}:{{password}} \
"https://{{public-endpoint}}/_snapshot/{{existing-repository}}/migration-$(date +%Y%m%d-%H%M)" \
?wait_for_completion=trueVerification:
curl -XGET -u {{master-username}}:{{password}} \
"https://{{public-endpoint}}/_snapshot/{{existing-repository}}/_all"2. Provision VPC Domainβ
Create the new domain with the same configuration:
aws opensearch create-domain \
--domain-name {{new-domain-name}} \
--vpc-options SubnetIds={{subnet-ids}},SecurityGroupIds={{security-group-ids}} \
... [see more](remediation.md)