RDS IP allow-list is unrestricted or invalid

Replace unrestricted IPv4 ranges and invalid RDS allow-list entries with required client addresses, and review connection paths and database permissions.

Description

In alicloud_db_instance.security_ips, 0.0.0.0/0 puts every IPv4 source on the allow-list. RDS for MySQL treats 0.0.0.0 on its own as invalid.

Potential impact

With a public endpoint and a network path, unintended clients can attempt connections. Database authentication and privileges still govern data access.

Remediation

Replace unrestricted or invalid entries with the client IPs or CIDRs you need. For clients behind NAT, use the translated source IP. Check the allow-list’s network type and access granted by either the list or security groups. Use an internal endpoint when public access is unnecessary.

Examples

Adding a private range alongside 0.0.0.0/0 leaves all IPv4 sources on the first list. The second allows one address. Supply the actual addresses and supported engine, class and storage settings, and review connect_timeout. Inspect the plan, then test encrypted application and admin connections and verify that unapproved sources are denied.

Allowing all IPv4 addresses

hcl
resource "alicloud_db_instance" "default" {
  engine           = "MySQL"
  engine_version   = var.engine_version
  instance_type    = var.instance_type
  instance_storage = var.instance_storage
  security_ips     = ["0.0.0.0/0", "10.23.12.0/24"]

  parameters {
    name  = "connect_timeout"
    value = "50"
  }
}

Allowing only a required client

hcl
resource "alicloud_db_instance" "default" {
  engine           = "MySQL"
  engine_version   = var.engine_version
  instance_type    = var.instance_type
  instance_storage = var.instance_storage
  security_ips     = ["10.23.12.24"]

  parameters {
    name  = "connect_timeout"
    value = "50"
  }
}

References