Skip to content

fix(telemetry): keep mysql's -P port and redact the real -p password (fixes #815) - #819

Open
charan-rathore wants to merge 2 commits into
CopilotKit:mainfrom
charan-rathore:fix/mysql-dash-p-port-scrub
Open

charan-rathore wants to merge 2 commits into
CopilotKit:mainfrom
charan-rathore:fix/mysql-dash-p-port-scrub

Conversation

@charan-rathore

Copy link
Copy Markdown
Contributor

The mysql credential rule in server/src/telemetry/scrub.ts kept the i flag, so the attached port form -P3306 matched as if it were -p: the port got redacted as a secret and a real password later in the same command survived into OTLP export (gh-815).

Make the rule case-sensitive like the sibling sshpass rule: -p is mysql's password, -P is its port. Pinned in server/tests/enterprise-controls.test.ts:

  • mysql -h db -P3306 -phunter2 app -> mysql -h db -P3306 -p[REDACTED] app
  • lowercase attached -p3306 still redacts, mysqldump -phunter2 db unchanged, bare/space forms untouched.

RED before (port redacted, -phunter2 survived), GREEN after; both scrub suites 52/52.

The mysql credential rule's i flag let the attached port form -P3306 match as if it were -p, so the port was redacted as a secret and a real password later in the same command survived into OTLP export. Make the rule case-sensitive like the sshpass rule (mysql is the same shape: -p is the password, -P is the port).

Fixes CopilotKit#815

Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
Mixed -P3306/-phunter2 command keeps the port and redacts the password; lowercase attached form and mysqldump pinned alongside.

Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-22T00:42:54.093740Z
We couldn’t complete this review. Comment @codex review to try again.
416a044 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@charan-rathore

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
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