Best practices for configuring an origin ECS instance in port forwarding mode

Updated at:

In port forwarding mode, traffic can bypass Anti-DDoS Proxy and reach the origin server directly. To close that path, configure the security group of the origin ECS instance to allow only the back-to-origin CIDR blocks of Anti-DDoS Proxy.

Traffic bypass risk in port forwarding mode

When you protect TCP services in port forwarding mode and the origin server is an Alibaba Cloud ECS instance or resides in a VPC, traffic can bypass Anti-DDoS Proxy and reach the origin server directly. Only access control on the origin server closes this path.

Allow only Anti-DDoS Proxy to access the origin ECS instance

Configure the security group of the origin ECS instance as follows:

  1. Obtain the back-to-origin CIDR blocks in the Anti-DDoS Proxy console. For instructions, see Allow back-to-origin IP addresses to access the origin server.

  2. Add a rule that allows only the back-to-origin CIDR blocks of Anti-DDoS Proxy, and deny access from all other IP addresses.

Allow trusted IP addresses to access the origin ECS instance directly

Add these rules only after the preceding restriction is in place. If other trusted IP addresses require direct access to the origin ECS instance, such as the egress IP address of your office network, add the corresponding allow rules to the same security group.