Skip to content

feat: restrict default IAM credentials in SaaS mode for security#18161

Merged
d-bytebase merged 3 commits intomainfrom
feat/restrict-default-iam-credentials-in-saas
Nov 21, 2025
Merged

feat: restrict default IAM credentials in SaaS mode for security#18161
d-bytebase merged 3 commits intomainfrom
feat/restrict-default-iam-credentials-in-saas

Conversation

@d-bytebase
Copy link
Collaborator

Summary

Disallow "Default" credential source for GCP, AWS, and Azure IAM authentication when Bytebase runs in SaaS mode on GKE to prevent security risks from using ambient cluster credentials.

Changes

Frontend

  • Disable "Default" radio option in SaaS mode for IAM authentication types
  • Show tooltip on hover explaining why the option is disabled
  • Auto-select "Specific Credential" when in SaaS mode
  • Add i18n strings in all 5 supported locales

Backend

  • Add validateIAMCredentialForSaaS() validation in instance_service.go
  • Reject default credentials for IAM auth in SaaS mode with clear error message
  • Pass profile to InstanceService for SaaS mode detection

Security Benefit

When Bytebase SaaS runs on GKE, the "Default" credential option could use the GKE cluster's service account credentials, which is a security risk. This change forces users to provide explicit credentials.

Test Plan

  • Verify "Default" option is disabled with tooltip in SaaS mode for GCP/AWS/Azure IAM
  • Verify "Default" option works in self-hosted mode
  • Verify backend validation rejects default credentials in SaaS mode
  • Test i18n strings in different locales

🤖 Generated with Claude Code

d-bytebase and others added 2 commits November 20, 2025 16:58
Disallow "Default" credential source for GCP, AWS, and Azure IAM authentication when Bytebase runs in SaaS mode on GKE. This prevents potential security risks from using ambient cluster credentials.

Changes:
- Frontend: Disable "Default" radio option with warning message in SaaS mode
- Backend: Add validation to reject default credentials for IAM auth in SaaS mode
- Add i18n strings in all supported locales (en, zh, ja, es, vi)
- Force explicit credential configuration for all cloud IAM authentication types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ng box

Change the UI to display the "Default credentials not available" message as a tooltip when hovering over the disabled Default radio button, instead of showing it as a separate warning box below the radio group.

This provides a cleaner UI while still communicating why the option is disabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@d-bytebase d-bytebase requested a review from a team as a code owner November 21, 2025 01:08
@cla-bot cla-bot bot added the cla-signed label Nov 21, 2025
Fix import order to pass Biome check. Move store import before proto imports to comply with import organization rules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@d-bytebase d-bytebase merged commit 45b64ed into main Nov 21, 2025
17 checks passed
@d-bytebase d-bytebase deleted the feat/restrict-default-iam-credentials-in-saas branch November 21, 2025 01:24
github-actions bot pushed a commit that referenced this pull request Nov 21, 2025
)

* feat: restrict default IAM credentials in SaaS mode for security

Disallow "Default" credential source for GCP, AWS, and Azure IAM authentication when Bytebase runs in SaaS mode on GKE. This prevents potential security risks from using ambient cluster credentials.

Changes:
- Frontend: Disable "Default" radio option with warning message in SaaS mode
- Backend: Add validation to reject default credentials for IAM auth in SaaS mode
- Add i18n strings in all supported locales (en, zh, ja, es, vi)
- Force explicit credential configuration for all cloud IAM authentication types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: show IAM credential restriction as tooltip instead of warning box

Change the UI to display the "Default credentials not available" message as a tooltip when hovering over the disabled Default radio button, instead of showing it as a separate warning box below the radio group.

This provides a cleaner UI while still communicating why the option is disabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: organize imports in CredentialSourceForm

Fix import order to pass Biome check. Move store import before proto imports to comply with import organization rules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 45b64ed)
@github-actions
Copy link

Successfully created backport PR for release/3.12.1:

d-bytebase added a commit that referenced this pull request Nov 21, 2025
) (#18162)

* feat: restrict default IAM credentials in SaaS mode for security

Disallow "Default" credential source for GCP, AWS, and Azure IAM authentication when Bytebase runs in SaaS mode on GKE. This prevents potential security risks from using ambient cluster credentials.

Changes:
- Frontend: Disable "Default" radio option with warning message in SaaS mode
- Backend: Add validation to reject default credentials for IAM auth in SaaS mode
- Add i18n strings in all supported locales (en, zh, ja, es, vi)
- Force explicit credential configuration for all cloud IAM authentication types

🤖 Generated with [Claude Code](https://claude.com/claude-code)



* refactor: show IAM credential restriction as tooltip instead of warning box

Change the UI to display the "Default credentials not available" message as a tooltip when hovering over the disabled Default radio button, instead of showing it as a separate warning box below the radio group.

This provides a cleaner UI while still communicating why the option is disabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)



* fix: organize imports in CredentialSourceForm

Fix import order to pass Biome check. Move store import before proto imports to comply with import organization rules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)



---------


(cherry picked from commit 45b64ed)

Co-authored-by: Danny Xu <98006139+d-bytebase@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
vsai12 added a commit that referenced this pull request Feb 6, 2026
…tance in SaaS mode

The `credentialSource` watcher that sets `iamExtension` on the data source
was not `immediate`, so it missed the value change made by the earlier
`isDefaultCredentialDisabled` watcher during component setup. This caused
GCP/AWS/Azure IAM credentials to never be initialized on new instance
creation in SaaS mode, falling back to default credentials which don't
exist.

Regression from #18161 which added the SaaS mode credential restriction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d-bytebase pushed a commit that referenced this pull request Feb 7, 2026
…tance in SaaS mode (#19267)

* fix(frontend): fix GCP IAM credentials not sent when creating new instance in SaaS mode

The `credentialSource` watcher that sets `iamExtension` on the data source
was not `immediate`, so it missed the value change made by the earlier
`isDefaultCredentialDisabled` watcher during component setup. This caused
GCP/AWS/Azure IAM credentials to never be initialized on new instance
creation in SaaS mode, falling back to default credentials which don't
exist.

Regression from #18161 which added the SaaS mode credential restriction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unused parameter to pass eslint check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: format ternary to satisfy biome

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
d-bytebase pushed a commit that referenced this pull request Feb 7, 2026
…tance in SaaS mode (#19267)

* fix(frontend): fix GCP IAM credentials not sent when creating new instance in SaaS mode

The `credentialSource` watcher that sets `iamExtension` on the data source
was not `immediate`, so it missed the value change made by the earlier
`isDefaultCredentialDisabled` watcher during component setup. This caused
GCP/AWS/Azure IAM credentials to never be initialized on new instance
creation in SaaS mode, falling back to default credentials which don't
exist.

Regression from #18161 which added the SaaS mode credential restriction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unused parameter to pass eslint check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: format ternary to satisfy biome

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
d-bytebase pushed a commit that referenced this pull request Feb 7, 2026
…tance in SaaS mode (#19267)

* fix(frontend): fix GCP IAM credentials not sent when creating new instance in SaaS mode

The `credentialSource` watcher that sets `iamExtension` on the data source
was not `immediate`, so it missed the value change made by the earlier
`isDefaultCredentialDisabled` watcher during component setup. This caused
GCP/AWS/Azure IAM credentials to never be initialized on new instance
creation in SaaS mode, falling back to default credentials which don't
exist.

Regression from #18161 which added the SaaS mode credential restriction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unused parameter to pass eslint check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: format ternary to satisfy biome

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants