1053 words
March 25, 2023
5 minutes read
How a secure and resilient website should be hosted
Introduction
For that I have two pretty simple setups that I can think of with one of them being more easy to implement and probably a lot more stable while not being as secure as the second one.
WAF -> RPROXY 1 -> RPROXY 2 -> VPN -> BACKEND

Then, the second and third protections would be reverse proxies, they are useful for multiple reasons. First, if you use cloudflare even if they do not suspend sites following legal orders they do forward all the account records they have linked to your domain. It mean that they would have all of the dns records on your account and so have the ip of your server. It may seems pretty obvious but I have seen a lot of websites thinking an “offshore host” behind cloudflare is sufficient. These reverse proxy would also protect any dmca/abuse forwarded by cloudflare to the website hosting provider (which would be the reverse proxy in this case). These two reverse proxies would have to be on two different hosts known for their respect to privacy and ignorance of most things (like nicevps.net, svea.net, privex.io, buyvm.net, etc).
Then, after the waf and the two reverse proxies as a measure to protect the server in the occasion of the backend ip leaking we would have a reputable vpn on the backend server itself. For that we would need a vpn with port forwarding possibilities (I would use ovpn.net, ivpn.net or mullvad.net). This would shield your server in case the 3 proxies that there is before are somewhat compromised. It would also permits to hide the backend ip in other cases like if your server ip was leaking cause of a vulnerability in your website.
This is also important to know that for this setup to work you would have at any stage of your setup to make web ports only be accessible by the service before it. This would look like RPROXY 1 only allow WAF ips to contact him on port 80 and 443, RPROXY 2 allow only RPROXY 1 ips and your backend server only allow connections from RPROXY 2 ip. If you do not do that your backend ip will end up on indexing websites like censys.io or shodan.io which is something you do not want to happen.
I never tried to add that to the chain but I’m pretty sure to obscure the traffic coming in and off of your different proxies you could have multiple “fake” servers behind where you would send a copy of the packets you send to the next server on the chain, it would not be that helpful unless you have a lot of servers but I wanted to mention it.
To conclude, this setup is pretty bulletproof but still rest on the normal internet. What I mean by that is that if your adversary is the fbi like for breached they could just subpoena every step of your setup and end up finding your backend. It shouldn’t arrive without you noticing anything if you choose good hosts, countries to host and VPNs but still, this is technically not bulletproof.
WAF -> Clearnet PROXY -> tor

Now, the idea of this setup would be to host your website securely on tor (I will not explain how to do it here as there is already some good articles on that) and to setup your clearnet domain only to proxy the requests to your tor website by installing a Tor2web like proxy on your proxies servers.
I haven’t much experience with this setup but I have still done some tests using this setup in the past and everything worked fine for days without me noticing any issues.
Now, I must also talk about the principal problem that this setup imply. The biggest problem is that it would be pretty instable, websites on tor are already instable but add a proxy before that which tor haven’t been designed for and you get something experimental. Add to that a forum software which have probably been made for far more simples environments and you get something which would probably not work for a forum.
However, I find this setup interesting as even if it is not really useful for a forum where user need to stay logged in and where you do not want connections to time out while doing a post it may be useful for other sites. Pretty much any site which haven’t any user generated content and which doesn’t need a good uptime could benefit from this setup. Imagine for that your small torrent tracker, your private forum, your blog that everyone want down, your leak that you want to share on the Clearnet securely (but it would better not be to big with tor speeds), etc.
Conclusion
Thanks for reading all of that and I hope you learnt something today, if you have questions or corrections about what I wrote do not hesitate to send me an email to the email address below.