Org-create is open + orgs are never quota'd → total per-user cap bypass (disk-fill outage) #121

Stängd
öppnade 2026-07-19 06:56:05 +00:00 av supernaut · 1 kommentar
Ägare

Severity: CRITICAL — pre-onboarding infra audit (2026-07-19).

Total per-user cap bypass via organizations

  • ansible/roles/forgejo/defaults/main.yml:43 forgejo_default_allow_create_org: true and app.ini.j2:91 DEFAULT_ALLOW_CREATE_ORGANIZATION = true → anyone can create orgs.
  • The reconciler only iterates /api/v1/admin/users and never enumerates orgs (org quota is a deferred TODO in gitborg-reconciler.sh.j2). Organizations are separate quota owners → they fall to [quota.default] = -1 = unlimited.

Impact

Any user (including one in the JIT window, or anyone at all if the reconciler is down — see the fail-open quota issue) can create an org and push unlimited git/LFS/packages into it, bypassing every per-tier cap and filling the shared 60 GB data volume. Because Forgejo + Postgres + Kanidm share that volume, filling it is a full-instance outage.

Ask

  1. Flip forgejo_default_allow_create_org: false now that the reconciler is live (the defaults comment notes org-create is a tier privilege the reconciler grants; flipping false is now safe). ⚠️ apply-day: confirm the reconciler grants org-create to entitled users first.
  2. Add org enumeration + a default org quota group to the reconciler.

Effort M.

**Severity: CRITICAL** — pre-onboarding infra audit (2026-07-19). ### Total per-user cap bypass via organizations - `ansible/roles/forgejo/defaults/main.yml:43` `forgejo_default_allow_create_org: true` and `app.ini.j2:91` `DEFAULT_ALLOW_CREATE_ORGANIZATION = true` → **anyone** can create orgs. - The reconciler only iterates `/api/v1/admin/users` and **never enumerates orgs** (org quota is a deferred TODO in `gitborg-reconciler.sh.j2`). Organizations are separate quota owners → they fall to `[quota.default] = -1 = unlimited`. ### Impact Any user (including one in the JIT window, or anyone at all if the reconciler is down — see the fail-open quota issue) can create an org and push **unlimited** git/LFS/packages into it, bypassing every per-tier cap and filling the shared **60 GB** data volume. Because Forgejo + Postgres + Kanidm share that volume, filling it is a **full-instance outage**. ### Ask 1. Flip `forgejo_default_allow_create_org: false` now that the reconciler is live (the defaults comment notes org-create is a tier privilege the reconciler grants; flipping false is now safe). ⚠️ apply-day: confirm the reconciler grants org-create to entitled users first. 2. Add org enumeration + a default org quota group to the reconciler. Effort M.
Upphovsperson
Ägare

✅ Resolved + verified live (2026-07-19) — both parts applied:

  • Part 1 (PR #150): DEFAULT_ALLOW_CREATE_ORGANIZATION = false — confirmed in the running Forgejo config. Org-create is now gated to ent_orgs members via the reconciler (which PATCHes it per-user every 5 min).
  • Part 2 (PR #151): the reconciler now enforces org quotas. org-default (size:all = 5 GiB) + org-unlimited groups created; the gitborg org is exempted to org-unlimited (verified: org-unlimited members = [bitborg]); reconciler last-run status 0. New tenant orgs get the 5 GiB total cap — closing the bypass where a user pushed unlimited data into an org and filled the shared data volume.

Validated via a reconciler dry-run (org enumeration against /api/v1/admin/orgs works) then a live run. Forgejo healthy after the app.ini restart.

✅ **Resolved + verified live** (2026-07-19) — both parts applied: - **Part 1 (PR #150):** `DEFAULT_ALLOW_CREATE_ORGANIZATION = false` — confirmed in the *running* Forgejo config. Org-create is now gated to `ent_orgs` members via the reconciler (which PATCHes it per-user every 5 min). - **Part 2 (PR #151):** the reconciler now enforces org quotas. `org-default` (size:all = 5 GiB) + `org-unlimited` groups created; the `gitborg` org is exempted to `org-unlimited` (verified: `org-unlimited` members = `[bitborg]`); reconciler last-run status 0. New tenant orgs get the 5 GiB total cap — closing the bypass where a user pushed unlimited data into an org and filled the shared data volume. Validated via a reconciler dry-run (org enumeration against `/api/v1/admin/orgs` works) then a live run. Forgejo healthy after the app.ini restart.
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra#121
Ingen beskrivning angiven.