Security model
This page puts FlowCatalyst’s security mechanisms in one place: who is trusted with what, how each boundary is defended, and what is deliberately left to you. Each topic links to the page that explains it in full. For the configuration checklist, see security hardening.
Actors and trust boundaries
Section titled “Actors and trust boundaries”flowchart TB
subgraph Internet["Untrusted"]
U["Users and browsers"]
PU["Portal users"]
FD["Field devices"]
EXT["External callers to HTTP ingestions"]
end
subgraph Tenant["Your applications"]
APP["Applications and their<br/>service accounts"]
WH["Webhook receivers"]
end
subgraph Platform["Platform (trusted)"]
API["API, OIDC provider, console"]
WK["Workers: stream, scheduler, router,<br/>outbox, scheduled jobs"]
FN["Function runners<br/>(first-party code)"]
ING["Ingestor runtimes"]
DB[("PostgreSQL")]
end
IDP["Organisation IdPs"]
U -->|"password, passkey, 2FA, SSO"| API
IDP -->|"id_token via the OIDC bridge"| API
PU -->|"/portal"| API
FD -->|"/field, DPoP proofs"| API
APP -->|"bearer tokens"| API
WK -->|"signed deliveries"| WH
EXT --> ING
ING -->|"runtime API, service account"| API
FN -->|"control plane, runner role"| API
API --> DB
WK --> DB
| Boundary | What crosses it | Primary defence |
|---|---|---|
| Browser to platform | Sessions, console actions | Session cookie (HttpOnly, Secure, SameSite=Lax), CSRF provenance checks, CSP |
| Application to platform | API calls, events, jobs | Short-lived bearer access tokens, permission checks in every handler, client scoping |
| Platform to application | Deliveries, scheduled-job firings | HMAC signature over the received bytes, bearer token of the signing service account |
| Organisation IdP to platform | Federated sign-in | OIDC with PKCE, state and nonce; issuer, email-domain and tenant binding |
| Device to platform | Field sign-in and refresh | Platform-held, peppered PINs; tokens bound to a device key |
| Platform to the internet | Outbound HTTP to customer-configured URLs | The outbound delivery guard |
| Platform to function code | Invocations and host calls | A sandbox for fault isolation; capabilities only as declared |
| Data at rest | Secrets, client secrets, signing keys | AES-256-GCM field encryption under the application key; verify-only hashes; external references |
Tokens and signing keys
Section titled “Tokens and signing keys”The platform is its own OAuth 2.0 and OpenID Connect provider (/oauth/*, discovery and JWKS under
/.well-known/*), written in-house rather than with a library
(why). Access, field and client-assertion tokens are signed
with RS256 by default; ID tokens use the algorithm each OAuth client picks (RS256, EdDSA or
ML-DSA-65), and the session cookie is an HS256 token only the platform verifies.
| Token | Lifetime | What it is for |
|---|---|---|
id_token |
5 minutes, fixed | An assertion to one application about who signed in, with roles narrowed to that application. Not a credential |
| Access token | FC_JWT_ACCESS_TOKEN_TTL_SECS (1 hour) |
The credential for /api. A relayed user token cannot be used to act as that user elsewhere: token_use and apiAccess say what a token may do |
| Refresh token | OIDC_REFRESH_TOKEN_TTL (7 days), an absolute cap for the family |
Rotated on every use. Presenting an already-rotated token revokes the whole family (reuse detection), except within a 10-second replay leeway for a client retrying its own refresh |
Session (fc_session cookie) |
OIDC_SESSION_TTL (24 hours) |
The console and the platform’s own sign-in |
| Field access token | FC_FIELD_ACCESS_TOKEN_TTL_SECS (10 minutes) |
Device-bound; the refresh token carries the session |
See tokens, token claims and id_token as an assertion, access token as a credential.
Signing keys. With FLOWCATALYST_APP_KEY set, FC_JWT_KEY_STORE defaults to database: the
platform keeps its signing keys in PostgreSQL (jwt_signing_keys), sealed under the application key,
and rotates them itself. RS256, EdDSA and ML-DSA-65 keys rotate every 90 days, each successor published
in the JWKS a day before it signs; the HS256 session-cookie key rotates every 30 days. Only API processes
rotate, one at a time under an advisory lock; every process reloads the keyring every 30 seconds, so a
standalone push gateway reads the platform’s keys from the same database and needs no key of its own. A
configured RSA key (FLOWCATALYST_JWT_PRIVATE_KEY, FC_JWT_SIGNING_KEY_PEM or FC_JWT_SIGNING_KEY_PATH)
is adopted once as the active RS256 key and rotated away 90 days later. For an unscheduled or emergency
rotation use fc-server signing-keys list | rotate | expire
(fc-server). With FC_JWT_KEY_STORE=config, or without an
application key, the old behaviour applies: one configured RSA key, never rotated, the same on every
replica, with an ephemeral key and a warning when none is set (tokens then die on restart and replicas
reject each other’s, so production must set one). See the
key rotation runbook.
Revocation and introspection. /oauth/revoke revokes only tokens issued to the authenticated
client (FC_OAUTH_REVOKE_ENFORCE_CLIENT, on by default). /oauth/introspect can be restricted to
client authentication (FC_OAUTH_INTROSPECT_CLIENT_AUTH_ONLY).
Sign-in
Section titled “Sign-in”Passwords are hashed with Argon2id (64 MiB, 3 iterations, parallelism 4). The policy follows NIST SP 800-63B: a length floor of 8, a common-password blocklist and “not your own identity”, with no composition rules. Applications that manage their own users through the SDK’s relaxed reset path own their own rules.
Brute force. Login backoff throttles per identifier and IP (3 free failures, then a doubling
delay up to 5 minutes) and locks an identifier for 15 minutes after 100 failures from any address in
an hour. Distributed rate limits cover /oauth/token, /oauth/authorize and password reset, with
per-instance governors in front. Every attempt is recorded in iam_login_attempts.
Second factors. TOTP, email PIN and passkeys. A passkey does not exempt the password path:
signing in with a password still requires the second factor
(why). Password reset: a user with no strong
factor resets by an emailed link; a user with an authenticator app or a passkey must confirm the link
with that factor. Routing users without a strong factor to an administrator approval queue instead is
opt-in (FC_PASSWORD_RESET_REQUIRE_STRONG_FACTOR, default off). See
second factors.
The OIDC bridge to organisation identity providers
Section titled “The OIDC bridge to organisation identity providers”When an email domain is mapped to an organisation’s IdP, the platform signs the user in as an OIDC client of that IdP:
- State, nonce and PKCE (S256) from a CSPRNG; the state is single-use, consumed atomically, and expires after 10 minutes. The return URL is limited to a same-site relative path.
- Issuer binding. For a multi-tenant IdP whose signing keys sign every tenant’s tokens, the
provider’s issuer pattern must pin the issuer: anchored, with the tenant spelled out. New broad
patterns are refused at save (
ISSUER_PATTERN_NOT_PINNED). - Email-domain and tenant binding. The token’s email domain must equal the domain the login
started from, the tenant claim must match the provider’s required tenant when set, and guest
accounts are refused. Optionally, an
email_verified: falseclaim is refused (FC_OIDC_REJECT_UNVERIFIED_EMAIL). - Provisioning comes from the mapping, never the token. A new user’s scope and home client are taken from the email-domain mapping, whose scope must be explicit (why). IdP roles are applied only when mapped and allowed, so a compromised IdP cannot grant arbitrary platform roles.
- IdP client secrets are encrypted at rest; a secret that cannot be decrypted fails the login rather than falling back to plaintext. The provider cache is keyed on the secret reference, so a rotated secret takes effect at once. The bridge has its own per-IP rate limit.
See sign-in and federation and the IdP login failures runbook.
Authorization
Section titled “Authorization”Every /api write handler makes exactly one permission check, and the URL is never the check. A
principal’s tier (anchor, partner or client) and its client grants bound what it can reach; roles
are canonical application:role names confined to their application’s permissions. A principal
asking for something outside its scope gets 404, not 403, so the response does not confirm that
the thing exists (why). A user with no role reaches only
their own profile (why). Service accounts can
be confined to named applications (the applications claim). See
permissions and roles, tenancy and
principals.
Separate identity planes
Section titled “Separate identity planes”- Portal identity (
/portal/*,ptu_) is a separate plane for a client’s own customers, with its own tokens and no refresh tokens. Portal identities are never platform principals, so a portal account cannot reach/api. The platform authenticates; each portal app authorizes. See portal identity and why it is separate. - Field workers (
/field/*) sign in with platform-held PINs on enrolled devices. The threats are specific: PIN guessing, spraying across workers from one stolen device, offline cracking of a database dump, device theft and token exfiltration. The mitigations: a hard lock after failures since the last success and a 6-digit minimum; failure budgets per device, per client and per IP; PINs hashed with Argon2id after an HMAC pepper derived from the application key, so a dump alone is useless (without the key every PIN operation fails closed); sessions bound to a non-extractable device key with a DPoP-style proof on every refresh; short access tokens and remote revocation; a biometric never identifies a worker on a shared device; on a personal device, where the client’s field policy turns unlock keys on, a worker can enrol a hardware-held key so a biometric unlocks their session (amr["hwk","uv"]); badges are an identifier, never the whole credential. See field-worker identity and platform-held PINs and device sessions.
Deliveries and callbacks
Section titled “Deliveries and callbacks”Webhook signing. Every delivery carries X-FlowCatalyst-Signature, an HMAC-SHA256 over the
X-FlowCatalyst-Timestamp followed by the exact bytes sent, and a bearer token. Both come from one
service account: the subscription’s explicit override, else the connection’s service account, else
the application’s. The first that names an account decides, with no fall-through, so a rotated or
deactivated credential cannot keep working by accident (why).
Receivers verify the signature over the raw body before parsing it
(sign the received bytes). Scheduled-job firings are signed
the same way with the owning application’s service account. See delivery and
webhook signatures.
The internal delivery callback (/api/dispatch/process) accepts only messages the scheduler
queued: each carries an HMAC of the job id under a key derived from FLOWCATALYST_APP_KEY with HKDF,
checked in constant time. The scheduler refuses to start without the key.
Outbound requests. Customer-configured URLs (subscription and connection endpoints, scheduled-job targets, SDK dispatch-job targets) are vetted by the outbound delivery guard at write time and again at dial time after DNS resolution: cloud metadata and link-local addresses are always refused, loopback and private ranges unless explicitly allowed. A function’s outbound HTTP goes through the same dial-time check on every redirect hop. Ingestion sources have their own address check, which allows private ranges (sources commonly live inside the network) but refuses loopback, link-local and metadata addresses and guards against DNS rebinding.
Browser protections
Section titled “Browser protections”The fc_session cookie is HttpOnly, Secure outside development and SameSite=Lax. On the API, an
unsafe request authenticated by that cookie must prove browser provenance (Sec-Fetch-Site, else a
matching Origin; a request with neither is refused) and carry JSON. The console applies the same
provenance rule to every POST, sends a strict Content-Security-Policy, frame-ancestors 'none',
nosniff and no-store, and redirects only to same-origin /ui paths after sign-in. The platform API
sends no CORS headers; only the push gateway, the field-worker sign-in (/field/*) and function endpoints with a declared
policy answer cross-origin requests. See API server and console.
Secrets
Section titled “Secrets”| Kind | At rest | Read by |
|---|---|---|
| OAuth client secrets, webhook signing secrets, IdP client secrets, field-encryption values | AES-256-GCM under FLOWCATALYST_APP_KEY (versioned format, rotation through the comma-separated FLOWCATALYST_APP_KEY_PREVIOUS and fc-server reencrypt); verify-only secrets as an HMAC (hashed:v1:), never decryptable |
The platform only |
| Platform-configuration secrets | Encrypted; never serialised in a list or read | One audited endpoint that returns the plaintext, gated by its own permission (platform:admin:config:reveal) (why) |
External references (aws-sm://, aws-ps://) |
Only the reference is stored | Resolved by the platform from AWS when handed out, cached 5 minutes, limited to the prefixes in FC_SECRET_REFERENCE_ALLOW (off when unset) (why) |
| Function and ingestion secrets | As platform settings or references | Delivered to a runner in its desired state (never logged), or to an ingestor only for a binding its live definition names, while it holds the lease; each ingestion fetch is security telemetry, a refused one audited |
| Database credentials | Environment, or AWS Secrets Manager with rotation | The server |
Credential publishing is off unless FC_CREDENTIAL_PUBLISH=aws-ps is set. It then offers, per service account or confidential OAuth client, to write a copy of the credentials to AWS Parameter Store under a configured prefix. The copy is additional: the credentials stay where they are, and the choice is opt-in on each owner.
Trace capture never carries credentials out: the ingestor redacts credential-like header, query and body values, URL user info, every query value except paging, and the secret values it fetched, before a record exists; function traces are opt-in and time-boxed. See configuration and secrets.
Functions: the trust model
Section titled “Functions: the trust model”Every function is first-party code, written and published by the platform’s operators; customers never upload their own. The runner’s sandbox (WebAssembly instances on wazero, the platform’s own JavaScript engine, or the JVM host in the ingestor) is there for fault isolation and limited reach: a crashing, leaking or runaway function cannot take down the runner, exceed its memory budget, or reach anything its describe document did not declare (hosts, events, dispatch targets, databases, the platform token). It is not hardened against a deliberately hostile author, and the engine must not be used to run third-party code without a new decision (why). A function that needs to call another service gets a platform token as its application’s service account, minted by the platform and never handed a client secret (why).
State changes go through use cases, which write their audit record in the same transaction as the change
(aud_logs), with the acting principal. Sensitive reads and operator actions are audited too: secret
reveals, redrives of completed jobs, payload edits (sizes and digests, not content), push settings and
trace windows, and refused ingestion secret fetches. See audit, traces and logs.
Threats and mitigations
Section titled “Threats and mitigations”| Threat | Mitigation | Where |
|---|---|---|
| Stolen access token | One-hour lifetime; token_use limits what it can do; scoping to tier, clients and applications |
internal/platform/auth/authservice |
| Stolen refresh token | Rotation with reuse detection revokes the family; absolute family lifetime | auth/grantstore/rotate.go |
| Token forged or replayed against another app | Signature, issuer and audience checks; id_token is an assertion, not a credential |
auth/provider, auth/oauthapi |
| Password guessing and spraying | Login backoff per identifier and IP, global lock per identifier, distributed rate limits, Argon2id | auth/loginbackoff, shared/ratelimit, auth/passwordhash |
| Account takeover by password reset | Emailed link, confirmed with TOTP or passkey when the user has one; reset rate limits; optional approval queue | platform/passwordreset, platform/resetapproval |
| Cross-tenant SSO login | Pinned issuer pattern, email-domain binding, tenant claim, guest refusal | auth/bridge, platform/identityprovider |
| Compromised IdP granting roles | Only mapped and allowed roles are synced | platform/idp |
| CSRF on the console or API | SameSite=Lax, provenance checks, JSON-only cookie writes |
shared/middleware/crossorigin.go, ui/guard |
| Forged webhook to a receiver | HMAC over timestamp and received bytes, per-connection signing secret, bearer token | dispatchjob/processing, SDK verifiers |
| Forged call to the delivery callback | HKDF-derived HMAC of the job id, constant-time check | scheduler/auth.go |
| Server-side request forgery through configured URLs | Outbound guard at write and dial time, metadata always blocked; function httpAllow; ingestion address checks |
internal/netguard, functions/runner/capabilities.go |
| Database dump | Secrets encrypted or hashed; PINs peppered; external references keep some secrets out of the database entirely | shared/encryption, fieldidentity/pin, internal/secretref |
| Field device theft or PIN spraying | Device-bound sessions with proofs, per-device and per-client failure budgets, remote revoke | platform/fieldidentity, platform/fieldauth |
| Runaway or buggy function | Deadlines, memory budget, per-function permits, declared capabilities only | internal/functions/engine, functions/budget |
| Secrets leaking through traces | Opt-in, time-boxed windows; redaction before capture | Ingestor TraceRedactor, function trace design |
Known limits and open items
Section titled “Known limits and open items”These are true of the current code; each is either a deliberate default or a configuration you should review.
- Legacy broad issuer patterns still sign in until
FC_OIDC_ISSUER_PATTERN_REQUIRE_PINNED=true. They are flagged at start-up, on first use and in the console. Fix the flagged providers, then turn it on. - The router’s HTTP surface has no authentication unless configured. With
FC_ROUTER_AUTH_USERunset,/router/*(dashboard, in-flight messages, breaker resets) is open to anyone who can reach the API listener. Set the router credentials, or keep the path off your public load balancer. - The MCP endpoint does not authenticate its caller; it acts with its own credential. It binds to localhost by default; keep it there or put an authenticating proxy in front.
- The outbox admin API has no authentication; it listens on
127.0.0.1only. - An ephemeral signing key is generated, with a warning, only without the keyring (no application key, or
FC_JWT_KEY_STORE=config) and no configured key. SetFLOWCATALYST_APP_KEYso the keyring is used. RealIPis on by default and trustsX-Real-IPand the leftmostX-Forwarded-For. Rate limits key on the rightmost hop, but turn the middleware off (FC_HTTP_REAL_IP_MIDDLEWARE=false) where no proxy sets those headers.- Scheduled-job firings for a job with no application link, or an application with no webhook credentials, are sent unsigned (with a warning); a verifying receiver refuses them.
- The reset approval queue is off by default: a user without a strong factor resets by email alone.
- The function sandbox is not a hostile-code boundary, by design.
- OAuth clients’ allowed-origins lists are stored but not enforced: the OIDC endpoints send no CORS headers.