Skip to content

fix(compose): keep the MySQL root password out of the healthcheck process list#247

Open
NX1X wants to merge 1 commit into
TryGhost:mainfrom
NX1X:fix/mysql-healthcheck-password
Open

fix(compose): keep the MySQL root password out of the healthcheck process list#247
NX1X wants to merge 1 commit into
TryGhost:mainfrom
NX1X:fix/mysql-healthcheck-password

Conversation

@NX1X

@NX1X NX1X commented Jul 22, 2026

Copy link
Copy Markdown

The db healthcheck passes the root password with -p on the command line:

test: mysqladmin ping -p$$MYSQL_ROOT_PASSWORD -h 127.0.0.1
Anything that can list processes in that container's PID namespace - docker top ghost-db, ps from inside the container, or a compromised sidecar sharing the namespace - can read MYSQL_ROOT_PASSWORD in plaintext from the mysqladmin argv.

This passes the password via the MYSQL_PWD env var instead, which mysqladmin reads automatically and which never appears in the process list:

test: MYSQL_PWD="$$MYSQL_ROOT_PASSWORD" mysqladmin ping -h 127.0.0.1
Behaviour is identical (same user, same ping); only the password stops leaking into argv. MySQL's own docs advise against -p on the CLI for exactly this reason. docker compose config still validates.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 79417a2c-b02d-483e-91a5-e60fe7a78282

📥 Commits

Reviewing files that changed from the base of the PR and between e054a37 and 1b7dd8f.

📒 Files selected for processing (1)
  • compose.yml

Walkthrough

The MySQL container healthcheck now sets MYSQL_PWD from MYSQL_ROOT_PASSWORD before running mysqladmin ping, replacing the previous password flag usage.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the MySQL healthcheck password-handling change.
Description check ✅ Passed The description directly explains the MySQL healthcheck change and its rationale.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant