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?
sed -i -e 's/^active.*/active = yes/g' /etc/audisp/plugins.d/syslog.conf
To get caught up on some questions/best practices, ensure you have an account on StackExchange (security) [1] and ServerFault [2]. There are a lot of great resources for server setup. Lurk first, as some moderators are a bit elitist.Probably 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/