RDS instance may receive a public IP address

Disable public access for internal RDS instances and configure private connectivity and security groups to reduce unnecessary external access.

Description

When creating an instance, Crossplane AWS provider v0.17.0 leaves publiclyAccessible out of the AWS request if you omit it. The RDS creation default depends on the VPC and DB subnet group. For an existing instance, Crossplane fills the omitted setting from the observed value.

Potential impact

A public address, an internet route and permissive network rules can allow unintended clients to attempt logins. Database authentication and privileges still control access to data.

Remediation

  • Set publiclyAccessible: false for internal databases after preparing private connections for applications and administrators. Test the required connections after applying the change.
  • Check the route table of each subnet in DBSubnetGroup. If public access is necessary, restrict security groups to approved sources and DB ports, authenticate clients and encrypt traffic.

Examples

These excerpts use Crossplane AWS v0.17.0. Supply the engine and instance class, substitute the subnet IDs and group name, and configure routing and security groups.

Before

yaml
apiVersion: database.aws.crossplane.io/v1beta1
kind: RDSInstance
metadata:
  name: sample-cluster3
spec:
  forProvider:
    publiclyAccessible: true
    dbSubnetGroupName: my-db-subnet-group

---

apiVersion: database.aws.crossplane.io/v1beta1
kind: DBSubnetGroup
metadata:
  name: my-db-subnet-group
spec:
  forProvider:
    description: "My DB Subnet Group"
    subnetIds:
      - subnet-12345678
      - subnet-87654321

After

yaml
apiVersion: database.aws.crossplane.io/v1beta1
kind: RDSInstance
metadata:
  name: sample-cluster3
spec:
  forProvider:
    publiclyAccessible: false
    dbSubnetGroupName: my-db-subnet-group

---

apiVersion: database.aws.crossplane.io/v1beta1
kind: DBSubnetGroup
metadata:
  name: my-db-subnet-group
spec:
  forProvider:
    description: "My DB Subnet Group"
    subnetIds:
      - subnet-12345678
      - subnet-87654321

Explanation:

  • Before: The instance requests a public address. An internet gateway in the VPC alone does not make its subnet public.
  • After: The instance requests private addressing. Verify the deployed setting and the application’s connection.

References