Skip to content
Back to Blog
·10 min read·technology

Web Application Firewall (WAF): A Practical Guide for India

A practical guide to Web Application Firewalls for Indian businesses — covering how WAFs block SQLi, XSS, and bots, their limits, and when to deploy one.

BR

Bachao.AI Research Team

Cybersecurity Research

Scan Your Attack Surface

Security exposure this creates

Unpatched vulnerabilities in your tech stack are the #1 entry point for breaches targeting Indian businesses. Here's what to watch.

A Web Application Firewall (WAF) is a security control that sits in front of a web application or API and inspects incoming HTTP/HTTPS traffic in real time, blocking requests that match known attack patterns — SQL injection, cross-site scripting, malicious bots, and Layer 7 DDoS floods — before they ever reach your application code. It works by applying rules (signature-based) or behavioral/ML models to every request and returning an allow, block, or challenge decision in milliseconds. For Indian businesses running customer-facing web apps, APIs, or e-commerce checkouts, a WAF is one of the fastest controls to deploy, but it is a perimeter shield, not a substitute for fixing the underlying vulnerabilities a VAPT would find.

This guide covers what a WAF does, signature-based versus behavioral/ML engines, the attack classes it blocks, where it falls short, cloud WAF options for Indian teams, and when to deploy one.

What a WAF Actually Does

A WAF operates at the application layer (Layer 7 of the OSI model), which is what separates it from a network firewall. A traditional firewall controls which IP addresses and ports can talk to your server; a WAF reads the actual HTTP request — headers, query strings, form fields, cookies, JSON bodies — and evaluates whether the content looks malicious before the request is allowed to reach your web server or application.

Every request that hits a WAF-protected endpoint goes through the same basic decision loop: parse the request, run it against a rule set or model, and decide whether to pass it through, block it outright, or issue a challenge (like a CAPTCHA or JavaScript check) to separate humans from bots. The flow below shows this in simplified form.

graph TD A[Incoming HTTP request] --> B[WAF inspects request] B --> C[Signature rule match check] B --> D[Behavioral ML anomaly check] C --> E{Malicious pattern found} D --> F{Anomalous behavior found} E -->|Yes| G[Request blocked] E -->|No| H[Continue evaluation] F -->|Yes| I[Challenge issued] F -->|No| H H --> J[Request allowed to origin] I --> K{Challenge passed} K -->|Yes| J K -->|No| G style A fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style B fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style C fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style D fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style E fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style F fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style G fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 style H fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style I fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style J fill:#1e3d2f,stroke:#10B981,color:#e2e8f0 style K fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0
ℹ️
INFO
WAFs can be deployed in three modes: as a reverse proxy in front of your servers, as a plugin inside your web server software, or as a cloud/CDN-delivered service that routes your DNS through the vendor's edge network. Most Indian SMBs use the cloud-delivered model because it needs no infrastructure change beyond a DNS update.

Signature-Based vs Behavioral / ML-Based WAFs

The two engine types differ in how they decide a request is malicious, and most production WAFs today combine both.

Signature-based detection works like antivirus for web traffic. The WAF maintains a library of known attack patterns — regular expressions and rule sets, often built on frameworks like the OWASP ModSecurity Core Rule Set — and blocks any request that matches. It is fast and effective against well-known, previously catalogued attacks such as classic SQL injection strings or path traversal sequences. Its weakness: it can only catch what it already knows about; a novel payload that doesn't match an existing signature slips through until the rule set is updated.

Behavioral and ML-based detection builds a statistical baseline of "normal" traffic to your application — request rates, parameter patterns, session behavior, geographic distribution — and flags deviations from that baseline. This catches what signatures miss, including zero-day exploitation attempts, credential-stuffing bursts, and low-and-slow bot scraping. The trade-off is a higher initial false-positive rate while the model learns your real traffic, and less transparency into why a given request was blocked.

AspectSignature-based WAFBehavioral / ML-based WAF
Detection basisKnown attack pattern libraryStatistical/behavioral baseline
Best againstCataloged exploits (SQLi, XSS strings)Zero-days, bot abuse, credential stuffing
False positive rateLower once tuned, but rigidHigher initially, adapts over time
Update dependencyNeeds frequent rule updatesNeeds traffic history to learn baseline
TransparencyEasy to audit which rule firedHarder to explain individual blocks
Typical deploymentAlmost universal (base layer)Increasingly bundled as an add-on
💡
TIP
Don't treat this as an either/or choice. Nearly every reputable cloud WAF today ships a signature rule set as the baseline and layers behavioral/ML detection on top for bot management and anomaly detection. Enable both, and start the behavioral layer in "monitor" mode for a week or two before switching it to actively block, so you can review false positives against your real traffic first.

