Review default RDS port use

Review the default RDS port against operational policy, and protect the database with network restrictions, authentication and TLS.

Description

RDS for Oracle uses port 1521 by default. To restrict access, check the network paths to the instance and the permissions inside the database.

Potential impact

Broad network access and excessive database permissions can expose data to unauthorized reads or changes. Changing the port reboots an existing instance immediately.

Remediation

Restrict the security group to required clients and use authentication, least-privilege database permissions and TLS. If you need a custom port, choose one the engine supports and review the change set. Coordinate the reboot with updates to applications, security groups and monitoring.

Examples

The Oracle examples change 1521 to 1522. Supply a supported DBInstanceClass, storage and licensing settings, and pass MasterUserPassword through a secret or a NoEcho parameter.

Before

yaml
Resources:
  MyDB:
    Type: AWS::RDS::DBInstance
    Properties:
      Engine: oracle-ee
      DBInstanceClass: !Ref DBInstanceClass
      MasterUsername: master
      MasterUserPassword: !Ref MasterUserPassword
      BackupRetentionPeriod: 7
      Port: 1521

After

yaml
Resources:
  MyDB:
    Type: AWS::RDS::DBInstance
    Properties:
      Engine: oracle-ee
      DBInstanceClass: !Ref DBInstanceClass
      MasterUsername: master
      MasterUserPassword: !Ref MasterUserPassword
      BackupRetentionPeriod: 7
      Port: 1522

References