Skip to content

fix(log): mask secret values in logged info tables - #1947

Merged
mrrobot47 merged 2 commits into
EasyEngine:developfrom
mrrobot47:fix/mask-secret-table-rows
Oct 12, 2026
Merged

mrrobot47 merged 2 commits into
EasyEngine:developfrom
mrrobot47:fix/mask-secret-table-rows

Conversation

@mrrobot47

Copy link
Copy Markdown
Member

ee site clone creates the destination with a nested ee site create and logs that command's output, which ends with the new site's info table. The parent process never sees the passwords the nested command generates, so the destination's database password reached ee.log once per clone.

The last-resort pattern masking now also masks the value cell of a table row whose label names a password, secret, token or API key, such as | DB Password | … |, in multi-line and in flattened output. Other rows are left as they are, and what the command prints for the user is unchanged.

Tested with PHPUnit (PHP 7.4, 8.2 and 8.5), CI and live with a local clone: the destination's password no longer appears in ee.log, and the clone output still shows it.

site clone runs ee site create in a child process and logs its output, which ends with the new site's info table. The parent never sees the generated passwords, so the DB Password, DB Root Password and WordPress Password values reached ee.log. mask_secret_patterns() now masks the value cell of any table row whose label names a password, secret, token or API key.

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

The regex masks unrelated labels containing secret-key substrings, and regression tests are missing.

1 open finding
What changed in this PR

Adds last-resort masking for secret values appearing in logged information tables.

Changes:

  • Masks password, secret, token, and API-key table cells.
  • Preserves existing masking behavior for other formats.
File Description
php/​utils.php Adds table-row secret masking.

🧠 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 php/utils.php Outdated
A label like Cache bypass, Passenger or Tokenizer only contains a keyword, so its row was masked too. The keyword now has to be a word of the label (password, passwd, passphrase, pass, pwd, secret, token or API key, optionally plural).

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.

🟢 Approval recommended

The masking logic addresses the reported leak without affecting user-visible output or unrelated rows.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@mrrobot47
mrrobot47 merged commit 2d1d87c into EasyEngine:develop Oct 12, 2026
11 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