How to Decide If a WAF Belongs in Front of GraphQL

●2 ●24 ●135
calendar_today • schedule5 min read

A GraphQL API is still an HTTP application with a narrow front door. Most deployments expose one path, accept a document plus variables, and return JSON. That shape invites two mistakes: leaving the origin directly reachable, or assuming a web application firewall understands selections, fragments, and resolver cost. This checklist uses only controls described in the SafeLine documentation. Where those pages are silent, the item stays on the API, not in the proxy.

SafeLine is a self-hosted WAF. It filters and monitors HTTP traffic and is designed to block common web attacks, including SQL injection, XSS, code injection, OS command injection, CRLF injection, LDAP injection, XPath injection, RCE, XXE, SSRF, path traversal, backdoors, brute force, HTTP flood, and bot abuse (https://docs.waf.chaitin.com/en/home). It works as a reverse proxy: clients pass through it before they reach the server, and it forwards traffic it does not treat as malicious (https://docs.waf.chaitin.com/en/GetStarted/AddApplication). Nothing on those pages describes a GraphQL parser, an introspection switch, a complexity score, or a persisted-query catalog. If you need those, build them in the GraphQL server. A WAF placement is still worth a decision, because the same endpoint is ordinary HTTP and can carry injection payloads in headers, query strings, and bodies.

Placement checklist

Work through these gates before you change a production record.

  1. Confirm the protocol. SafeLine protects web apps by proxying HTTP and HTTPS. If the API is not reached that way, stop. Do not invent a side integration.

  2. Pick the hostname clients already trust. In Applications, Add Application asks for Domain, Port, and Upstream. Use 443 and enable SSL for HTTPS, or 80 for plain HTTP. Upstream is the real address of the GraphQL process. After saving, resolve that domain to the SafeLine server so clients never need the origin address (https://docs.waf.chaitin.com/en/GetStarted/AddApplication).

  3. Map each fear to a documented control. Injection and related web attacks map to the attack defenses above. Floods, brute force, and traffic surges map to rate limiting, which the docs describe as throttling traffic that exceeds defined limits, and the core list calls out IP-based rate limiting (https://docs.waf.chaitin.com/en/home). A web access control list is also named there. Do not write rule syntax the guides do not provide; configure it in the console and verify the result.

  4. Treat human challenges as optional, not as API authentication. Captcha is documented to allow human users and block crawlers and bots. Authentication challenge blocks visitors who do not enter the password. Either can shield a browser IDE pointed at /graphql. Either can also black-hole a mobile client or a partner job. If no human is in the loop, leave both off.

  5. Skip dynamic HTML and JS encryption for a JSON API. That feature encrypts HTML and JS on each visit. It is not a control for GraphQL documents or JSON responses.

  6. Match the host to the install guide before the pilot. You need Linux on x86_64 or arm64, Docker 20.10.14 or newer, Docker Compose 2.0.0 or newer, at least one CPU core, 1 GB of memory, 5 GB of disk, and a CPU with SSSE3 (https://docs.waf.chaitin.com/en/GetStarted/Deploy). On ARM, a Pro license is required; the Personal Edition is not supported on ARM. The same page notes that the LTS line is no longer maintained starting from 9.1.0-LTS on 14 August 2025, and recommends the current release for new setups.

  7. Prove the path with the published probes, then with your own POST. The application guide lists SQL injection, XSS, path traversal, code injection, and XXE samples as query strings, and tells you to expect a block page and to open the attack detail in the console. Run those against a test hostname. Then send a normal GraphQL query, a mutation, and a deliberately hostile string inside a variable. A query-string block does not, by itself, prove how a JSON body will be classified. The console is the evidence, not a guess.

  8. Keep schema policy at the origin. Depth limits, alias and batch ceilings, field authorization, and introspection policy are application concerns. SafeLine is not documented as a GraphQL gateway. Putting it in front does not authorize you to delete those checks.

Rate limits need a GraphQL-specific reading even though the feature is generic. One route receives almost every operation, so a low ceiling can punish a busy office NAT or a single backend egress address. Start from real client-IP rates, then tighten. Review the attack list after the change so a false block is visible before customers report it.

The home documentation calls the product production-ready, protecting over 1,000,000 websites and handling over 30,000,000,000 HTTP requests daily, and it publishes a general detection evaluation on 33,669 samples (https://docs.waf.chaitin.com/en/home). Those numbers are not a GraphQL score. Do not reuse them as one. As of September 30, 2026, SafeLine surpassed 700,000 installations worldwide. SafeLine Pro annual promotional pricing is $650-$880 versus the $1,000 regular price.

Does the documentation describe GraphQL body parsing?

No. It describes HTTP and HTTPS reverse-proxy filtering and a list of web-attack defenses. Plan for that, and test a real POST, instead of assuming a schema-aware inspection engine.

Where do clients send GraphQL after cutover?

They send it to the domain you added in Applications. That domain must resolve to the SafeLine host. SafeLine forwards cleaned traffic to the upstream you configured.

Can captcha replace API keys?

No. Captcha and the authentication challenge are visitor gates for humans and bots, as documented. Credential checks for apps, jobs, and partners still belong to your API.

What fails an install before GraphQL is even involved?

A host that misses the Docker, Compose, CPU, memory, disk, or SSSE3 requirements will not match the install guide. An ARM host without a Pro license is also the wrong pilot target, because the Personal Edition is not supported on ARM.

What should the first success metric be?

A documented attack sample blocked on a test hostname, a visible detail record in the console, and a legitimate GraphQL operation from a real client that still succeeds. Adoption of the proxy is not proof that resolver cost is under control.

If you are about to publish a GraphQL endpoint, walk this checklist, install from the official guide, and add the application before you argue about schema limits. As of September 30, 2026, SafeLine surpassed 700,000 installations worldwide. SafeLine Pro annual promotional pricing is $650-$880 versus the $1,000 regular price. You can review the project, the docs, and the current promotion here:

https://github.com/chaitin/SafeLine

https://docs.waf.chaitin.com/en/home

https://cyberserval.tech/landing/lto

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

A Textile Mill's Dyehouse Ramp Curve: Get One Step Wrong and the Sheet Belongs to the Master

aiomniu - Oct 18

How to Decide Whether a WAF Can Protect a GraphQL API

Muzilla - Oct 22

MCP Is the USB-C of AI. So Why Are You Plugging Everything In?

Ken W. Algerverified - Jun 10

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19

How to Decide If a Node.js App Belongs Behind SafeLine

Muzilla - Oct 22
chevron_left
2.5k Points • 161 Badges
104Posts
0Comments
1Connections
Homelab operator. Security tools. Self-hosted everything. Open source.

Related Jobs

View all jobs →

Commenters (This Week)

6 comments
2 comments

Contribute meaningful comments to climb the leaderboard and earn badges!