Ask HN: How to secure a server from the time it boots?
With the recent incident of NewsBlur (https://news.ycombinator.com/item?id=27613217), I was wondering how do you guys secure a server on the internet immediately after it boots. I usually do this:
1. terrafom to "create" the infrastructure. Basic security (ssh root login with keys). Servers are running nothing yet (no webserver, no databases, no nginx, etc.)
2. after everything has been created I use Ansible to provision the servers. Is in this moment when I apply all the "best practices" regarding security (remove root login, don't allow root password login, perhaps even change default ports, use a bastion host, setup passwords and certificates for internal servers, improve the firewall rules)
I don't run anything critical yet, but I wouldn't like to get compromised. Any suggestions or resources I can read so I can improve the security of my services?
3 comments
[ 5.6 ms ] story [ 28.8 ms ] threadProbably most important would be to ensure you have secure, tamper-proof backups of your customer data. You can always rebuild / redeploy your servers, VM's, containers, code. Getting customer data back without solid tested backups can break your business. The backups should be both local and in a disaster recovery location and tamper-proof. Remember that anything automation can change, so can attackers. Ansible would also be a great tool for automating the test copy and restoration of your backups to a staging environment. That staging environment could also be a good place to debug customer issues without affecting production.
[1] - https://security.stackexchange.com/
[2] - https://serverfault.com/
The former is written in "common engineering language," while the latter uses a lot of governmentish/ pseudo-legalese that often raises more questions than it answers (IMHO).
[1]: https://www.cisecurity.org/blog/cis-benchmarks-june-2021-upd...
https://www.webopedia.com/definitions/greenfield/