All Products
Search
Document Center

Elastic Compute Service:view security group rules

Last Updated:Mar 15, 2024

After you add security group rules in the Elastic Compute Service (ECS) console, you can view the details of the rules and perform health checks on security groups to identify redundant rules. This helps simplify security group configurations, reduce administrative workloads, facilitate network management, and mitigate risks posed by security vulnerabilities. This topic describes how to view security group rules and perform a health check on security groups to identify redundant rules in the ECS console.

View the rules of a single security group

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Network & Security > Security Groups.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Find the security group whose rules you want to view and click Manage Rules in the Operation column.

  5. Click a tab based on the type of rule that you want to view.

    • If the network type of the security group is Virtual Private Cloud (VPC), click the Inbound or Outbound tab.

    • If the network type of the security group is classic network, click the Internet Ingress, Internet Egress, Inbound, or Outbound tab.

    Note

    In the search box above the rule list, enter ports or authorization objects to search for security group rules.

View all rules in multiple security groups that are associated with an ECS instance

If you add an ECS instance to multiple security groups, perform the following steps to view all inbound or outbound security group rules that are associated with the instance:

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instances.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Go to the Instance Details page of an ECS instance and view all inbound or outbound security group rules that are associated with the instance.

    1. Find the instance for which you want to view security group rules and click the instance ID to go to the Instance Details page.

    2. Click the Security Groups tab and then click the Internal Inbound Rules or Internal Outbound Rules tab to view the details of the rules.

Identify redundant rules in a security group

You can perform a health check on a security group to identify redundant rules in the security group. If rule A has a lower priority than rule B and rule B contains all conditions of rule A, rule A is considered to be a redundant rule. If a redundant rule exists, we recommend that you delete the rule to prevent the number of rules from reaching the upper limit.

Note

Each security group can contain a limited number of rules, and each elastic network interface (ENI) on an ECS instance can be associated with a limited number of security group rules. For more information about the limits and quotas of security group rules, see the Security group limits section in the "Limits" topic.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Network & Security > Security Groups.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Find the security group that you want to manage and click Manage Rules in the Operation column.

  5. In the Access Rule section, click 健康检查.

  6. In the Health Check dialog box, check whether redundant rules exist.

    The following figure shows that the security group contains two redundant rules.冗余规则

  7. Select the redundant rules and click OK to delete the rules.

References

You can also call the following API operation to query security group rules: DescribeSecurityGroupAttribute.