IP filtering on blueprints.

Is there an easy way of IP filtering in flask when ranges are involved? Also I heard from a 11 years old post that flask level IP whitelisting has security concerns. Is there a standard way of doing this or should I create another service that is safegaurded with gateway level security or something?
15 Replies
Percy
Percy5mo ago
Project ID: N/A
maddsua
maddsua5mo ago
railway doesn't currently have a firewall and I haven't heard about it being planned you can use an nginx proxy to filter IPs and stuff
King Jahad
King Jahad5mo ago
I can do that but the thing is I want it done on a particular level of api. /recieveWhatsAppMessages/*
maddsua
maddsua5mo ago
brody's gonna suggest something better than I can lol
Brody
Brody5mo ago
nginx proxies don't play well and require too much effort to get working properly with railways private network. just write a middleware for flask and use that instead, I wouldn't have even opened an 11 year old post
maddsua
maddsua5mo ago
but I just filter that in app
King Jahad
King Jahad5mo ago
I read proxies in that post and the alarms went off.
Brody
Brody5mo ago
reverse proxys are generally fine, and in this context, it absolutely would be perfectly fine
King Jahad
King Jahad5mo ago
I mean it said somebody can spoof IP using proxies?
King Jahad
King Jahad5mo ago
Ik this is not a good source
Brody
Brody5mo ago
nginx, caddy, a middleware, a firewall, there's nothing you can do if users just jump on their vpn
King Jahad
King Jahad5mo ago
fair enough and who is jumping facebook's vpn, right?
Brody
Brody5mo ago
true
King Jahad
King Jahad5mo ago
Cool