Database audit fixes
Transport Encryption: fixing all 5 checks
The transport encryption audit asks each engine whether TLS is required and when its server certificate expires, so a failure means credentials and query results cross the network in clear text.
The two certificate checks skip in the case that sounds worst: MySQL with no ssl_cert set reports "No server certificate configured" and PostgreSQL with ssl off reports "TLS is off", so a server with no TLS at all produces a SKIP here plus a finding on the matching enforcement check. The three enforcement checks skip when the engine is not installed, when mongod.conf cannot be found, or when the audit account has no root socket login to query MySQL or PostgreSQL.
Transcribed from the database-security-transport-encryption audit script. For what the audit covers rather than how to fix it, see the Transport Encryption 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 TLS Enforcement
SoonChecks whether MySQL has TLS available and requires encrypted client connections
MediumNeeds root4 resultsMySQL Certificate
SoonChecks the MySQL server certificate for upcoming expiry
MediumNeeds root3 resultsPostgreSQL TLS
SoonChecks whether PostgreSQL has ssl on, weighted against whether it listens beyond localhost
MediumNeeds root4 resultsPostgreSQL Certificate
SoonChecks the PostgreSQL server certificate for upcoming expiry
MediumNeeds root3 resultsMongoDB TLS
SoonChecks whether MongoDB requires TLS for client connections, weighted against its bind address
MediumNeeds root4 results
How the Transport Encryption 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 5 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.
Transport Encryption questions
Run all 5 Transport Encryption 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