Database audit fixes
Configuration & Hardening: fixing all 7 checks
The configuration and hardening audit covers how the engine is run and backed up: the OS user it executes as, installer defaults left in place, pending engine patches and who can read your dumps.
Most skips here mean nothing was found to look at rather than nothing was wrong: the two backup checks search only /var/backups, /backup, /opt/backup, /srv/backup and /root/backups, three levels deep, for .sql, .sql.gz, .dump and .bak files, so dumps kept anywhere else report SKIP. The service user check skips when no mysqld, mariadbd, postgres, mongod or redis-server process is running at that moment, and Insecure Database Defaults and Transaction Log Placement skip without a root socket login to the engine.
Transcribed from the database-security-hardening audit script. For what the audit covers rather than how to fix it, see the Configuration & Hardening checklist.
Find your finding
Listed in the order the audit runs them. Take the check name from the third field of the result line and open its page.
Database Service User
SoonChecks whether running database engines execute as a dedicated unprivileged user rather than root
HighNo root3 resultsInsecure Database Defaults
SoonChecks each detected engine for installer defaults left in place after setup
LowNeeds root3 resultsDatabase Patches
SoonChecks for pending package and security updates for the installed database engines
HighNo root4 resultsTransaction Log Placement
SoonChecks whether transaction and binary logs share the same disk as the database data files
LowNeeds root3 resultsScheduled Database Backups
SoonChecks cron jobs and systemd timers for a scheduled database backup
MediumNeeds root2 resultsBackup File Permissions
SoonChecks whether database dump files in common backup paths are world-readable
HighNeeds root3 resultsBackup Encryption
SoonWhether database dumps are encrypted at rest
HighNeeds root4 results
How the Configuration & Hardening audit reads your server
Every check in this audit runs after the same preamble, and several of its results only make sense once you know what that preamble could and could not see.
Engine detection: HAS_MY, HAS_PG, HAS_MG, HAS_RD are set from client binaries, server processes or config directories. MYOK=1 only if mysql -N -e 'SELECT 1' works as root over the socket; PGOK=1 only if su postgres -c 'psql -X -tAc "SELECT 1"' works. RDCONF is /etc/redis/redis.conf or /etc/redis.conf; MGCONF is /etc/mongod.conf. Containerised databases are not detected by these probes; audit them with the Docker checks or exec into the container.
A SKIP is never a pass
A skipped check verified nothing at all. The most common cause is privilege: 5 of the 7 checks in this audit need root for a complete result. Before every run, each script works out which of four privilege modes it is in.
| Mode | How it is reached | What it means for your results |
|---|---|---|
root | The audit runs as UID 0. | Every privileged branch runs directly. No check skips for lack of permission. |
nopass | sudo -n true succeeds, so the account has passwordless sudo. | Privileged commands run through sudo -n. |
pass | A sudo password was supplied in the CtrlOps audit settings and accepted. | Privileged commands run through sudo -S. |
none | None of the above worked. | CAN_ROOT=0. Every privileged branch returns SKIP with a "Need root" message rather than guessing. |
If many checks skip with a “need root” message, run the audit as root, grant the audit account sudo (with or without NOPASSWD), or supply the sudo password in the CtrlOps audit settings.
Configuration & Hardening questions
Run all 7 Configuration & Hardening checks, in one click
CtrlOps runs this audit over your existing SSH connection - no agents, no scripts to manage. $7/user/month after a 1 month free trial - no credit card required.
✓ Start instantly·✓ No credit card·✓ No sneaky autorenewals