Help Center> Virtual Private Cloud> FAQs> Security> Why Are My Security Group Rules Not Applied?
Updated on 2024-03-30 GMT+08:00

Why Are My Security Group Rules Not Applied?

Symptom

The security group rules you have configured for an ECS have not taken effect.

Troubleshooting

The issues here are described in order of how likely they are to occur.

Troubleshoot the issue by ruling out the causes described here, one by one.

Figure 1 Troubleshooting
Table 1 Troubleshooting

Possible Cause

Solution

Incorrect Security Group Rule Configurations

See Incorrect Security Group Rule Configuration

Conflicts Between Network ACL Rules and Security Group Rules

See Conflicts Between Network ACL Rules and Security Group Rules

Incorrect ECS Firewall Configurations

See Incorrect ECS Firewall Configurations

Incorrect Security Group Rule Configuration

If security group rules are incorrectly configured, ECSs cannot be protected. Check the security group rules based on the following causes:

  1. The direction of a rule is incorrect.
  2. The protocol of a rule is incorrect.
  3. The port used in a rule is risky and cannot be accessed. For details about common ports and risky ports, see Common Ports Used by ECSs.
  4. The port used in a rule is not opened. You can perform the following steps to check whether a port is being listened on the server.
    For example, if you have deployed a website on an ECS and want users to access your website through HTTP (80), you need to add an inbound rule to the ECS security group to allow access over the port. Table 2 shows the rule.
    Table 2 Security group rule

    Direction

    Priority

    Action

    Type

    Protocol & Port

    Source

    Inbound

    1

    Allow

    IPv4

    TCP: 80

    IP address: 0.0.0.0/0

  5. ECSs belong to different VPCs. If two ECSs are in the same security group but in different VPCs, the ECSs cannot communicate with each other. To enable communications between the ECSs, use a VPC peering connection to connect the two VPCs. For details about VPC connectivity, see Application Scenarios.

You can add a security group rule or modify a security group rule to select the correct direction, protocol, and open the ports.

Conflicts Between Network ACL Rules and Security Group Rules

Security groups operate at the ECS level, whereas network ACLs operate at the subnet level.

For example, if you configure an inbound security group rule to allow access over port 80 and a network ACL rule to deny access over port 80, the security group rule will not take effect.

You can add a network ACL rule or modify a network ACL rule to allow traffic from the corresponding protocol port.

Incorrect ECS Firewall Configurations

Check whether the firewall of the ECS opens the required ports.

For details, see Disabling a Windows ECS Firewall and Adding a Port Exception on a Windows ECS Firewall or Disabling a Linux ECS Firewall and Adding a Port Exception on a Linux ECS Firewall.

Submitting a Service Ticket

If the problem persists, submit a service ticket.

Security FAQs

more