Runtime, Storage & Gateway Security
When an administrator installs an app, FynnCloud’s orchestrator (FynnCloud AIO or the legacy Docker socket proxy) provisions an isolated runtime and routes all browser and server traffic through the App Gateway (/api/apps/:appId/proxy/**).
Container Isolation & Runtime Hardening
Section titled “Container Isolation & Runtime Hardening”Every app container starts with strict defaults:
- Per-app isolated network (AIO): Each app is attached to its own
fynncloud-app-net-<appId>network (internal: trueby default viaAIO_APPS_NETWORK_INTERNAL=true), reachable only fromfynncloud-server(andfynncloud-postgresifdatabaseis enabled). Apps have zero lateral visibility into other installed apps or Redis. - Read-only root filesystem: Enabled by default (
read_only_rootfs: true), with writabletmpfsmounts on/tmpand/runand a persistent volume atstorage.mount_path(default/data) if requested. - Dropped capabilities & non-root execution:
cap_drop: [ALL],no-new-privileges:true, and non-zero UID enforced. - Healthcheck readiness: The gateway probes
deploy.healthcheck.path(default/health) with a1500mstimeout, caches results for15 seconds, and treats any HTTP status< 500as healthy.
Injected Environment Variables
Section titled “Injected Environment Variables”FynnCloud automatically injects these variables into every running app container:
| Variable | Description |
|---|---|
FYNNCLOUD_APP_ID |
Your app’s manifest id |
FYNNCLOUD_APP_SECRET |
Cryptographically random per-install secret (authenticates backend API calls, webhook HMAC signatures, and Gateway HMAC identity proofs) |
FYNNCLOUD_INTERNAL_API_URL |
Internal HTTP base URL to fynncloud-server (e.g. http://fynncloud-server:8080) |
FYNNCLOUD_PUBLIC_URL |
Public browser origin of the FynnCloud instance (APP_FRONTEND_URL) |
PORT |
Internal HTTP listen port matching deploy.port (default 8080) |
DATABASE_URL |
Provisioned isolated PostgreSQL schema/role connection string (when database is enabled) |
STORAGE_PATH / DATA_DIR |
Persistent volume mount path (when storage is enabled, default /data) |
Gateway Proxy Behavior & Header Hardening
Section titled “Gateway Proxy Behavior & Header Hardening”The App Gateway (/api/apps/:appId/proxy/**) supports 14 HTTP methods (GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, plus WebDAV methods PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK), WebSocket upgrades, streaming uploads/downloads, and long-lived SSE streams with a 30-minute timeout and a 128-connection soft pool per host (redirectConfiguration = .disallow).
Path Sanitization & Response Filtering
Section titled “Path Sanitization & Response Filtering”- Traversal rejection: Segments decoding (even double-encoded
%252e%252e) to.,..,/,\, or NUL are immediately rejected with400 Bad Requestso gateway policy and your app router always see identical paths. - Forbidden response headers: The gateway strips
Set-Cookie,Set-Cookie2, and allAccess-Control-*headers returned by your app (apps can never write cookies onto the FynnCloud origin or override CORS). - Mandatory sandbox CSP: Every proxied response carries (or merges with)
Content-Security-Policy: sandbox allow-scripts allow-forms allow-popups allow-downloads allow-modals. Noticeallow-same-originis intentionally omitted so the app always executes in an opaque (null) origin—even if a user navigates directly to/api/apps/:appId/proxy/outside an iframe—andframe-ancestorsis intentionally omitted so apps like draw.io can embed sub-iframes from their own proxy subpath. - Iframe
allowattribute: The host grantsmicrophone,camera, anddisplay-captureonly when the app declaresmedia:capture(and routes capture through the host media relay).
Verifying Gateway HMAC-SHA256 Identity Signatures
Section titled “Verifying Gateway HMAC-SHA256 Identity Signatures”On every authenticated request forwarded through /api/apps/:appId/proxy/**, FynnCloud Core injects trusted identity headers and signs them with your FYNNCLOUD_APP_SECRET:
| Header | Description |
|---|---|
X-FynnCloud-User-ID |
Authenticated FynnCloud user UUID (empty on anonymous public_paths / static shell requests) |
X-FynnCloud-Caller-App |
Caller’s appId when invoked through the cross-app proxy (empty on direct user requests) |
X-FynnCloud-Gateway-Timestamp |
Unix timestamp (seconds) when the gateway signed the request |
X-FynnCloud-Gateway-Signature |
sha256=<lowercase hex> HMAC-SHA256 over the 5-line canonical payload |
Canonical Signature Payload
Section titled “Canonical Signature Payload”<timestamp>\n<METHOD>\n/<subpath>\n<userID>\n<callerAppID><METHOD>is uppercase (e.g.GET,POST)./<subpath>is the normalized path forwarded to your app starting with/(without query string).<userID>and<callerAppID>are empty strings""if absent.
Node.js / TypeScript Verification Middleware
Section titled “Node.js / TypeScript Verification Middleware”Always verify X-FynnCloud-Gateway-Signature (with a ±300s timestamp window and constant-time comparison) before trusting X-FynnCloud-User-ID or X-FynnCloud-Caller-App:
import crypto from 'node:crypto';import type { IncomingMessage } from 'node:http';
export function verifyFynnCloudGateway(req: IncomingMessage, appSecret: string): boolean { const ts = String(req.headers['x-fynncloud-gateway-timestamp'] ?? ''); const sig = String(req.headers['x-fynncloud-gateway-signature'] ?? ''); if (!ts || !sig.startsWith('sha256=')) return false;
const age = Math.abs(Math.floor(Date.now() / 1000) - Number(ts)); if (!Number.isFinite(age) || age > 300) return false;
const url = new URL(req.url || '/', 'http://localhost'); const userId = String(req.headers['x-fynncloud-user-id'] ?? ''); const callerApp = String(req.headers['x-fynncloud-caller-app'] ?? '');
const canonical = [ ts, (req.method || 'GET').toUpperCase(), url.pathname, userId, callerApp, ].join('\n');
const expected = 'sha256=' + crypto.createHmac('sha256', appSecret).update(canonical, 'utf8').digest('hex');
const a = Buffer.from(sig, 'utf8'); const b = Buffer.from(expected, 'utf8'); return a.length === b.length && crypto.timingSafeEqual(a, b);}Cross-App Communication Proxy
Section titled “Cross-App Communication Proxy”Apps can call other installed FynnCloud apps safely without sharing secrets or opening lateral network routes by declaring target apps in compatibility.apps:
1. From an App Frontend (@fynncloud/app-bridge)
Section titled “1. From an App Frontend (@fynncloud/app-bridge)”const cal = fynncloud.getIntegration('calendar');if (cal?.available) { const res = await fynncloud.fetchApp('calendar', '/api/events?range=week'); const events = await res.json();}2. From an App Backend (Server-to-Server)
Section titled “2. From an App Backend (Server-to-Server)”Send the request through FYNNCLOUD_INTERNAL_API_URL/api/apps/<targetAppId>/proxy/<path> with:
X-FynnCloud-App-ID: <your-app-id>X-FynnCloud-App-Secret: <your-FYNNCLOUD_APP_SECRET>X-FynnCloud-User-ID: <acting-user-uuid>
What the Gateway Enforces & Injects
Section titled “What the Gateway Enforces & Injects”- Verifies the calling app declared
targetAppIdincompatibility.apps, that the installed target version satisfies the SemVer range, and thataccess: "read"blocks non-GET/HEADmethods. - Mints a fresh 60-second target-scoped
AppAccessTokenfor the target app and attaches it asAuthorization: Bearer <targetToken>. - Sets
X-FynnCloud-Caller-App: <callerAppId>and signs the request with the target app’sFYNNCLOUD_APP_SECRETviaX-FynnCloud-Gateway-Signature. - Returns
403/404/503cleanly if the integration is unauthorized, uninstalled, or unhealthy.