Skip to content

fix(site): keep database passwords out of the log - #514

Merged
mrrobot47 merged 2 commits into
EasyEngine:developfrom
mrrobot47:fix/mask-db-password-in-log
Oct 12, 2026
Merged

mrrobot47 merged 2 commits into
EasyEngine:developfrom
mrrobot47:fix/mask-db-password-in-log

Conversation

@mrrobot47

Copy link
Copy Markdown
Member

Global-db SQL runs with --loose-skip-print-query-on-error, so a failing statement is not echoed into the logged output, and the new user's password is passed to $obfuscate. Loading a site registers its credentials for masking (when core provides it), and site info --format=json no longer writes the site row to the log. CI reads the logs with sudo.

When a statement fails, the mysql client echoes it to STDERR, and EE logs the STDERR of every command, so a failed CREATE USER wrote the new user's password to ee.log. Global-db SQL now runs with --loose-skip-print-query-on-error (older clients without the option only print a warning), and the password is passed as a value to obfuscate, which masks it in the logged output. Loading a site also registers its database and admin passwords with EE::obfuscate() when core provides it, and 'ee site info --format=json' prints the site row without writing it to the log.
The logs directory is now created readable by root only, so the log output step reads it with sudo.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Credential-bearing subprocess output can still reach logs because the current core does not redact captured stdout or stderr.

2 open findings
What changed in this PR

Prevents site credentials and database passwords from being written to EasyEngine logs.

Changes:

  • Outputs JSON site information without directly logging it.
  • Adds credential obfuscation and suppresses failed SQL query echoing.
  • Reads protected CI logs using sudo.
File Description
src/​site-type/​HTML.php Avoids directly logging credential-bearing JSON.
src/​helper/​site-utils.php Registers secrets and hardens global database logging.
.github/​workflows/​test_and_build.yml Reads root-protected logs in CI.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/helper/site-utils.php
Comment thread src/site-type/HTML.php
@mrrobot47
mrrobot47 merged commit 3ff0d91 into EasyEngine:develop Oct 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants