Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Threat model

This chapter says what FerroEHR defends against, how, and (more usefully) what remains true after the control has done its job. It exists because the parts of this system that actually protect patient data are the parts no external specification governs: openEHR’s REST specification makes authentication a SHOULD and mandates no scheme, and no openEHR specification governs authorization, so only the 401-versus-403 split is specification-grounded. Everything finer is this project’s own design, and a design nobody has written down asks every deployer to reconstruct it privately.

What this is, and what it is not

This is an attack-surface and trust-boundary analysis with named residual risk. Boundaries are enumerated, the control at each is stated, and the risk that survives the control is stated beside it.

It is not a certification, an audit report, or an assurance case in the formal sense, and it does not make FerroEHR compliant with anything. It is also not a substitute for your own analysis: your deployment introduces boundaries this document cannot see: your identity provider’s token policy, your network, your operators, your backups. The value here is that you do not have to reverse-engineer our half of it from configuration prose.

Read it alongside Security (how each control is configured), Audit trail (what is recorded), Verifying releases (establishing what you are running), Operations (the deployment surface) and Cluster hardening (what the platform owes).

Where this document and the code disagree, the code is right and this document is a defect. Report it.

Assets

What an attacker wants, in the order the loss hurts:

AssetWhere it livesWhy it matters
Clinical payload: compositions, EHR status, foldersthe clinical schema’s node and version tables, archival partitions includedthis is PHI; disclosure is the primary harm and it is not undoable
Demographic parties and their identifiersthe party schema, archival partitions included; a national identifier belongs in the master patient index and is not among themwho the people are, held apart from what is recorded about them
The EHR id / subject cross-referencethe EHR’s own EHR_STATUS.subject.external_ref, promoted to the clinical.ehr subject columnsthe additional information that re-attributes a pseudonymised record to a person once joined to the party or the identity source
The audit trailthe audit schema, plus any configured forwarding sinkit is the evidence that everything else happened; an attacker who can edit it can make an access disappear
Version history and its integrityversion, vo_head, contribution, attestationsan openEHR record’s value is that it is append-only and attributable; a silently rewritten prior version is worse than a deleted one
Signing keysthe configured signing key material for commit attestationforging an attestation forges provenance of clinical content
Bearer credentials and password hashestokens in flight; Argon2id PHC hashes at resta stolen token is an authenticated clinical caller until it expires
Instance separationone instance, one database, one set of domain roles per organisationtwo organisations sharing one instance is a breach of both at once
Availabilitythe whole stacka CDR that is down is a clinical system that is down; denial of service is a patient-safety issue here, not an inconvenience

Actors

ActorReachesAssumed capability
Unauthenticated callerthe listening portcan send arbitrary bytes, replay anything observed, and probe every route
Authenticated clinical callerthe openEHR API within their grantsholds a valid token; may be a legitimate user acting outside their remit, or a compromised client
Admin / management callerthe admin, management and messaging surfacescan delete physically, archive, dump and load; the most dangerous authorized actor
Databaseeverything storedtrusted for confidentiality, but assumed to be a place where a mistake is permanent
Terminology server (FHIR R4B)called out to at validation and commit timeoperator-configured; semi-trusted: it answers our questions and can lie
Object store (S3)called out to for multimediaoperator-configured; semi-trusted, and its responses are parsed
Outbox readerpulls change events over the feedoperator-configured, holding the __ferroehr.outbox scope; a sink for data, so a confidentiality boundary
Identity providerissues the tokens everything else believesfully trusted by construction; if it is compromised, no control below it holds
Cluster / host operatorthe process, its memory, its filesystem, its secretsfully trusted; outside the software’s reach

Trust boundaries

flowchart LR
  subgraph Untrusted
    U[Unauthenticated caller]
    C[Clinical client]
    A[Admin client]
  end
  subgraph Deployment["Deployment boundary (operator-controlled)"]
    subgraph Server["FerroEHR process"]
      B1["B1 network + protocol"]
      B2["B2 authentication"]
      B3["B3 authorization<br/>EHR_ACCESS - RBAC - SMART"]
      B4["B4 content validation"]
      B5["B5 instance separation"]
    end
    DB[("B6 PostgreSQL")]
    AUD[("B7 audit store")]
  end
  subgraph External["Semi-trusted peers"]
    IDP[Identity provider]
    TS[Terminology server]
    S3[Object store]
    MQ[Outbox reader]
  end
  U --> B1
  C --> B1
  A --> B1
  B1 --> B2
  B2 --> B3
  B3 --> B4
  B4 --> B5
  B5 --> DB
  B5 --> AUD
  B2 -.verifies tokens from.-> IDP
  B4 -.asks.-> TS
  B4 -.stores blobs.-> S3
  MQ -.pulls the feed.-> B1

