Security checks: Application
Application settings in .env: debug mode, the environment, the application key, HTTPS and who can read .env itself.
From V8.3.0, these checks run in php artisan rconfig:security-check and in Security Center. Run only this group with:
cd /var/www/html/rconfigphp artisan rconfig:security-check --only=appA failing check shows the fix for your server, with its real paths, on the page and in the command output. The fixes below use the default install folder, /var/www/html/rconfig.
| Check | Severity | Checks that |
|---|---|---|
app.debug |
Critical | Debug mode is off |
app.env |
High | Environment is production |
app.key |
Critical | Application key is set and unique |
app.url_https |
High | rConfig is served over HTTPS |
app.env_file_perms |
High | .env is not readable by other local users |
Debug mode is off
Section titled “Debug mode is off”Check ID: app.debug · Severity: Critical
Why it matters: With APP_DEBUG on, error pages show stack traces, file paths, environment values and database details to whoever triggered them, including people who are not signed in.
How to fix: Turn debugging off under Settings > Logging & Debugging, or set APP_DEBUG=false in .env, then run cd /var/www/html/rconfig && php artisan config:cache.
References: NIST SI-11, OWASP ASVS V14.3, NIS2 21(2)(e)
Environment is production
Section titled “Environment is production”Check ID: app.env · Severity: High
Why it matters: Laravel relaxes several protections outside production. In the local environment the Horizon dashboard opens to anyone, without its sign-in gate.
How to fix: Set APP_ENV=production in .env, then run cd /var/www/html/rconfig && php artisan config:cache.
References: NIST CM-6, CIS Controls 4.1
Application key is set and unique
Section titled “Application key is set and unique”Check ID: app.key · Severity: Critical
Why it matters: APP_KEY encrypts the stored device and enable passwords and signs sessions. A missing, malformed or published key lets anyone who has it decrypt those secrets or forge a session.
How to fix: If APP_KEY is empty, run cd /var/www/html/rconfig && php artisan key:generate. If it is malformed or a published example key, generate a new key, then re-enter the device credentials, because values saved with the old key no longer decrypt.
References: NIST SC-12, NIST SC-28, NIS2 21(2)(h)
rConfig is served over HTTPS
Section titled “rConfig is served over HTTPS”Check ID: app.url_https · Severity: High
Why it matters: Over plain HTTP, sign-in passwords, session cookies, API tokens and device credentials cross the network unencrypted.
How to fix: Run sudo php artisan rconfig:ssl-self-signed for a self-signed certificate, or install your own certificate and set APP_URL to https://. In Docker: terminate TLS on your reverse proxy and set APP_URL to https://.
References: NIST SC-8, NIS2 21(2)(h), OWASP ASVS V9.1
.env is not readable by other local users
Section titled “.env is not readable by other local users”Check ID: app.env_file_perms · Severity: High
Why it matters: .env holds the database password, APP_KEY and the Redis password. Any local account that can read it can decrypt every stored credential.
How to fix: Run sudo chmod o-rwx /var/www/html/rconfig/.env.
References: NIST AC-6, NIST SC-28, NIS2 21(2)(i)
See Security hardening for the server settings behind these checks.