The most secure version of a fresh install is the one with its convenient defaults stripped back out. New database software ships open enough to get you started fast, which is exactly the state an attacker is hoping to find. Day 18 was about closing that gap on MariaDB, then granting its mirror image on AWS access so narrow it can only look.

One Linux task, one AWS task. Install MariaDB and secure it, then write a read-only IAM policy for EC2. The tasks come from the KodeKloud Engineer platform.

MariaDB: install, then take the defaults away

sudo yum install -y mariadb-server

sudo systemctl enable --now mariadb