Can I secure a website using a simple whitelist system?
My idea is to port forward a website www.example.com
on my pc.
To secure it, I want to add a whitelist system. It will work like this:
When the server receives a request, it will read a file containing a list of allowed IPs and check if it contains the requester's IP. If it does, the user can access the website. If it doesn't, the server will not send any response. (meaning the page won't load).
To be whitelisted, users will have to browse to a specific URL, like www.example.com/super-secret-url
. When the server receives a request from this URL, it will add its IP to the whitelist.
I should point out that I am not expecting any targeted attacks since I will only be sharing this website with a few people.
This system seems quite safe to me. Is it? If not, why not? What can I do to improve it?
As you probably noticed, I am not an expert on this topic. So I'll try to clarify my question.
When I was researching the topic (port forwarding from my pc), People were talking about security risks: people being able to access my pc and/or network through my website. I want to know how this works and if I can prevent it like this.