A security group is a collection of access control rules for ECSs and DB instances that have the same security requirements and are mutually trusted in a VPC.
To ensure database security and reliability, you need to configure security group rules to allow specific IP addresses and ports to access DB instances.
When you attempt to connect to a DB instance through an EIP, you need to configure an inbound rule for the security group associated with the DB instance.
The default security group rule allows all outgoing data packets. If an ECS and a DB instance are in the same security group, they can access each other. When a security group is created, you can configure security group rules to control access to and from DB instances in that security group.
To ensure the security of your data and DB instances, you are advised to use the principle of least privilege for database access. Change the database port (default value: 3306), and set the IP address to the remote server's address or an IP address on the remote server's smallest subnet so that access to the remote server is limited.
If you use 0.0.0.0/0, all IP addresses are enabled to access DB instances in the security group.
In the Network Information area on the Basic Information page, click the security group.
Parameter |
Description |
Example Value |
---|---|---|
Protocol |
Network protocol. |
TCP |
Port and Source |
|
|
Description |
Provides supplementary information about the security group rule. This parameter is optional. The description can contain a maximum of 255 characters and cannot contain angle brackets (<>). |
- |