Repository navigation
Fixes #34566: mask service connections in MCP responses - #35774
Conversation
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
Code Review ✅ Approved🔴 High risk · Masking stored credentials and PII across MCP reads while blocking service-connection patches changes sensitive data access; masking gaps could expose secrets. Masks stored service connection, pipeline source config, workflow request, alert webhook auth, and user credential fields in MCP responses via VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
🚦 Removed from the merge queue —
|
Describe your changes:
Fixes #34566
fields="*", which skips the masking each REST resource applies, so some connection and credential fields came back as stored.McpResponseUtils.maskSecretsnow masks them in one place, with the masker REST uses, for every caller: service connections, ingestion pipeline source config, automations workflow requests and alert webhook auth. A user'sauthenticationMechanismis left out of MCP responses, andget_entityhides a user's email from callers without PII access, as REST does.patch_entityno longer reaches a service's/connection; connection changes go through the service's REST API.Type of change:
Tests:
Unit tests
McpResponseUtilsTest,GetEntityToolTest,PatchEntityToolTest: the new cases fail without the change, plus one allowed service patch so the guard cannot over-block.org.openmetadata.mcp.toolsunit tests: 473/473 pass. Coverage not measured.Backend integration tests
McpIntegrationIT.testGetEntityDetailsMasksServiceConnectionPasswordandtestPatchEntityOnServiceSavesTheDescriptionAndLeavesTheConnection(a/descriptionpatch saves, a/connectionpatch is refused and the connection is unchanged): compiled locally, not run.Manual testing performed
get_entityon a database service and on users returns the masked fields, matching REST.patch_entityon a service's/connectionis refused and the stored service is unchanged.Checklist:
Fixes <issue-number>: <short explanation>Fixes #34566above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.25222125412andba01fccdb1f. Fixed the stated reason for the patch guard, a comment that claimed more than the code masked, and the other entity types. One finding is outside this PR and is tracked separately.0c180ca0d45(alert webhooks, wording) was not re-reviewed.ADR:2026-10-20-mcp-responses-mask-stored-credentials.

Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
MCP responses now hide stored credentials across services, ingestion pipelines, workflows, alerts, and users.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[MCP entity read] --> B[Read stored entity] B --> C[maskSecrets] C --> D[Copy and hide credentials] D --> E[Hide user email when required] E --> F[MCP response] G[Service patch] --> H{path or from reaches connection or root?} H -->|Yes| I[Reject without writing] H -->|No| J[Repository patch] J --> CReviews (3) · Last reviewed commit: "Merge branch 'main' into fix/mcp-mask-se..." · Reviewed by Greptile