Web application firewall

Build a Web ACL that blocks attacks, test it safely, and put it in front of a load balancer.

Super WAF inspects every request before it reaches your app and blocks attacks such as SQL injection, cross-site scripting and bad bots. You set it up in the WAF Studio: Super WAFWeb App Firewall (WAF).

The rules live in a Web ACL: an ordered list of rules plus a default action. You create a Web ACL, test it, and attach it to a load balancer. Today only load balancers can be protected.

Before you start

Your account must be set up, see Set up your account. You need the MODIFY role on the prefix to create or change a Web ACL and MANAGE to delete one. To protect a load balancer you need MODIFY on both. Pick the prefix in the Prefix list at the top of the studio.

How a Web ACL works

Each request goes through the rules in priority order. Every rule has a condition and an action. Some actions stop evaluation (for example Allow or Block): the first of those that matches decides the outcome. Others continue (for example Count or Tag): they record the match and let the next rule run. If no stopping rule matches, the Web ACL's default action applies.

Create a Web ACL

  1. Open Super WAFWeb App Firewall (WAF) and select a prefix.
  2. Click New Web ACL.
  3. Enter a Name, for example shop-waf.
  4. Choose a Default action: Allow (block what rules match) for most sites, or Block (allow-list) to let in only what your rules allow.
  5. Leave Start in set to Detect (log only).
  6. Pick a Template. OWASP Top 10 is selected for you; choose Empty to build everything yourself.
  7. Check the preview, then click Create Web ACL.

The preview shows how many rules the template compiles to and how it treats a set of sample requests, for example Normal browser → allow and SQL injection → block. After "Web ACL created", the new Web ACL opens.

Detect first, then enforce

ModeWhat happens
DetectNothing is blocked. Every request that would be blocked is logged.
EnforceRules take effect: matching requests are blocked, challenged or redirected.
Start in detect mode

Run a new Web ACL in Detect for the first few days. Watch Traffic & logs for would block entries from real users. When only attacks show up there, switch to Enforce.

To switch, use the Detect / Enforce switch in the Web ACL's header. You'll see "Now enforcing" or "Switched to detect-only".

Enforcing can block real customers

A rule that is too strict blocks genuine traffic as soon as you enforce. Check the logs in detect mode first, and test your changes in the test lab.

The Web ACL screen

The header shows the ID, Version, how many rules and compiled rules there are, how many resources it is Protecting, and the Deploy state. Click Deploy to push the current rules to everything the Web ACL protects. Changes you save are deployed automatically, and the message tells you if a deployment failed.

TabWhat you do there
Rules pipelineAdd, order and test rules.
Managed rulesBrowse ready-made protections and add them.
Test labSend test requests and run the attack suite.
Protect load balancersAttach the Web ACL to load balancers.
LibraryShared IP sets, regex sets, saved conditions and rule groups.
Settings & JSONBehaviour, the block response, the OWASP Core Rule Set, and the full JSON.
Traffic & logsWhat the firewall saw and did.

Add a rule

  1. Open the Rules pipeline tab.
  2. Click a tile under Add a rule (types below).
  3. Fill in the rule. Optionally set a Name, a Priority (blank adds it last) and Labels added on match such as bot:suspect, which later rules and the logs can use.
  4. Click Dry-run samples to see how the draft treats the sample attacks. The drawer stays open.
  5. Click Add rule.
Rule typeUse it to
Custom ruleMatch anything you can describe with a condition, using AND, OR and NOT. The builder is the same as for load balancer rules, see Build a condition. In a Web ACL you can also add an Attack signature with its own sensitivity, or a Saved condition from the library (the button appears once the library has one).
Managed groupTurn on a maintained set of protections, such as SQL injection, cross-site scripting, bots or known vulnerabilities. See Managed rules.
Rate limitLimit how many requests one client can make in a window, counted per IP, header, cookie, path or a combination of up to 5. Set Limit (requests) (default 100), Window (s) (default 60) and optionally Then block key for (s).
IP setAllow or block a saved list of addresses. Choose IP is in set or IP is NOT in set. Click New IP set to create one.
Geo matchMatch requests by country, using two-letter codes such as IN or DE. Quick buttons add common lists.
Your rule groupReuse a group of rules from the library.

