Repository navigation
v0.9.0 — Security & Multi-Tenancy
Phase 8 — Security & Multi-Tenancy
FlowForge is now multi-tenant. A single deployment serves many organizations, and every tenant row is scoped by construction.
Highlights
- Organizations and memberships with
owner > admin > member > viewerroles. - Per-organization scoping: every tenant model carries an
organizationFK, andOrganizationScopedManager.for_organizationis the read path. Another tenant's id is a 404, not a 403 (ADR-014). - Per-tenant uniqueness:
(organization, name, version)for definitions and(organization, user, key)for idempotency claims. - Reversible migration:
0011adds nullable columns,0012creates a default organization and backfills; the reverse detaches and removes it. - API keys:
ff_<hex-prefix>_<hex-secret>, stored only as a hash, with prefix lookup, scopes (read < write < admin), expiry, rotation, revocation, and a one-time plaintext response. A key is bound to one organization and never inherits the staff cross-tenant bypass. - Append-only audit log, enforced by a database trigger that rejects
UPDATEandDELETE; entries for publish, trigger, requeue and API-key lifecycle, with redacted metadata. - Secret redaction by key name and by an explicit
secret: truemarker, applied to taskconfigin API responses. - Tenant-isolation suite: cross-tenant 404 matrix, role-permission matrix, and API-key lifecycle (expired, revoked, wrong scope, rotated, orphaned).
- STRIDE threat model and ADR-014.
bandit+pip-auditas required CI checks.
Security fixes
pip-audit found real vulnerabilities in the locked dependency set and forced:
djangorestframework3.17.2 → 3.18.3 (CVE-2026-114136, CVE-2026-114137, CVE-2026-114138)certifi2026.10.18 → 2026.10.19 (PYSEC-2026-4320)
Migrations
core.0011 (schema) → core.0012 (default-org backfill, reversible) → core.0013 (API keys) → core.0014 (audit log) → core.0015 (append-only trigger).
Verification
- CI run: https://github.com/Abolfazlrwm/flowforge/actions/runs/39921080486 —
lint(incl. bandit + pip-audit),test(unit on PostgreSQL + integration on PostgreSQL/RabbitMQ),schema,docs,docker(compose e2e) all green. - 645 unit tests locally (SQLite).
bandit: 0 issues.pip-audit: no known vulnerabilities.mkdocs build --strict: clean.
Breaking change: authorization is per organization, not per user. A run is now visible to every member of its tenant; a caller from another tenant receives 404.