What Attacks a WAF Actually Blocks

A properly configured WAF is effective against a specific, well-understood set of application-layer threats:

    1. SQL injection (SQLi) — malicious SQL fragments inserted into form fields, query strings, or API parameters to manipulate a backend database. Signature rules catch the vast majority of common injection syntax.
    2. Cross-site scripting (XSS) — scripts injected into pages viewed by other users, used to steal session cookies or hijack accounts. WAFs strip or block payloads containing script tags and known JS-injection patterns.
    3. Malicious bot traffic — credential-stuffing attempts, content scraping, inventory hoarding, and fake account creation. Behavioral WAFs and bot-management modules fingerprint automation and rate-limit or block it.
    4. Layer 7 (application-layer) DDoS — floods of seemingly legitimate HTTP requests designed to exhaust application resources rather than network bandwidth. WAFs paired with rate limiting absorb this far better than raw origin servers can.
    5. Path traversal and file inclusion — attempts to access files or execute code outside the intended application directory.
    6. Known CVE exploitation — many cloud WAFs push virtual patches for newly disclosed CVEs in popular frameworks faster than every customer can patch manually.
The chart below is an illustrative breakdown of the attack categories a typical WAF deployment is commonly tuned to intercept, based on the attack classes most consistently referenced across OWASP's application security guidance.
pie title "Attack Categories Commonly Blocked by a WAF" "SQL Injection" : 25 "Cross-Site Scripting" : 20 "Bad Bot Traffic" : 25 "Layer 7 DDoS" : 15 "Known CVE / Exploit Attempts" : 15
94%of applications in OWASP's contributed test dataset included checks for broken access control — the highest-incidence category in the 2021 Top 10 (OWASP Top 10 2021)
⚠️
WARNING
A WAF blocking a payload does not mean the underlying vulnerability is fixed. If your application has a genuine SQL injection flaw, the WAF is filtering malicious input at the edge — but a sufficiently obfuscated payload, an encoding bypass, or a new attack technique can still get through. Relying on the WAF alone as your only defense against a known code-level vulnerability is a false sense of security.

Know your vulnerabilities before attackers do

Run a free VAPT scan — takes 5 minutes, no signup required.

Book Your Free Scan

What a WAF Does Not Do — Its Real Limitations

This is the section most vendors skip, and it is the one that matters most for an actual security posture:

It doesn't fix the vulnerability, it filters the exploit attempt. A WAF is a compensating control, not a remediation. The insecure code, missing input validation, or broken access control logic still exists in your application after the WAF is deployed — you've reduced the attack surface reaching it, not eliminated the underlying weakness.

It can be bypassed. Encoding tricks, HTTP parameter pollution, request smuggling, and slowly-evolving payloads regularly slip past both signature and behavioral engines. Researchers routinely publish WAF-bypass techniques for major products.

It doesn't protect logic flaws. Business-logic vulnerabilities — manipulating an order quantity to negative values, abusing a discount-coupon endpoint, or exploiting a broken authorization check between two legitimate accounts — often look like normal, well-formed HTTP traffic. A WAF has nothing to pattern-match against; only manual or specialized testing finds these.

It doesn't cover what's not in front of it. Server-to-server API calls, admin panels reached without going through the WAF-fronted domain, and misconfigured cloud storage outside the WAF's routing are all invisible to it.

It needs tuning, not just switching on. A default configuration either lets too much through or blocks legitimate traffic, breaking checkout flows and login forms. Tuning against real traffic is ongoing work, not a one-time setup step.

This is exactly why the standard security guidance — including from OWASP and the Cybersecurity and Infrastructure Security Agency — treats a WAF as one layer of defense-in-depth, always paired with secure coding practices and independent penetration testing that actively tries to find and exploit what the WAF might miss.

🎯Key Takeaway
A WAF blocks the exploit attempt at the edge in real time; it does not find or fix the vulnerability that made the attempt possible in the first place. Indian businesses get the most value from a WAF when they treat it as one layer alongside secure coding practices and regular VAPT — not as a replacement for either.

Cloud WAF Options for Indian Businesses

