Description
An RDB group rule with cidr_ip = "0.0.0.0/0" allows every IPv4 source. Check which database uses the group.
Potential impact
A public route can expose the database to connection attempts from those sources. Database authentication and permissions still govern access to data.
Remediation
Check all rules in the security group attached to the database. Allow only the application and administration sources that need access. Use private routes where possible and test from both an approved and an excluded client.
Examples
The example group narrows the source to 10.0.0.0/16. Verify the group’s database association and substitute the range your clients need.
Before
hcl
resource "nifcloud_db_security_group" "db_access" {
group_name = "example"
availability_zone = "east-11"
rule {
cidr_ip = "0.0.0.0/0"
}
}
After
hcl
resource "nifcloud_db_security_group" "db_access" {
group_name = "example"
availability_zone = "east-11"
rule {
cidr_ip = "10.0.0.0/16"
}
}