By default, a new ApsaraDB RDS for SQL Server instance denies access from external devices. For security, you must configure an IP address whitelist to allow access only from trusted IP addresses. For enhanced security, configure and regularly maintain the IP address whitelist immediately after you create an instance. Configuring an IP address whitelist does not affect the normal operation of the RDS instance.
To configure an IP address whitelist for other database engines, see the following topics:
Use cases
Common scenarios for configuring an IP address whitelist:
-
After you create an RDS instance, you must add the IP addresses of external devices to the IP address whitelist to enable access.
-
If a database connection fails, check whether the IP address whitelist is configured correctly.
The following table describes the IP address whitelist configurations for different connection scenarios.
|
Connection scenario |
Network type |
Whitelist configuration |
|
Connect from an ECS instance to an RDS instance |
In the same Virtual Private Cloud (VPC) (recommended) |
Add the private IP address of the ECS instance. |
|
In different VPCs |
Instances in different VPCs cannot communicate over an internal network. You can move the two instances to the same VPC and then add the private IP address of the ECS instance to the IP address whitelist. |
|
|
Connect from a container in an ACK cluster to an RDS instance |
In the same Virtual Private Cloud (VPC) (recommended) |
You can find the pod IP address and node IP address on the pod page of the target ACK cluster. |
|
In different VPCs |
Instances in different VPCs cannot communicate over an internal network. You can move the two instances to the same VPC and then add the required IP address from the ACK cluster to the IP address whitelist.
|
|
|
Connect from an on-premises host to an RDS instance |
N/A |
Add the public IP address of the on-premises host to the IP address whitelist. Note
The application on the on-premises host must use the public endpoint of the RDS instance. |
Usage notes
-
Each instance supports up to 50 IP address whitelist groups.
-
The default IP address whitelist group, named
default, cannot be deleted, but it can be cleared. The default entry in this group is 127.0.0.1, which prevents any external device from accessing the RDS instance. -
Do not modify or delete system-generated groups, such as ali_dms_group (the IP address whitelist group for Data Management (DMS)) and hdm_security_ips (the IP address whitelist group for DAS). Otherwise, related services may not work as expected.
ImportantTo prevent accidental modification or deletion, the hdm_security_ips whitelist group is not visible to users for instances created after December 2020.
Procedure
Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
-
In the left-side navigation pane, click Whitelist and SecGroup.
On the Whitelist Settings tab, you can view the current IP address whitelist mode.
NoteInstances that were created previously may use enhanced whitelist mode. All new instances use standard whitelist mode.
-
Click Create Whitelist, enter a Group Name, add the IP addresses of the application server to the whitelist, and then click OK.
Note-
You can also click Modify to the right of the default group to change the IP addresses in that group.
-
Use a comma (,) to separate multiple IP addresses. Do not add spaces before or after the comma. For example:
192.XXX.XXX.1,172.XXX.XXX.9. -
A single instance supports a maximum of 1,000 IP addresses or CIDR blocks. If you need to add a large number of IP addresses, merge them into CIDR blocks, such as 10.10.10.0/24.
-
No additional considerations are required for the standard whitelist mode. If the instance uses the enhanced whitelist mode, note the following:
-
Add public IP addresses or private IP addresses of ECS instances in the classic network to a classic network group.
-
Add private IP addresses of ECS instances in a VPC to a VPC group.
-
-
-
(Optional) In the Create Whitelist dialog box, click Add Internal IP Address of ECS Instance to add the IP addresses of all your ECS instances to the whitelist. In the IP Addresses in Group section, select the desired IP addresses from the Not Set list. Then, click the right arrow (>) to move them to the Set list and click OK.
Next steps
Appendix: Finding application server IP addresses
Identify your connection scenario, obtain the correct IP address, and add it to the IP address whitelist.
|
Scenario |
Required IP address |
Method |
|
When connecting over an internal network |
IP address of the ACK container |
You can find the pod IP address and node IP address on the pod page of the target ACK cluster. |
|
Private IP address of an ECS instance |
|
|
|
Connecting from an ECS instance over the public network |
Public IP address of an ECS instance |
|
|
Connecting from a local device |
Public IP address of the local device |
On your local device, search for 'my IP address'. Note
If the IP address obtained by this method is inaccurate, use other methods to obtain it. |