Skip to content

v0.9.0 — Security & Multi-Tenancy

Choose a tag to compare

@Abolfazlrwm Abolfazlrwm released this 23 Oct 08:00
· 84 commits to main since this release

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 > viewer roles.
  • Per-organization scoping: every tenant model carries an organization FK, and OrganizationScopedManager.for_organization is 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: 0011 adds nullable columns, 0012 creates 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 UPDATE and DELETE; entries for publish, trigger, requeue and API-key lifecycle, with redacted metadata.
  • Secret redaction by key name and by an explicit secret: true marker, applied to task config in 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-audit as required CI checks.

Security fixes

pip-audit found real vulnerabilities in the locked dependency set and forced:

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.