-
Notifications
You must be signed in to change notification settings - Fork 37
update google mcp secret #490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update google mcp secret #490
Conversation
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
Claude Code ReviewSummaryThis PR updates the OAuth credential storage logic to minimize stored secrets by emptying sensitive fields (client_id, client_secret, token_uri, refresh_token) in the credentials JSON stored in Kubernetes Secrets. While the security intention is commendable, this change introduces critical functional risks that could break Google Workspace MCP integration. Issues by Severity🚫 Blocker Issues1. Missing Refresh Token Breaks Token Renewal (oauth.go:682, 733) credentials := map[string]interface{}{
"token": accessToken,
"refresh_token": "", // ❌ BLOCKER: Emptied
"token_uri": "", // ❌ BLOCKER: Emptied
"client_id": "", // ❌ BLOCKER: Emptied
"client_secret": "", // ❌ BLOCKER: Emptied
}Why this is critical:
Evidence from PR #483:
The MCP integration expects valid credentials for token refresh, not just an initial access token. Expected behavior:
Impact:
🔴 Critical Issues2. No Testing or Validation (Missing) Why this is critical:
Required before merge:
3. Inconsistent Security Model (oauth.go:732-733) Data: map[string][]byte{
"credentials.json": credentialsJSON, // Empty sensitive fields
"access_token": []byte(accessToken), // ✅ Still stored
"refresh_token": []byte(""), // ❌ Now empty
}Why this is problematic:
Security note: Kubernetes Secrets are base64-encoded, not encrypted by default. All values in secrets have the same security properties unless using encryption at rest. 🟡 Major Issues4. Missing Architecture Decision Documentation (Missing ADR) Why this matters:
Recommendation:
5. Comment Inaccuracy (oauth.go:679) // Prepare credentials JSON with only the token, scopes, and expiry
// client_id, client_secret, token_uri, and refresh_token are empty strings to minimize stored secretsIssue: The comment says "to minimize stored secrets" but doesn't explain:
Better comment: // Prepare credentials JSON for workspace-mcp integration.
// Note: This stores only the access token, relying on [mechanism] for token renewal.
// See ADR-XXXX for security rationale and token refresh strategy.Questions Requiring AnswersBefore this PR can be approved, we need clear answers to:
Alternative SolutionsIf the goal is to reduce secret sprawl, consider these alternatives: Option 1: Use Kubernetes Secret ReferencesStore OAuth client secrets separately and reference them: credentials := map[string]interface{}{
"token": accessToken,
"refresh_token": refreshToken,
"token_uri": providerConfig.TokenURL,
"client_id": "{{ .Values.google.clientId }}", // Reference, not value
"client_secret": "{{ .Values.google.clientSecret }}", // Reference, not value
}Option 2: Use Encrypted SecretsEnable Kubernetes encryption at rest for secrets in the Option 3: External Secret ManagementUse external secret management (Vault, AWS Secrets Manager) for OAuth credentials. Option 4: Short-Lived CredentialsImplement a credential refresh sidecar that periodically updates tokens. RecommendationsBefore merging:
After validation: If workspace-mcp truly doesn't need these fields (which seems unlikely), update:
Pre-Commit Checklist (from CLAUDE.md)
Related Context
Verdict: ❌ Request Changes This PR cannot be merged without validation that workspace-mcp can renew tokens with empty credential fields. The current implementation will likely break all MCP sessions after 1 hour. 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
No description provided.