Description
publicly_accessible applies to each Neptune instance. A public endpoint needs a network path, an allowed cluster security group rule and IAM database authentication. IAM permissions still control access to graph data.
Potential impact
A reachable instance can receive unwanted connection attempts. Compromised credentials or excess IAM permissions can expose or alter graph data.
Remediation
- Prepare a private path for required clients before setting
publicly_accessible = falseon every instance that should be private. - Restrict the cluster security groups to the intended clients and database ports. Grant only the IAM data-access permissions clients need.
- Test authorized queries and blocked connections through the endpoints used by writers and readers, including after failover.
Examples
Use a subnet group that matches the referenced cluster and an instance class supported by the Region and engine. Public endpoints require Neptune 1.4.6.x or later, IAM authentication on the cluster and public subnet routes to an internet gateway.
Before
resource "aws_neptune_cluster_instance" "neptune_instance" {
cluster_identifier = aws_neptune_cluster.default.id
engine = "neptune"
instance_class = "db.r4.large"
publicly_accessible = true
}
true requests public access for this instance.
After
resource "aws_neptune_cluster_instance" "neptune_instance" {
cluster_identifier = aws_neptune_cluster.default.id
engine = "neptune"
instance_class = "db.r4.large"
publicly_accessible = false
}
false disables public access for this instance. Check the setting on the other cluster instances too.