Each boundary below names the control that holds and the risk that remains.

B1 — Network and protocol

Control. TLS terminates either at the server (rustls, TLS 1.3 by default) or in front of it. Connection-level bounds apply before a request even exists (an HTTP/1 header-read timeout, an HTTP/2 stream cap with keep-alive PINGs); request bodies are size-limited, requests are timed out, concurrency is capped by an admission limit, and a two-tier tower_governor rate limit is on by default. Panics are caught and become a clean 500 rather than a dropped connection, and release builds run with overflow checks on so an arithmetic mistake is a loud panic rather than a silently wrong number. Response security headers are set. Every parser that reads attacker-controlled bytes (canonical JSON, canonical XML, AQL, ADL, OPT 1.4 templates, the simplified formats, and the identifier types) has a libFuzzer harness, built on the pull-request path and fuzzed on a nightly campaign, and a crash is fixed in the crate, never in the harness.

Residual risk.

  • Fuzzing finds crashes; it does not prove their absence. The harnesses cover the parsers we identified as reachable. A parser reached by a path we did not enumerate is not covered by anything.
  • Rate limiting is per-process. A multi-replica deployment behind a load balancer divides the effective limit by the replica count; it is not a distributed limiter. The shipped defaults are also deliberately generous: they sit above this implementation’s own measured whole-server ceiling, so the limiter refuses abuse rather than shaping normal load.
  • Algorithmic complexity in query execution is not bounded by the limiter. A syntactically small AQL query can be an expensive one. Statement timeouts at the database are the backstop, and they are the operator’s to set.
  • TLS termination in front of the server is the operator’s; nothing in the software can tell whether the hop behind the proxy is encrypted.

B2 — Authentication

Control. Two mechanisms: HTTP Basic against Argon2id PHC hashes with a verified-credential cache, and OAuth 2.0 bearer tokens validated against the issuer’s key set by ferrohealth-smart. Configuration is validated at boot, not on the first request: a mandatory audience list, an https issuer whose metadata and key set are read at start, asymmetric algorithms only (with none and every HS* algorithm refused), and the OWASP Argon2id parameter floor. A malformed Authorization header is a 400, not a 401: the server never read a credential. An unreachable issuer is a 503, never a silent pass. A 401 body names no reason, so it is not an oracle for expired-versus-forged.

Residual risk.

  • A valid token is a valid caller. FerroEHR verifies signature, audience, issuer and expiry; it does not and cannot know whether the human behind the token is who the token says. Token theft is defended against by your identity provider’s lifetimes and binding, not by us.
  • There is no token binding, no proof-of-possession and no replay window. A bearer token replayed from another network location is accepted.
  • The identity provider is unconditionally trusted. A compromised issuer, or an attacker who can mint tokens with the right audience, defeats every authorization stage below, all of which read their inputs from claims.
  • Basic authentication has no session, no lockout and no second factor. It is intended for machine callers and small deployments; the Argon2id cost is the only brake on offline cracking if a hash leaks.

B3 — Authorization

