- I have a website or perhaps an IRC server or whatever.
- The server keeps a list of all unique visitors (IP addresses).
- I have a panic button that, when activated, denies access to all visitors that are not already in the list.
This is to stop massive troll raids without shutting down the service for regulars.
What's the best way to implement this at a low level so that it's agnostic to the kind of server used? Like, some iptables voodoo or something?
Distro is Ubuntu.
You can write a script that allows just them, and drops everything else, something like:
Of course, if your IP list is very large, this becomes a resource hog.
Call it panickfw.sh
To unlock create another similar script that has:
You can tweak it so you can use arguments to execute either rule.