Use Azure Managed PostgreSQL to Reduce the Security Risks of Self-Hosted Databases
Background Recently, a Linux server deployed on Azure suddenly started showing sustained 100% CPU usage. After investigation, I found a malicious program running as the postgres user, with persistence maintained through a cron scheduled task. The PostgreSQL installation on this server had the following characteristics: Port 5432 was not exposed to the public internet through Azure NSG; PostgreSQL was not used by the current business workload; The actual business workload used local MySQL; However, the PostgreSQL service was still installed and running; The system still retained the postgres user, home directory, cron jobs, and historical scripts....