Web application firewall guide: what a WAF does, what it misses, and how to set one up

What a web application firewall blocks and what it cannot, cloud vs appliance, rule tuning, API and bot protection, and what Singapore, Malaysia and Hong Kong regulators say.

· 8 min read · By RiposteSecurity Research Team

Hong KongSingaporeMalaysia

Key points

  • A web application firewall (WAF) sits in front of your website or API and blocks requests that look like known attacks, such as SQL injection.
  • It does not fix the weakness behind it. Broken access control, business logic flaws and stolen logins usually pass straight through.
  • Singapore's PDPC and CSA advised on 12 November 2026 that organisations consider a WAF for internet-facing APIs. Bank Negara's RMiT lists web-application firewalls among required controls.
  • A WAF buys time. Secure code and regular penetration testing are still what close the gap.

A web application firewall is one of the first tools firms buy after a website or app is attacked. It is useful, but often misunderstood. This guide explains what a web application firewall does and does not do, how to choose between cloud and appliance, how to tune it, and where it fits next to secure code and testing.

What a web application firewall does

A normal network firewall decides which computers can talk to which, mostly by address and port. A web application firewall looks inside web traffic: the web address, form fields, headers and data sent to your site or API. It compares each request against rules and blocks, logs or challenges the ones that match.

A WAF is good at:

  • Common attack patterns: requests that try SQL injection or cross-site scripting in obvious ways. See our plain guide to SQL injection and XSS.
  • Virtual patching: a temporary rule that blocks attacks on a known flaw while you test and apply the real fix. This matters when a new flaw is being exploited within days. Our zero-day guide covers the first 48 hours.
  • Rate limits: slowing down one source that sends too many requests, such as login attempts or data scraping.
  • Blocking by location or reputation: for example, traffic from regions you do not serve, or from known bad addresses.

What a WAF does not do

A WAF only sees what a request looks like, not whether the person sending it should be allowed to do it. These pass through most WAFs:

  • Broken access control: a logged-in customer changes an ID in the address and sees another customer's record. The request looks normal. This is the top risk in the OWASP Top 10 (2025 edition).
  • Business logic flaws: applying a discount twice, skipping a payment step, or booking more seats than allowed.
  • Stolen but valid logins: an attacker using a real username and password, or a real API key.
  • Attacks it has not been told about, or attacks written to slip past its rules. Attackers test WAF bypasses as a routine step.
  • Flaws inside your own network: internal apps and admin tools that the WAF does not sit in front of.

Singapore's PDPC and CSA warned on 12 November 2026 that bulk data theft through APIs can "often go undetected by security controls", especially when the requests appear to come from authorised users. That is exactly the traffic a WAF lets through. The fix for those weaknesses is in the code and access design, not in the firewall.

Cloud WAF vs appliance WAF

Cloud WAFAppliance or software WAF
Where it runsProvider's network, in front of your siteYour data centre or cloud account
Set-upChange DNS; often hoursInstall, size and maintain; days to weeks
Large denial-of-service attacksUsually absorbed by the provider's networkLimited by your own bandwidth
Rule updatesProvider updates managed rulesYou or your vendor update them
Data locationTraffic is decrypted at the provider; check whereStays under your control
Watch out forAttackers reaching your server directly, bypassing the WAFFalling behind on updates and capacity

Most small and mid-sized firms choose a cloud WAF, often bundled with a content delivery network and denial-of-service protection. If you do, make sure your servers only accept traffic from the WAF provider. Otherwise an attacker who finds your server's real address can go around it.

If you handle regulated data, check where the provider decrypts traffic and stores logs, and include it in your supplier reviews.

Rule tuning: block mode, false alarms and exceptions

Most WAFs start with a managed rule set. The best-known open one is the OWASP Core Rule Set, which has four "paranoia levels". Level 1 is the baseline that rarely blocks real users. Higher levels catch more attacks but, in the project's words, "at the cost of more false positives".

A sensible roll-out:

  1. Start in log-only mode for one to two weeks on real traffic.
  2. Review what would have been blocked. Write narrow exceptions for real users, for example one field on one page, not a whole rule switched off.
  3. Turn on blocking. Watch help-desk complaints and failed checkouts for the first days.
  4. Review rules and exceptions after every major release, and at least quarterly.
  5. Send WAF logs to your central log system so attacks are linked with other activity. See our guide to SIEM, EDR and SOC.

A WAF left in log-only mode for months, or full of broad exceptions, gives a false sense of safety.

API protection

Mobile apps and partner links run on APIs, and APIs need more than web-page rules. The PDPC and CSA joint advisory says organisations should "consider implementing a Web Application Firewall (WAF) to detect and block malicious requests to internet-facing APIs, including common web-based attacks such as SQL injection". The same advisory also asks for server-side input checks, parameterised queries, rate limits and limits on how much data one request can return.

