Database audit fixes
Authentication: fixing all 8 checks
The authentication audit reads mysql.user, pg_hba.conf, mongod.conf and redis.conf to find the accounts and rules that let a client reach your data without proving who it is.
Six of the eight checks need a working root login to the engine itself (mysql -N -e "SELECT 1" as root, or psql as the postgres user), and the MongoDB and Redis checks need root only to read mongod.conf or redis.conf, so an engine that is up but unreachable to the audit account reports SKIP rather than PASS. The other wording, "not installed", means no client binary, running process or config directory for that engine was found on the host at all.
Transcribed from the database-security-authentication audit script. For what the audit covers rather than how to fix it, see the Authentication 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.
MySQL Root Password
Checks whether the MySQL/MariaDB root account can log in with no password from an unprivileged shell
HighNeeds root3 resultsMySQL Anonymous Users
Checks mysql.user for anonymous accounts that let anyone connect without credentials
HighNeeds root3 resultsMySQL Passwordless Accounts
Checks for MySQL accounts with an empty password that do not rely on socket authentication
HighNeeds root3 resultsMySQL Remote Root
Checks whether the MySQL root account is restricted to localhost or may connect from remote hosts
HighNeeds root3 resultsPostgreSQL Auth Methods
Checks pg_hba.conf for trust, cleartext password and md5 authentication entries
HighNeeds root4 resultsPostgreSQL Password Hashing
Checks whether PostgreSQL password_encryption is set to scram-sha-256
MediumNeeds root3 resultsMongoDB Authorization
Checks whether security.authorization is enabled in mongod.conf
HighNeeds root4 resultsRedis Authentication
Checks whether Redis sets requirepass or ACLs, and whether it is bound beyond loopback
HighNeeds root4 results
How the Authentication 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.
All require root for a full result.
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: 8 of the 8 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.
Authentication questions
Run all 8 Authentication 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