In the Request pipeline, rules run from top to bottom. Drag a rule to reorder it (you'll see "Priorities updated"), and use its buttons to enable, disable, edit or delete it.

Actions

Each action says whether it stops evaluation or continues. The list comes from the service and usually includes:

ActionWhat happens
AllowLets the request through.
BlockRejects it, with status 403 unless you set another. You can set a custom body and a delay to slow down attackers.
CountRecords the match and continues.
ChallengeAsks the browser to prove it is real. Bots usually fail.
RedirectSends the client to another Location.
ScoreAdds to the request's anomaly score. The request is blocked once the total reaches the anomaly threshold in settings.
TagAdds labels and continues.

Managed rules

Managed rules are ready-made protections that are maintained for you.

  1. Open the Managed rules tab. Filter by category if you like.
  2. Click Rules on a card to see what it contains.
  3. Click Add to ACL. The group is added at sensitivity 2.
  4. To fine-tune it, click Configure.

In the configuration drawer:

  • Sensitivity runs from 1 (fewest false positives) to 4 (paranoid). Higher catches more attacks but also more real traffic.
  • On match uses each rule's own action, or adds to the anomaly score instead.
  • Override every rule's action sets one action for the whole group, for example count while you try it out.
  • In the rules table, switch off rules that block real users, or change their action one by one.
  • Optionally limit the group to some requests with Only inspect requests matching.

Test lab

Test your Web ACL before real attackers do. Tests run against the saved Web ACL with the same engine that handles live traffic, and they don't affect your app.

  1. Open the Test lab tab.
  2. Click a preset (for example SQL injection or Normal browser), or fill in Method, Path, Client IP, Country, Query parameters, Headers and Body yourself.
  3. Click Send through Web ACL.
  4. Click a result to see its Trace: which rules matched and which one decided.

Click Attack suite to send every preset at once. The summary tells you how many attacks were stopped and what happened to normal traffic: you want all attacks stopped and normal traffic allowed. In detect mode, results say would block.

For a quick check while editing rules, use the Quick test panel on the Rules pipeline tab and click Trace through pipeline. Click Clear trace when you are done.

Protect a load balancer

  1. Open the Protect load balancers tab.
  2. Find the load balancer. Each card says unprotected, protected (with mode and status) or protected by another Web ACL.
  3. Choose Inline or Edge on its card.
  4. Click Protect.
ModeWhat it means
Inline (default)The load balancer keeps its public IP and traffic is routed through the firewall. No DNS change.
EdgeThe firewall gets its own public IP and forwards to the load balancer. Point your DNS at the firewall's IP when you are ready.

You'll see "Provisioning WAF in front of the load balancer…", then whether the attachment is active, failed or degraded with the reason. The Attachments of this Web ACL table lists everything it protects. You can also protect a load balancer from its own WAF & access tab.

To remove protection, click Detach on the card and confirm. Traffic then reaches the load balancer without inspection. A load balancer protected by another Web ACL has no buttons here: detach it there first.

If the tab says No load balancers in this prefix, create one first.

Library

Library items are shared by every Web ACL in the prefix. Changing one redeploys the Web ACLs that use it.

ItemWhat it holds
IP setsAddresses and ranges, one per line, IPv4 and IPv6. Invalid entries are listed so you can fix them.
Regex setsPatterns, one per line, matched without case. Use Try a value to test them.
Saved conditionsA condition you can drop into any custom rule.
Rule groupsA set of rules as JSON. Tip: build a rule in a Web ACL, switch its drawer to JSON, and paste it here.

Click New, fill in a Name and the content, and click Save. You can't delete an item that a Web ACL still uses.

Settings and JSON

On the Settings & JSON tab you can change how the Web ACL behaves: the default action, how much of the body is inspected, the anomaly threshold (0 turns it off), challenge settings, trusted proxies and the real IP header, and the Block response (status, content type and body). Click Save settings.

The OWASP Core Rule Set section turns on an extra, widely used rule set. Set its Paranoia level (1 to 4), and exclude rule IDs, addresses or paths (for example /health) that trigger false positives.

Under Full Web ACL as JSON you can Export and Import the whole Web ACL, view the Compiled policy, run the Dry-run attack suite, and Save JSON. Use this to copy a Web ACL to another prefix.

Traffic and logs

The Traffic & logs tab shows how many requests were seen, blocked, challenged and counted, how many would block in detect mode, and which rules match most.

To investigate, filter Security events by action, client IP or rule ID and click Load. Each row shows when, the action, the rule, the client and country, the request and the protected resource.

Delete a Web ACL

This can't be undone

Delete removes the Web ACL. If it protects load balancers, it is detached from them first and their traffic is no longer inspected. Type the Web ACL's name to confirm.

Troubleshooting

  • Real users are blocked. Find their requests in Traffic & logs and note the rule. Lower the managed group's sensitivity, switch off that rule, or switch back to Detect while you fix it.
  • "Create or select a Web ACL first" Choose a Web ACL before clicking Protect this load balancer on the load balancer.
  • The attachment is failed or degraded. Read the error on the card or in Attachments of this Web ACL, then try Protect again or contact support.
  • "Add at least one condition" A custom rule needs a condition.