For APIs, check that your WAF or API gateway can:

  • read your API format (usually JSON) and check requests against your API's definition;
  • limit requests per user, per key and per source, not only per address;
  • cap response sizes and alert on bulk reads;
  • cover every API, including old versions and test endpoints.

Our guide to the PDPC and CSA insecure APIs advisory has the full checklist.

Bot management

Many attacks are automated: password guessing with leaked lists, scraping prices or customer data, and bulk fake sign-ups. Bot management features look at how a client behaves, not only what it sends, and can challenge or slow suspected bots. They help against credential stuffing, but they are not a replacement for multi-factor login.

AI makes automation cheaper. Hong Kong police said in November 2026 that criminals use AI agents to launch automated attacks around the clock, and AI scanning to find many targets with the same weakness. Expect more automated traffic, and expect it to look more like real users.

Why a WAF does not replace fixing code and penetration testing

A WAF is a filter in front of a weakness. The weakness is still there. If a rule is wrong, switched off during a busy sale, or bypassed, the flaw is open again. And the most damaging flaws, such as broken access control, are often invisible to a WAF.

Use the WAF to buy time, and use that time to:

  • fix the code, using safe patterns such as parameterised queries and output encoding (see our secure coding and DevSecOps guide);
  • run penetration tests with the WAF both on and, where safe, bypassed, so you learn what the application itself allows. Our guide to vulnerability assessment vs penetration testing explains the difference;
  • remove each virtual patch once the real fix is live and retested.

What MAS, Bank Negara and Hong Kong say

Singapore: MAS

The MAS Technology Risk Management Guidelines (18 January 2021) do not name web application firewalls in the text we reviewed. Paragraph 14.1.3 says firms should take adequate measures to minimise exposure of online financial services to common attacks, naming "code injection attack, cross-site scripting" and distributed denial of service, among others. Paragraph 13.1.2 says vulnerability assessments of web-based systems should include checks for common web vulnerabilities. These are guidelines (expected practice).

The binding MAS Notice on Cyber Hygiene (for banks, FSM-N06) requires that a firm "implement controls at its network perimeter to restrict all unauthorised network traffic". It does not prescribe a WAF, but for internet-facing web apps a WAF is a common way to show this.

Malaysia: Bank Negara RMiT

RMiT Appendix 5, Part A is mandatory through paragraph 11.5. It requires "web and email filtering systems such as web-application firewalls", plus protection against all types of distributed denial of service attacks, including application layer attacks. Part E on APIs requires rate limiting, an API inventory, secure coding with input validation, and periodic penetration testing and static and dynamic security testing of APIs. It suggests firms consider an API gateway.

Hong Kong

The Privacy Commissioner's 24 November 2026 statement asks organisations to use firewalls to protect networks, separate database servers from web servers with a firewall, and run regular vulnerability assessments and penetration tests on internet-facing systems.

Card payments add another layer. PCI DSS version 4.0 requires an automated technical solution that detects and prevents web-based attacks on public-facing web applications (requirement 6.4.2), mandatory since 31 March 2025. A WAF is the usual way to meet it.

WAF checklist

  • List every internet-facing website, app back end and API. Check each one sits behind the WAF.
  • Make sure your servers accept web traffic only from the WAF, so it cannot be bypassed.
  • Run new rules in log-only mode first, then switch to blocking. Check nothing has been left in log-only mode.
  • Keep exceptions narrow and written down, with an owner and a review date.
  • Turn on rate limits for logins, password resets, search and data export.
  • Send WAF logs to your central log system and alert on spikes.
  • Have a process to add a virtual patch within hours of a critical new flaw, and remove it after the real fix.
  • Test the application with and without the WAF in your penetration tests.
  • If you are RMiT-regulated, map your WAF, DDoS and API controls to Appendix 5 Parts A and E.

Sources

  1. PDPC and CSA, Joint Advisory on Data Protection Risks Arising from Insecure APIs (AD-2026-016), 12 Nov 2026: csa.gov.sg
  2. Monetary Authority of Singapore, Technology Risk Management Guidelines, 18 Jan 2021: mas.gov.sg
  3. Monetary Authority of Singapore, Notice FSM-N06 on Cyber Hygiene: mas.gov.sg
  4. Bank Negara Malaysia, Risk Management in Technology (RMiT) policy document, issued 25 Sep 2026: bnm.gov.my
  5. PCPD, Privacy Commissioner's Office urges organisations to strengthen data security measures, 24 Nov 2026: pcpd.org.hk
  6. OWASP Core Rule Set, Paranoia levels: coreruleset.org
  7. OWASP, Top 10:2025: owasp.org
  8. TVB News, Police note criminals using AI for round-the-clock attacks, 9 Nov 2026: news.tvb.com
  9. BDO, PCI DSS 4.0 software development changes (requirement 6.4.2): bdo.com

This guide summarises public documents as of 26 November 2026. It is not legal advice; check the regulator's current text.