Skip to content

fix(backup): leave site credentials out of backup metadata - #515

Merged
mrrobot47 merged 3 commits into
EasyEngine:developfrom
mrrobot47:fix/strip-backup-metadata-credentials
Oct 12, 2026
Merged

mrrobot47 merged 3 commits into
EasyEngine:developfrom
mrrobot47:fix/strip-backup-metadata-credentials

Conversation

@mrrobot47

Copy link
Copy Markdown
Member

Backup metadata (metadata.json, uploaded with every backup and copied to the local backup dir) no longer holds the database and admin passwords. Restore always used the current site's credentials, so all backups still restore, on old and new versions alike. A migration removes the passwords from the local metadata copies (copies already on the remote are unchanged; they rotate out with no-of-backups). The EasyDash token is masked in the logged callback payload.

metadata.json, which is uploaded with every backup and kept as a copy in EE_BACKUP_DIR, held the site's database and admin passwords. Restore never reads them (it uses the current site's credentials), so they are now removed before the file is written, and a migration removes them from the local metadata copies of earlier backups. Backups made before this still restore. The EasyDash verification token is no longer written to debug output and is masked in the logged callback payloads.
The success callback payload is logged at debug level; its verification token is now replaced with ****** in the logged copy, so it doesn't depend on core masking the value. The metadata migration also checks the JSON encoding before replacing a file.

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

Site-auth passwords remain exposed, and partial migration writes could corrupt metadata.

3 open findings
What changed in this PR

Removes sensitive credentials from backup metadata and masks EasyDash verification tokens in logs.

Changes:

  • Redacts password fields from newly generated metadata.
  • Migrates existing local metadata copies.
  • Masks EasyDash callback tokens in debug output.
File Description
src/​helper/​Site_Backup_Restore.php Redacts metadata credentials and masks callback tokens.
migrations/​db/​20261001110000_site-command_strip_backup_metadata_credentials.php Removes credentials from existing local metadata.

🧠 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 migrations/db/20261001110000_site-command_strip_backup_metadata_credentials.php Outdated
Comment thread src/helper/Site_Backup_Restore.php Outdated
Comment thread migrations/db/20261001110000_site-command_strip_backup_metadata_credentials.php Outdated
…adata

Check the temporary file's byte count before it replaces the metadata, so a short write never truncates it.

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 changes consistently prevent new credential exposure and safely migrate existing local metadata.

0 open findings

3 resolved since last review

🧠 Review effort: Balanced

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