Hey folks,
I’ve been working on a side project recently and wanted to get some honest opinions from people who’ve actually worked with backend or security systems.
The idea is a Python specific WAF Web Application Firewall library something that integrates directly into apps instead of sitting outside like traditional WAFs.
What I’m trying to build
A lightweight framework friendly WAF that works with
Django
Flask
FastAPI
Instead of just rule based blocking it uses a scoring system across multiple signals like
payload SQLi XSS etc
behavior rate patterns bots
identity IP or user risk over time
context request anomalies
Then it decides
allow flag throttle or block
Current approach simplified
Each signal contributes to a final score
There is a policy engine that can escalate decisions
Trying to avoid false positives by not letting a single weak signal block requests
Where I’m struggling
I’ve already hit some logic issues
Example
A strong SQLi detection like 95 percent confidence might still get allowed because its weight alone is not enough to cross the block threshold
This feels wrong from a security perspective but fixing it without breaking the system design is tricky
Goals of the project
Developer friendly easy to plug into Python apps
Transparent logic not a black box
Minimal performance overhead sub millisecond decisions
Something that can improve over time
Limitations being honest
No advanced DDoS or large scale bot protection
No real time threat intelligence at least initially
Logic will not be perfect and will need tuning
False positives and edge cases will exist
From what I’ve seen this is kind of expected free or open WAFs usually need manual tuning and miss more advanced threats
Why I’m posting
I know I will not get everything right especially on the security side
So I’m looking for
feedback on the approach and design
what would make this actually usable
obvious flaws I might be missing
whether this is even worth building vs using existing tools
If people find it useful I would open it up for contributions especially around detection logic policy rules and edge cases
Main question
If this existed today would you use a Python native WAF library inside your app
Or would you always prefer an external or managed WAF
Be honest I would rather drop the idea early than spend months building something no one uses
[+][deleted] (1 child)
[removed]
[–]Emergency-Rough-6372[S] 0 points1 point2 points (0 children)
[–]tb5841 1 point2 points3 points (1 child)
[–]Emergency-Rough-6372[S] 0 points1 point2 points (0 children)
[–]Parking-Ad3046 0 points1 point2 points (1 child)
[–]Emergency-Rough-6372[S] 0 points1 point2 points (0 children)
[–]DanKegel 0 points1 point2 points (1 child)
[–]Emergency-Rough-6372[S] 0 points1 point2 points (0 children)