To control the source of access to your business resources, you can use the IP blocklist/allowlist feature in Tencent Cloud CDN.
By configuring an access control policy on IPs of user requests, you can effectively control the source of access, preventing hotlinking by malicious IPs, attacks, etc.
Log in to the CDN console, select Domain Management on the left sidebar, and click Manage on the right of a domain name to enter its configuration page. Open the Access Control tab to see the IP Blocklist/Allowlist Configuration section. It is disabled by default.
Toggle on the switch, tick Blocklist or Allowlist, enter the list of IPs or IP ranges, and click OK:
If a client IP matches an IP or IP range in the blocklist, the accessed CDN node will directly return a 403 status code.
If a client IP does not match any IP or IP range in the allowlist, the accessed CDN node will directly return a 403 status code.
IP:Portis not supported here.
You can toggle off the switch to disable this feature. When the switch is off, this feature does not take effect in the production environment even if there is an existing configuration. If you toggle the switch on, the configuration will take effect across the entire network after the action is confirmed.
If your acceleration domain name is configured for global acceleration, the IP blocklist/allowlist will take effect globally. This configuration does not distinguish between requests from regions in and outside the Chinese mainland.
If the IP blocklist/allowlist configuration of the domain name
www.test.com is as follows:
Then the actual access will be as follows:
220.127.116.11accesses the resource
http://www.test.com/test.txt. As the IP matches an IP in the allowlist, the requested content will be returned.
18.104.22.168accesses the resource
http://www.test.com/test.txt. As the IP does not match any IP in the allowlist, a 403 status code will be returned.