Security checks: Database
Security checks: Database
Section titled “Security checks: Database”Read-only checks of the MariaDB, MySQL or PostgreSQL server rConfig uses, made with the app’s own database user.
From V8.5.0, these checks run in php artisan rconfig:security-check and in Security Center. Run only this group with:
cd /var/www/html/rconfig8php artisan rconfig:security-check --only=dbEach failing check shows the exact fix for your server, including paths, on the page and in the command output. The sections below explain what each check looks for.
| Check | Severity | Checks that |
|---|---|---|
db.bind_address |
High | A local database listens on this host only |
db.app_user_privileges |
High | rConfig’s database user has only what it needs |
db.transport_tls |
High | A remote database connection is encrypted |
db.local_infile |
Medium | LOAD DATA LOCAL is disabled |
db.secure_file_priv |
Medium | Database file import and export is confined |
db.statement_logging |
Medium | The database does not log every statement |
db.password_hashing |
Medium | PostgreSQL stores passwords with SCRAM |
db.version_eol |
High | The database server still gets security fixes |
A local database listens on this host only
Section titled “A local database listens on this host only”Check ID: db.bind_address · Severity: High
When rConfig’s database runs on the same server, nothing else needs to reach it. Listening on every interface exposes it to password guessing and database exploits from the network.
References: NIST SC-7, CIS MariaDB/MySQL (bind_address), CIS PostgreSQL (listen_addresses), NIS2 21(2)(i)
rConfig’s database user has only what it needs
Section titled “rConfig’s database user has only what it needs”Check ID: db.app_user_privileges · Severity: High
With server-wide privileges, a SQL injection or a leaked .env gives control of every database on the server and, through FILE or SUPERUSER, of the server’s files.
References: NIST AC-6, CIS MariaDB/MySQL, CIS PostgreSQL, NIS2 21(2)(i)
A remote database connection is encrypted
Section titled “A remote database connection is encrypted”Check ID: db.transport_tls · Severity: High
When the database is on another host, every query (configs, encrypted credentials, sessions) crosses the network. Without TLS it can be read or changed in transit.
References: NIST SC-8, NIS2 21(2)(h), CIS PostgreSQL (ssl), CIS MariaDB/MySQL (require_secure_transport)
LOAD DATA LOCAL is disabled
Section titled “LOAD DATA LOCAL is disabled”Check ID: db.local_infile · Severity: Medium
local_infile lets a client read files from the server it runs on into a table. Combined with SQL injection it reads arbitrary files such as .env.
References: CIS MariaDB/MySQL (local_infile), NIST CM-7
Database file import and export is confined
Section titled “Database file import and export is confined”Check ID: db.secure_file_priv · Severity: Medium
An empty secure_file_priv lets SELECT … INTO OUTFILE and LOAD_FILE() read and write anywhere the database service can, including the web root.
References: CIS MariaDB/MySQL (secure_file_priv), NIST AC-6
The database does not log every statement
Section titled “The database does not log every statement”Check ID: db.statement_logging · Severity: Medium
Full statement logging (MySQL general_log, PostgreSQL log_statement = all or mod) writes every insert and update to disk, including encrypted credentials and session data, and grows without bound.
References: NIST AU-9, SEC-INT-002, CIS PostgreSQL (log_statement)
PostgreSQL stores passwords with SCRAM
Section titled “PostgreSQL stores passwords with SCRAM”Check ID: db.password_hashing · Severity: Medium
MD5 password hashes are weak and deprecated in PostgreSQL. scram-sha-256 resists offline cracking and replay.
References: NIST IA-5, CIS PostgreSQL (password_encryption)
The database server still gets security fixes
Section titled “The database server still gets security fixes”Check ID: db.version_eol · Severity: High
An end-of-life database release no longer gets security fixes.
References: NIST SI-2, NIS2 21(2)(e)
See Hardening guides for the configuration snippets behind these checks, and NIS2 Article 21 mapping for the controls they give evidence for.