Control. Five stages, each of which can only narrow what the previous one allowed, which is what makes an optional stage safe to leave off:

  1. Authentication produces a principal or a typed refusal.
  2. EHR_ACCESS is always on and unconditional, from the openEHR Reference Model’s own gateway clause: the access evaluator decides every request that reaches an EHR over the subject’s access directives, the caller’s facts in the CDR and the controller’s access policy.
  3. RBAC checks the coarse operation class (public, clinical, or admin) against roles taken from the RFC 9068 claim carriers. An OAuth2 scope is deliberately not treated as a role. The read-only restriction overrides any grant. (The /management/* surface is not in this classification: it is governed endpoint-by-endpoint by its own configuration, and an endpoint you do not name is not mounted at all.)
  4. SMART scopes (off by default) are AND-composed onto the decisions before them.

Deny-by-default throughout, and fail-closed in both senses: no stage permits by omission, and a stage that cannot decide is never read as a decision: an unreachable issuer is 503, and a fact the evaluator cannot read refuses rather than opens data. Silence is never consent, and a broken control never looks like a policy outcome.

Residual risk.

  • Open by default. With no access directives and an access policy that requires no care relationship, any authenticated clinical caller can reach any EHR the default disposition admits. If your model is “a clinician may read only their own patients”, write it in the access policy (care_relationship_required) and record the care relationships.
  • Policy is only as good as the facts. Every decision is made from the caller’s identity the identity provider asserted and the facts the CDR holds about that caller. A wrong binding produces a correct decision on a false premise.
  • Authorization is enforced at the API. Anything with a direct database connection is past it entirely; see B6.
  • A legitimate caller acting outside their remit is not prevented, only recorded. That is what the audit trail is for, and detection is not prevention.

B4 — Content validation and outbound calls

Control. Committed content is validated against the operational template (the WebTemplate walker), the Reference Model’s own invariants (machine-derived from the specification’s meta-model rather than hand-written) and terminology bindings. Canonical JSON is read by a strict reader that refuses undeclared and duplicate keys. Outbound terminology and object-store calls go only to operator-configured endpoints: terminology goes to the one configured FHIR terminology server ([terminology], FerroTERM in every shipped deployment), authenticated with an OAuth 2.0 client-credentials token when it sits behind an authorization server, and verified against the platform trust store. The one outbound call that is on by default is the usage report to report.ferropulse.eu, which [usage_report] enabled = false switches off; it sends a fixed set of fields and reads nothing from the answer beyond its status code.

Residual risk.

  • The terminology server is trusted to answer honestly. A compromised or misconfigured one can permit a code that should have been refused. It is a correctness boundary, and a clinical-safety one.
  • A response parsed from a semi-trusted peer is still parsed. A terminology answer and an object-store response are both parsed by the server, so a compromised endpoint reaches a parser rather than only a validator. The object-store path once carried an XML parser version with denial-of-service advisories the client-facing canonical-XML codec did not share; both are now on the patched version, and the only pre-fix copy left in the build reaches it through the flamegraph renderer, which writes SVG and parses nothing. That argument is published as a machine-readable VEX document rather than left in a comment. Read the current documents for the current position: they name the versions, and they are regenerated from the gate.
  • Multimedia blobs are stored, not inspected. FerroEHR is not an antivirus and does not pretend to be; a malicious blob is delivered faithfully to whatever opens it.
  • Validation does not make content true. A well-formed composition asserting a clinically wrong fact is stored, correctly.

B5 — Instance separation

Control. One instance serves one organisation: one database, one set of domain roles. There is no tenant column, no row policy and no session setting to get wrong, because there is nothing inside the instance to separate. That is also where openEHR puts the boundary — BASE architecture_overview master06-design_of_the_ehr.adoc §The EHR System calls a system “a distinct logical repository corresponding to an organisational entity that is legally responsible” for the data and “distinct from any underlying virtualisation infrastructure or cloud computing facility, which may house multiple logical EHR systems in a multi-tenant fashion”.

Residual risk.

  • Separation is now a deployment property, so a deployment mistake is the whole risk. Two organisations pointed at one instance share everything; nothing in the software will catch it, because there is no longer a tenant for it to compare against. The compensating control is that the mistake is visible in the deployment, not buried in a session variable.
  • Instance separation does not separate resources by itself. Two instances on one node still compete for CPU, connections and disk unless the platform bounds them.
  • system_id must differ per instance. It “becomes embedded in the version identifiers of committed – and possibly signed – content” and “cannot easily be changed afterwards” (§System Identity), so two instances sharing one value mint version identifiers that cannot tell the responsible parties apart.

B6 — The database

Control. The application connects with least-privilege roles, one per pseudonymisation domain, and the schema is prepared by a separate credential that is not any of them (what each credential reaches). FORCE ROW LEVEL SECURITY means even a table owner is subject to the policies. Version history is temporal (PRIMARY KEY … WITHOUT OVERLAPS) rather than overwritten, so a prior version is a row that exists, not one that was replaced. Every write emits a contribution and an audit record in the same transaction.

Residual risk.

  • Anyone with a database connection is past every control in B1–B5. That is the single largest residual risk in this system, and it is inherent: FerroEHR enforces authorization at the API. Protect the credentials and the network path accordingly.
  • Encryption at rest is the operator’s, and it is required. FerroEHR encrypts no field before it reaches PostgreSQL; the payload is queryable JSONB, which is what makes AQL possible and is incompatible with application-level encryption of the same fields. The database volumes and every backup are encrypted at rest under keys held off the database hosts (go-live checklist).
  • A superuser can rewrite history. The temporal design makes accidental overwrite structurally hard; it does not defend against someone with UPDATE on the tables. The audit chain (B7) is the detection layer.
  • Backups carry PHI with none of these controls. A restored dump is a complete copy of the schemas it covers. Which schemas that is, and what two dumps are worth together, is Backup artefacts below.

B7 — The audit trail

Control. Every access is recorded in both official renderings (DICOM PS3.15 and FHIR R4 AuditEvent/BALP) into a local Audit Record Repository, on by default, with optional syslog and ATX:FHIR-Feed forwarding. Refusals (401, 403, and the 400 a malformed credential header earns) are always recorded, and an unattributable denial is recorded as unattributed rather than under a fabricated subject. Records are hash-chained, so SELECT * FROM audit.verify_audit_chain() names any record that was altered or removed, and the server runs that verification itself on a schedule (tamper evidence). ITI-81 is the retrieval side; ITI-19 mutual TLS is available for node authentication.

Residual risk.

  • Tamper evidence, not tamper proof. The chain proves alteration happened; it does not prevent it. An attacker with write access to the audit schema can rewrite the chain from the point of compromise forward, which is precisely why forwarding to an off-box sink matters, and why the sink should not be writable by the same identity.
  • A local repository shares the blast radius of the thing it audits. If the database is lost, so is the local audit trail.
  • The trail records what the server saw. A read performed directly against the database appears nowhere in it.
  • Audit records are themselves sensitive. They name patients, subjects and actions; ITI-81 retrieval is a PHI-disclosure surface and is authorized like any other.

B8 — The supply chain

Control. Releases are built by a reusable workflow that satisfies SLSA v1.0 Build L3, signed through Sigstore with a signer identity a consumer can pin, carrying a CycloneDX dependency SBOM, a SPDX repository SBOM, in-toto provenance and a plain sha256sum; the verification procedure is Verifying releases. The release is created as a draft and only published once its full asset set is present, because a published release is immutable. Container base images are digest-pinned, and the published images are re-scanned weekly at the tag an operator actually pulls, with a fixable high-or-critical finding both failing the run and filing an issue. Every action is pinned to a commit SHA, workflows are audited by zizmor on every pull request, and accepted advisories carry published VEX justifications. Commits and tags are signed and the tags are protected by a ruleset.

Residual risk.

  • Provenance proves where an artifact was built, not that the source was good. Build L3 says these bytes came from this workflow at this commit. It says nothing about what that commit contained.
  • The build is not hermetic and not reproducible. Those are separate SLSA tracks this project does not address. A dependency resolved at build time is trusted to be what the lock file names.
  • Review capacity is one person. No second human is structurally required between an idea and a released binary; the mitigation is machine enforcement and it is honestly recorded in GOVERNANCE.md.
  • Fixes ship in the newest release only. Only the newest release is supported, and a fix arrives as a newer release; there is no maintenance branch to backport to. Cadasto B.V. commits to keep publishing security fixes for at least five years after each release (CRA Art 13(8) and (10)). See SECURITY.md.

What each database credential can reach

Every control from B1 to B5 is enforced at the API, so a database credential is past all of them. What one credential holds is therefore the boundary that survives a leaked connection string, and it is a property of the grants rather than of the server’s routing. The migrations under app/ferroehr/migrations/ apply those grants, revoke each domain from the roles that do not own it, and make every domain role NOINHERIT and a member of no other, so a privilege cannot arrive through a membership.

CredentialReachesCannot reach
ferroehr_clinicalclinical, archival partitions included, with SELECT, INSERT, UPDATE and DELETE; MAINTAIN on the partitioned node, version and vo_attestation and on ehr, to keep their planner statistics; the ext.posture stamp, and SELECT on ext.posture for the subject pseudonym guard; USAGE on ext; in audit, record an event, stamp it forwarded, run the retention reaper and verify the chainparty, revoked explicitly and in both directions
ferroehr_clinical_readerSELECT on clinical; USAGE on ext; read the audit repository and verify the chainparty
ferroehr_partyparty, archival partitions included, with SELECT, INSERT, UPDATE and DELETE; MAINTAIN on the partitioned node, version and vo_attestation, to keep their planner statisticsclinical, revoked explicitly and in both directions
ferroehr_party_readerSELECT on partyclinical
The schema-preparation credential ([database] migrate_url, normally a member of ferroehr_migrator)every schema: it issues the DDL of all four migration sets and reads all four _sqlx_migrations tables, and it owns the objects it creatednothing. The server opens it for that one boot step and closes it again, so no pool is held on it and no request is served through it

A schema’s _sqlx_migrations bookkeeping, the record of which migrations ran that the boot check compares, is read-only to every runtime role, the writer roles included; the server refuses to start while a runtime role can write any bookkeeping table, in every database a domain pool reaches.

The audit schema is granted to the clinical pair (ferroehr_clinical records an event, stamps it forwarded, runs the retention reaper and verifies the chain; ferroehr_clinical_reader reads it). The local Audit Record Repository is written on the clinical pool, so a login role that is a member of ferroehr_clinical alone writes its own access log. The audit trail is not a pseudonymisation domain: the demographic roles hold no privilege there, and the trail carries record identifiers, never a subject’s data.

The four domain roles are checked at every boot. The server reads the catalogue for every table, partitioned table, view, materialized view, foreign table, sequence and function each of them can reach in a domain it does not own, and refuses to serve when it finds one, naming the role, the object kind and the object. A role that does not exist is skipped rather than failed, because role provisioning is a deployment step and the migrations create the roles only where the migrator holds CREATEROLE. ferroehr db verify runs the same check from outside the deployment.

Residual risk.

  • The grants are only a boundary once the credentials are separated. With every [database.<domain>] url unset, all three pools authenticate as [database] url and the split is a schema split. The shared_credential gap of deployment.profile is what names that.
  • A login role can be a member of several domain roles. The compose stacks do exactly that, deliberately, and say so. The boot self-check measures the group roles, so it reports a boundary that a membership then crosses.
  • A superuser holds everything, and so does the role that owns the objects. Neither is a runtime credential, and neither is constrained by any of the above.

Backup artefacts

A dump leaves the database with none of the grants attached, so the chart takes one per domain rather than one per cluster: clinical with ext and audit, and party on its own. Each job authenticates as its own read-only role, because every domain role is revoked from the other domains and a dump taken through a runtime credential would be silently partial. Each writes to its own claim, and the chart refuses to render when two domains name the same one.

Residual risk.

  • Each dump is plaintext of its own domain. The clinical one holds every composition, and the demographic one every party. Encryption of the dump volume or object store at rest, under a key held apart from the dumps, is the control.
  • Two dumps together are worth more than twice one. The demographic dump beside the clinical one says which person each record belongs to: the record is re-identified. Who may read each claim is the control, and it is yours.
  • A cluster-wide artefact spans every domain. A physical base backup and an instance-wide point-in-time recovery are bridges no grant closes. That is the shared_cluster gap, and running the domains on one cluster accepts it by name.
  • Nothing prunes old dumps, and no network policy of ours selects the dump pods.

Re-identification

Pseudonymisation is worth what the paths back are worth. These are the ones this system has.

An identifier written into clinical content

Control. A data-minimisation pass reads the Reference Model structure of every clinical commit body before it is stored. EHR_STATUS.subject.external_ref must name a declared pseudonym namespace and carry a UUID once [privacy] subject_namespaces is set. A PARTY_RELATED whose relationship is self carrying a name or identifiers is refused unless the deployment opts in. The two write paths that replay content verbatim, EHR-Extract import and the admin archive load, run the same pass: they store what they receive, so a body identifying its subject can only be refused. The database keeps its own line. Once the namespaces are declared the server stamps ehr.posture, and a trigger on ehr refuses a subject_id that is not a UUID, whichever session writes it.

Residual risk.

  • The pass reads structure, never a value’s shape. A national identifier, a name, a street address or a date of birth written into free text or an unconstrained DV_IDENTIFIER is stored as written. Keeping such values out of clinical content is the controller’s design of its templates and feeds. A national identifier belongs in the master patient index, never in either domain of the CDR.
  • subject_namespaces is empty by default, and with it empty the subject rule and the database trigger are both out of force. The open_subject_namespace gap of deployment.profile is what names that.
  • A finding names the RM path and the rule, never the value. That is deliberate, and it means a refusal tells an operator where to look rather than what was there.

Content that identifies without carrying an identifier

Control. None in the query engine. Clinical content is keyed by an opaque subject pseudonym, and AQL returns the rows it was asked for.

Residual risk. A rare diagnosis with an admission date and a place of treatment identifies a person with no identifier field involved. Small-cell suppression applies to the cohort query only: a cohort result serving fewer distinct EHRs than privacy.cohort.small_cell_threshold has its rows withheld and is marked suppressed. An ordinary AQL execution takes no threshold at all, so nothing counts how small a population a plain POST /query/aql returned. For that surface, who may run AQL, for what purpose, and over which EHRs are the controls, and they are configuration rather than arithmetic.

The reference that rejoins the two domains

Control. An EHR names its subject in its own EHR_STATUS.subject.external_ref: a party id, or the opaque pseudonym an IHE patient identity source answers for the clinical domain once [privacy] subject_namespaces is declared. No name, no address and no plaintext attribute. A cohort and the AQL demographic join resolve a party or a named subject to its EHR through that reference, and each crossing writes a linkage-domain access event naming the actor, the declared purpose of use and how many EHRs it reached; the event deliberately does not name the subject identifier. FerroEHR matches, links and merges no patients.

Residual risk.

  • The identity source holds the re-identifying link. Its controls, who may resolve a pseudonym back to a person, are the source’s, and FerroEHR never asks for that resolution.
  • A party id as subject re-identifies within the instance. Without declared pseudonym namespaces, an EHR_STATUS may name a party of this server directly; the demographic and clinical credentials still never meet in one statement.
  • A miss is as informative as a hit. Asking whether this deployment holds a record for a person is itself a disclosure, which is why the miss is recorded too.

National identifiers stay in the master patient index

Control. The CDR holds no national identifier. A person is resolved to their pseudonym by the master patient index (FerroPIX, over IHE PIX/PDQ and PIXm), and the clinical domain holds the pseudonym only, which the subject rule enforces. A party is stored, signed and served as committed, so the stored version is the signed one on every path that moves it: the commit, the EHR-Extract import, the admin dump and load, and the erasure.

Residual risk.

  • A client can still write a national identifier into a party. The server stores a party as committed and ships no registry of national identifier schemes, so keeping identifiers out of the parties it writes is the controller’s design of its templates and feeds.
  • What a party carries is as safe as the volume under it. Encryption at rest of the database volumes and backups is the control, and it is a deployment requirement.

The subject pseudonym

Control. FerroEHR mints no subject pseudonym. Once [privacy] subject_namespaces declares a namespace, an EHR_STATUS.subject.external_ref must name a declared namespace and carry a UUID, and a trigger on ehr refuses a non-UUID subject reference whichever session writes it. Under the IHE provider the patient identity source mints the pseudonym the clinical domain holds.

Residual risk. A stable per-subject identifier across the whole clinical store is what makes it an EHR, and it is also a linkage key. Anyone holding the clinical domain can gather every record of one subject, without knowing who the subject is. With subject_namespaces empty, the default, neither rule is in force and a client may write any identifier as the subject reference.

The audit trail as a re-identification surface

Control. Access records live in audit, outside both domains, and retrieval is the admin-gated ITI-81 route. A linkage event names the party and the purpose, not the EHR that was returned, so the trail is not a map from parties to their EHRs.

Residual risk. The records name subjects, actors, organisations, roles and what they read, which is sensitive in its own right and is a disclosure surface like any other. Retention makes it durable on purpose: an access policy whose log_retention period is shorter than a floor the controller declares, or than the three years of EHDS Art. 9(2) in the Union, is refused when it is written rather than trimmed silently.

What is explicitly NOT defended against

Silence is never coverage, so these are stated rather than left to inference.

  • A compromised identity provider. Everything downstream reads claims it asserted.
  • A compromised host, container runtime, or cluster operator. Process memory holds decrypted PHI and key material by necessity.
  • Anyone with direct database credentials.
  • A malicious maintainer, or a compromise of the maintainer’s account or signing key. The bus factor is one; see MAINTAINERS.md.
  • Physical access, side channels, and speculative-execution attacks.
  • Traffic analysis. Request sizes, timings and error-code patterns can leak the existence of records; nothing pads or delays.
  • A legitimate user’s authorized misuse, beyond recording it.
  • Denial of service by a resource-holding authorized caller: an expensive query, a large commit, a slow client. The rate limiter is on but coarse and per-process; database statement timeouts and container limits are the operator’s.
  • Data remanence. Physical deletion removes rows; it does not scrub filesystem blocks, WAL segments, replicas or backups.
  • Clinical correctness. FerroEHR validates structure, invariants and terminology bindings. It does not know whether a recorded fact is true, and no control here is a substitute for clinical governance.

Reporting a finding

If you believe a control is weaker than stated here, or a residual risk is missing, that is a valid security report, including when the defect is in this document rather than in the code. Follow SECURITY.md: report privately, never as a public issue.