ApsaraDB for MongoDB blocks all access by default (IP address 127.0.0.1). Configure a whitelist to allow connections to your instance. Maintain whitelists regularly for optimal security.
Prerequisites
-
You have created an instance by following the Quick Start steps.
-
The instance is in the Running state.
Procedure
The steps below modify the default whitelist group. To create a whitelist group or configure a security group, use Manage whitelists and security groups.
Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select the resource group and region to which the desired instance belongs. Then, find the instance and click the instance ID.
In the left-side navigation pane of the instance details page, choose .
-
In the Whitelist Settings section, use one of the following methods to modify the whitelist for the instance.
Modify manually
-
In the Actions column of the target group, click Modify.
-
In the Manually Modify panel, enter IP addresses or IP address ranges in the IP White List text box.
-
The following formats are supported:
-
A single IP address. Example:
10.23.12.24. -
0.0.0.0/0WarningSetting the whitelist to
0.0.0.0/0allows access from any IP address. This creates a high security risk for your ApsaraDB for MongoDB instance. Use this value with caution. -
CIDR format, which stands for Classless Inter-Domain Routing. For example, in
10.23.12.24/24, /24 indicates the prefix length of the address. The prefix length can be an integer from 1 to 32.
-
-
Separate multiple IP addresses or IP address ranges with commas (,).
-
-
Click Confirm.
Add ECS private IPs
-
In the Actions column of the target group, click Add Internal IP Addresses of ECS Instances.
-
In the Import ECS Intranet IP panel, select the private IP addresses of the ECS instances that you want to add from the IP Whitelist list.
-
Click
. -
Click OK.
-