Most Indian SMBs and mid-market companies deploy WAF capability through one of three routes rather than standing up dedicated hardware:

  1. CDN-integrated WAF. Major content delivery networks bundle WAF functionality into their edge network, so enabling it is largely a configuration change on traffic already routed through the CDN for performance — usually the fastest path for a company that already uses one.
  2. Cloud provider-native WAF. The major public cloud platforms (AWS, Google Cloud, Microsoft Azure) each offer a WAF service integrated with their load balancers and API gateways, useful when your application is already hosted natively on that cloud.
  3. Managed security service. For businesses that want rules actively tuned and monitored rather than self-managed, a provider configures and maintains the rule set — useful for teams without a dedicated in-house security engineer.
🛡️
SECURITY
Whichever route you choose, verify the WAF terminates TLS correctly (so it can actually inspect encrypted traffic), supports your application's specific frameworks without excessive false positives, and gives you real-time or near-real-time logging — you need to see what was blocked and why, not just a black-box "protected" status.

When Indian Businesses Should Deploy a WAF

A WAF earns its place quickly for specific situations, and is lower priority for others:

Deploy early if: you run an e-commerce checkout or payment flow, handle customer PII or health data (relevant under the DPDP Act's obligation to implement reasonable security safeguards), have a public API consumed by third parties, or have previously experienced bot abuse or credential stuffing. Any internet-facing application handling regulated data should treat a WAF as a baseline control, reviewed alongside your broader DPDP compliance posture.

Deploy it, but don't stop there, if: your application has never had an independent penetration test. The WAF reduces exposure while you close code-level findings; it should never be the reason a known vulnerability stays unpatched.

Lower urgency if: you run a purely internal tool with no internet exposure, or a low-traffic site with no forms, logins, or data collection — though even these benefit from basic bot protection as they grow.

The sequencing that works best in practice: deploy a WAF for immediate perimeter coverage, then run a VAPT engagement — delivered with a CERT-In empanelled partner where a formal audit trail is required — to fix the actual code-level issues the WAF is currently compensating for. Bachao.AI, built by Dhisattva AI Pvt Ltd, runs automated vulnerability assessment and penetration testing that surfaces exactly these gaps. A free VAPT scan is a fast way to see where your application stands, and more guides like this one are on the Bachao.AI blog.

Frequently Asked Questions

Does a WAF replace the need for penetration testing?
No. A WAF filters known and suspicious attack patterns at the network edge in real time, but it doesn't find or fix vulnerabilities in your code, and it often can't detect business-logic flaws that look like normal traffic. VAPT actively probes your application for what the WAF might miss.
What is the difference between signature-based and behavioral WAF detection?
Signature-based detection blocks requests matching known attack patterns from a maintained rule library — fast and reliable against cataloged exploits. Behavioral/ML-based detection builds a baseline of normal traffic and flags deviations, catching novel attacks and bot abuse signatures miss, at the cost of a higher initial false-positive rate.
Can a WAF stop a DDoS attack?
A WAF is effective against Layer 7 (application-layer) DDoS — floods of legitimate-looking HTTP requests aimed at exhausting server resources. It is not designed to absorb large-scale network-layer volumetric DDoS attacks, which require dedicated network-level DDoS mitigation alongside a WAF.
Is a WAF mandatory for DPDP Act compliance in India?
The DPDP Act does not name a specific product like a WAF as mandatory, but it requires data fiduciaries to implement "reasonable security safeguards" to prevent personal data breaches. For any internet-facing application handling personal data, a WAF is a widely accepted baseline control toward meeting that obligation, alongside encryption, access controls, and regular security testing.
How much manual tuning does a WAF need after initial setup?
More than most teams expect. A default rule set is rarely calibrated to your application's traffic, so plan for an initial tuning period — often running new rules in monitor-only mode first — followed by periodic review as traffic patterns change.
Should a small Indian business deploy a WAF before or after its first security audit?
Deploy the WAF first since it typically requires only a DNS or configuration change, then run a VAPT engagement to find the underlying code issues. Running both together gives faster protection now and a prioritized fix list for what the WAF is currently compensating for.
BR

Bachao.AI Research Team

Cybersecurity Research

AI-powered security research and threat intelligence from the Bachao.AI team. Covering the latest vulnerabilities, CVEs, and cybersecurity developments affecting Indian businesses.

Get cybersecurity insights for Indian SMBs

Weekly vulnerability alerts, DPDP compliance tips, and security guides. No spam — unsubscribe anytime.

We respect your privacy. Your email is never shared.

Find out if you're exposed to this class of threat

Free automated scan — risk score in under 2 hours. No credit card required.

Scan Your Attack Surface
Find your vulnerabilitiesStart free scan →