Skip to content

bm cloud setup silently overwrites an existing rclone remote (and leaks the prior key) #922

Description

@phernandez

Problem

bm cloud setup [--workspace X] overwrites the target rclone remote with freshly minted credentials without warning. Two concrete hazards, both seen during live testing of #920:

  1. Silent clobber of a shared remote. A workspace with is_default=True maps to the shared basic-memory-cloud remote (remote_name_for_workspace). Running bm cloud setup --workspace <default-org> silently repointed basic-memory-cloud from one tenant's key to another (tid_qAoENp…tid_pHBhtF…). If that remote was serving a different tenant, existing sync breaks with no notice. (A backup of rclone.conf is written, but nothing tells the user it changed.)

  2. Leaked credentials. For legacy (non-partner-managed) tenants, POST /tenant/mount/credentials mints a new IAM key every call and never revokes the prior one, so each re-setup leaves an orphaned, still-valid key on the tenant's bucket.

Fix (this PR — CLI)

  • bm cloud setup aborts if the target rclone remote already exists, unless --force is passed. The check runs before credentials are minted, so an abort mints nothing. Message names the remote and the --force opt-in.

Follow-up (backend, separate)

  • Revoke the superseded mount key when re-minting (or have the CLI reuse a stored key), so re-setup doesn't accumulate live keys. Tracked here for the backend (basic-memory-cloud).

Surfaced while testing #920.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcloudBasic Memory Cloud

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions