rennf93 / fastapi-guard

A security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. It integrates seamlessly with FastAPI to offer robust protection against various security threats.
MIT License
2 stars 0 forks source link

Overzealous defaults? #4

Open petri opened 3 weeks ago

petri commented 3 weeks ago

I got blocked / banned just by using a a browser to access the fastapi openapi docs a few times: "Potential attack detected" and "Suspicious activity detected" from my own browser.

No idea why. Are there some defaults that are overzealous?

Is there any way to unban myself? My IP is whitelisted but that seems not to help. The docs don't clearly say whether giving an IP whitelist always blocks everything else, or...?

Great promise in this package but a bit of rough edges here...

Also, would be nice to be able to give CIDR address ranges to the IP whitelist/blacklist options, and whitelist by country.

rennf93 commented 3 weeks ago

Thank you for bringing this to my attention. I see what you mean, the issue you're facing.

I've been checking the code, and I think I found some possible causes for the issue:

I will now proceed with the development and testing of these fixes. I'll keep you updated.

Thanks again for your feedback!