Protect an application load balancer with a web ACL
Attach a web ACL so requests to an application load balancer pass the web application firewall before they reach your targets.
The web ACLs are the CDN's: the Deutsche Cloud Core managed rules, IP and country lists, match and rate rules and the browser challenge. One ACL can protect several load balancers and distributions. See the web application firewall for the rules themselves.
Only application load balancers run a web ACL. For lb11–lb31, put a CDN distribution with
the ACL in front instead.
Prerequisites
- An
applicationload balancer and a web ACL of your organization. - Permission for
lb:SetWebAclon the load balancer, andwaf:GetWebAclon the ACL. - In the console, also
lb:DescribeLoadBalancerson the load balancer (without it its page answers 404) andwaf:ListWebAclsto choose an ACL from the list; without either oflb:SetWebAclorwaf:ListWebAclsthe section only shows the current ACL.
Attach or detach the web ACL
- Open Load balancers, then open the load balancer. The Overview tab opens.
- Under Web application firewall, for Web ACL, choose the ACL, or None to detach it.
The choice is saved at once; there is no separate save step.
dcloud lb load-balancers update lb-id --web-acl-id acl-idPATCH /lb/api/load-balancers/lb-id
{ "webAclId": null }null detaches the ACL; an ACL's id attaches it.
resource "dcloud_lb" "web" {
name = "web-lb"
type = "application"
region_id = "de1"
web_acl_id = dcloud_waf_web_acl.shop.id
}web_acl_id changes in place. Setting it when the load balancer is created also needs
lb:SetWebAcl.
Result
200 with the load balancer and its webAclId. The fleet runs the ACL within seconds. A request
on any name of the load balancer passes it after TLS, before the HTTP-to-HTTPS redirect and before
it is forwarded to a target, so a blocked request never reaches a target. Rate rules count
exactly, because one fleet machine serves at a time.
Requests the load balancer refuses for its own limits are answered before the ACL:
421for a name on a connection opened for another name;429over the load balancer's request rate;503at its connection limit.
Matches are in the access log and under dcloud waf web-acls logs (needs waf:GetWafLogs;
narrow it to this load balancer with --load-balancer-id); the Live tab shows the ACL's
counters. See Monitoring.
There is no charge beyond the web ACL itself.
When it is refused
400on any type butapplication.409for a load balancer another service owns (a database's or a Kubernetes Service's).403Attaching web ACL … needs waf:GetWebAcl on it.404Web ACL … not foundfor an ACL that is not your organization's.404Load balancer not found.