Clone directories and the SSH deploy key are shared across tenants today, file:// and local-path ingest are accepted, artifacts are served without a tenant check and the runner scope is too loose. Multi-tenant production cannot open until one tenant's scan cannot read, write or trigger anything belonging to another.
Reject file://, local paths and source_ref server paths on ingest (ingest/mod.rs:127-133,233-247).
Drop the shared SSH deploy key (git.rs:139-147, ssh.rs). MVP uses HTTPS token auth; per-tenant keys are deferred to R1 (decision 5 in the plan).
serve_artifact checks the tenant (handlers/werkbank_jobs.rs:187-198).
Runner scope must be exactly werkbank:runner (handlers/werkbank_jobs.rs:56-58).
The static WERKBANK_RUNNER_TOKEN is refused in production.
Webhooks for an unknown tenant must not create a database (webhooks/github.rs:26 and the gitea/gitlab equivalents).
Acceptance
Two tenants scanning the same repository URL never share a clone directory or a work directory.
Ingest rejects file://, absolute and relative local paths, and server-side source_ref paths, with a test per case.
No SSH deploy key remains in the agent image or the configuration; git auth is HTTPS token only.
serve_artifact returns 404 for an artifact belonging to another tenant.
A runner token with any scope other than werkbank:runner is rejected; the static WERKBANK_RUNNER_TOKEN is refused when APP_ENV=production.
A webhook for an unknown tenant is rejected and creates no database.
Covered by the cross-tenant negative tests tracked in MVP-1.13.
## Goal
Clone directories and the SSH deploy key are shared across tenants today, `file://` and local-path ingest are accepted, artifacts are served without a tenant check and the runner scope is too loose. Multi-tenant production cannot open until one tenant's scan cannot read, write or trigger anything belonging to another.
## What to change
- Per-tenant clone directories (`pipeline/git.rs:86`, `orchestrator.rs:62,1116`, `api/handlers/graph.rs:264-276`).
- Reject `file://`, local paths and `source_ref` server paths on ingest (`ingest/mod.rs:127-133,233-247`).
- Drop the shared SSH deploy key (`git.rs:139-147`, `ssh.rs`). MVP uses HTTPS token auth; per-tenant keys are deferred to R1 (decision 5 in the plan).
- `serve_artifact` checks the tenant (`handlers/werkbank_jobs.rs:187-198`).
- Runner scope must be exactly `werkbank:runner` (`handlers/werkbank_jobs.rs:56-58`).
- The static `WERKBANK_RUNNER_TOKEN` is refused in production.
- Webhooks for an unknown tenant must not create a database (`webhooks/github.rs:26` and the gitea/gitlab equivalents).
## Acceptance
- [ ] Two tenants scanning the same repository URL never share a clone directory or a work directory.
- [ ] Ingest rejects `file://`, absolute and relative local paths, and server-side `source_ref` paths, with a test per case.
- [ ] No SSH deploy key remains in the agent image or the configuration; git auth is HTTPS token only.
- [ ] `serve_artifact` returns 404 for an artifact belonging to another tenant.
- [ ] A runner token with any scope other than `werkbank:runner` is rejected; the static `WERKBANK_RUNNER_TOKEN` is refused when `APP_ENV=production`.
- [ ] A webhook for an unknown tenant is rejected and creates no database.
- [ ] Covered by the cross-tenant negative tests tracked in MVP-1.13.
sharang
added this to the Production MVP milestone 2026-09-20 20:16:02 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Goal
Clone directories and the SSH deploy key are shared across tenants today,
file://and local-path ingest are accepted, artifacts are served without a tenant check and the runner scope is too loose. Multi-tenant production cannot open until one tenant's scan cannot read, write or trigger anything belonging to another.What to change
pipeline/git.rs:86,orchestrator.rs:62,1116,api/handlers/graph.rs:264-276).file://, local paths andsource_refserver paths on ingest (ingest/mod.rs:127-133,233-247).git.rs:139-147,ssh.rs). MVP uses HTTPS token auth; per-tenant keys are deferred to R1 (decision 5 in the plan).serve_artifactchecks the tenant (handlers/werkbank_jobs.rs:187-198).werkbank:runner(handlers/werkbank_jobs.rs:56-58).WERKBANK_RUNNER_TOKENis refused in production.webhooks/github.rs:26and the gitea/gitlab equivalents).Acceptance
file://, absolute and relative local paths, and server-sidesource_refpaths, with a test per case.serve_artifactreturns 404 for an artifact belonging to another tenant.werkbank:runneris rejected; the staticWERKBANK_RUNNER_TOKENis refused whenAPP_ENV=production.