Security model

fail-closed by construction: transport encryption → authentication → authorization → rate limiting → audit. Nothing in the default configuration is left open.

Threat model, in one paragraph

(a) Anonymous probers get /healthz and 401s — with a tight per-IP sliding window so port scans can't fan out. (b) Limited key holders get exactly their role; viewers read, operators produce/consume, federation peers call only federation RPCs. (c) A compromised cluster node can't reach mesh RPCs without a cluster-CA cert, and its keys aren't admin. (d) OS-root insiders are out of scope (the audit log is append-only for external callers, not tamper-evident to root). Encryption at rest: opt-in AES-256-GCM per segment frame via -encryption-key-file (ADR-021; key loss = data loss). Not defended: FIPS-validated modules, KMS/HSM envelope encryption, automated rotation — files are 0600 under a 0700 dir.

Layer 1 — transport encryption

Layer 2 — authentication & authorization

API keys are bearer tokens, SHA-256-hashed at rest in __api_keys, shown once at mint, revocable. Roles compose additively: viewer operator admin federation (federation keys open only FederationService — nothing else, not even admin reads).

SurfaceBefore any handler runsRefused caller sees
HTTPHardening middleware (CSP, frame-ancestors 'none', no-store) → bearer verify → role check → rate limit → CIDR allowlist401 / 403
gRPClogging → bearer verify → per-RPC role table → rate limit → CIDRUNAUTHENTICATED / PERMISSION_DENIED / RESOURCE_EXHAUSTED
MeshTLS itself — client cert signed by the cluster CAhandshake failure
/healthznothingalways 200

Layer 3 — rate limits, allowlists, audit, filesystem

Bootstrap & secret handling

sequenceDiagram
    participant Op as Operator
    participant F as firnd (first boot)
    Op->>F: fresh install, zero keys
    F-->>Op: stderr prints BOOTSTRAP TOKEN once
    Op->>F: POST /apikeys with Bearer token, body name root role admin
    F-->>Op: 201 plus plaintext key (shown once, never stored)
    Note over Op,F: token is void from the next request onward

Artifact trust (supply chain)

# integrity + provenance for any release tarball
gh release download v0.6.0 --repo rahulkj/firn --pattern 'firn-v0.6.0-linux-amd64.tar.gz' --pattern 'SHA256SUMS'
shasum -a 256 -c SHA256SUMS
gh attestation verify firn-v0.6.0-linux-amd64.tar.gz --repo rahulkj/firn

# every release additionally ships: sbom.spdx.json (anchore) + provenance.sigstore.jsonl (offline bundle)
# CI gates: golangci-lint, go test, distribution job with grype fail-on-critical

Honest limits