Web application firewall
13 answers
Turning it on without breaking your own application.
Looking for something specific
The searchable index covers all 326 answers at once and filters as you type.
211 Turn the WAF on without breaking my site
- Settings, WAF rule set, choose the long term support track and press Install it now. Check every node got it.
- Open one site, WAF tab, set the mode to Watching, refuse nothing. Apply.
- Leave it a week and look at what fired.
- Run a learning session against a proper test pass and save a profile.
- Apply the profile and stay in watching mode for a few more days.
- Move to Block known malicious. Watch for a week.
- Only then consider full enforcement, one strictness step at a time.
Going straight to blocking on a live site is how people conclude that WAFs do not work.
212 Install the OWASP rule set on every node
Settings, WAF rule set. Choose a track, save the page first, then press Install it now. It goes to every node, because a node without the rules refuses the whole configuration and the apply is turned away.
Having the rules on a node does not switch anything on. A site is only checked once its own WAF setting is turned on, and that starts in watching mode.
213 Choose between the LTS and latest rule tracks
| Track | What you get | Right for |
|---|---|---|
| Long term support | Fixes and few new rules, so few new false positives. | A box somebody installs and leaves alone. This is the default. |
| Latest | Newest detections, and the newest false positives with them. | Somebody who watches what fires and has time to tune. |
A new rule can start refusing something your own application does, on a site already in blocking mode. That is the whole trade off.
214 Run a learning session
- Open the site, WAF tab, Learning session.
- Put in the addresses your testers will come from. An office, a VPN, a build runner, somebody's laptop.
- Name the round, such as "checkout regression, August release".
- Press Start watching.
- Exercise the application properly. Click everything, upload something, use the search, post text with quotes in it.
- Press Stop watching, look at what fired, tick what is your application rather than an attack, and save it as a profile.
215 Why does the learning session insist on addresses?
Because the internet does not stop while you test. Without a filter the session would collect every scanner and every genuine probe that arrived during the window, and you would end up excusing rules on the strength of somebody else's attack.
216 Fix a WAF rule that blocks something my app does
Do not raise the strictness or turn the rule off globally. Run a learning session, reproduce the action, and tick that specific rule on that specific path as an exclusion. It stops that one rule firing on that one path and changes nothing else.
217 Understand the star in a learned path
Paths that hold an id are collapsed to a star automatically, so /user/*/profile covers the account created tomorrow.
Check them before saving. A star in the wrong place allows more than you meant. A missing one refuses everything created after today, and that failure only shows up when a new record is made, which could be weeks later.
219 What is the allowed surface setting?
Separate from the attack rules. Off means the rules decide on their own and anything they do not recognize reaches your application, which is how nearly every WAF works and is the right default.
The stricter settings only allow paths your testers actually reached. Only sane for an application whose surface is genuinely fixed, and it will refuse anything you forgot to test.
220 What does a blocked visitor see?
A 403. If the site has an error page template covering 403, they see your page rather than the bare nginx one, which is worth setting up before you start blocking.
221 What does the WAF cost in performance?
Inspecting every request is not free. Expect a measurable increase in processor use and a small amount of added latency. On the fleet the numbers on this site came from, the load balancers ran at around 8% of sixteen cores under 2,000 requests a second, so there is plenty of headroom. Measure your own rather than trusting that.
222 The WAF page says there is no rule set on the fleet
The rules have not been installed yet. Settings, WAF rule set, save the page, then Install it now. It takes a few seconds. Until then the WAF cannot be applied, and the site page says so rather than letting you configure something that would fail.
223 Turn the WAF off for one site
Open the site, WAF tab, set the mode to Off, and apply. Nothing is checked for that site and requests reach your backend exactly as they did before. The rules stay installed on the nodes and other sites are unaffected.