Repository navigation
Description
Problem
A server accepts commits from other servers (push, pull, clone, archive restore) without knowing which server wrote them. A user's identity is checked by the server that receives their transaction, and the resulting commit records it (f:identity, and the transaction signature when the request was signed). Nothing records or checks the identity of the server that then wrote the commit, so a receiving server cannot tell a commit from a server it trusts apart from one anyone could have constructed.
Permanent erasure (#2280) makes this concrete: a receiver accepts an erasure because its control commit authorizes it, and today it has no way to know which server issued that control commit.
What exists today
- No server identity. The server has no signing-key setting and signs nothing it writes. Commit signing is a Rust-API opt-in (
CommitOpts::with_signing_key, seedocs/security/commit-signing.md). - No verification on receipt. Push, pull, clone and restore check each commit's bytes against its ID and re-check the pushing user's policy, but never verify a commit signature.
fluree_db_credential::verify_commit_digestis called only by its own tests. - A reserved config slot.
f:trustPolicyis documented as a commit-signer allowlist, but it is unimplemented: setting it fails withUnsupportedFeature(docs/security/cross-ledger-policy.md). - Commit signatures sit after the commit hash, outside the content ID, so a signature can be stripped or added without changing the commit's ID. A signature therefore means something only where a receiver requires one from a signer it trusts.
Proposal
1. A server identity (per server). A server setting naming the server's Ed25519 key, supplied like other server settings: flag, FLUREE_* environment variable, or [server] in .fluree/config.toml. A key file path by default, optionally the key itself in an environment variable as FLUREE_ENCRYPTION_KEY does. The server signs every commit it writes, logs its did:key at startup, and reports it in its discovery document. Members of a Raft cluster share one key, so other servers trust a single DID for the cluster.
2. Which signers a ledger trusts (per ledger, in the config graph). A config-graph setting, building on the reserved f:trustPolicy slot, listing the signer DIDs whose commits the ledger accepts. Keeping it in the ledger means it travels with the ledger, every server holding it enforces the same list, changes go through config-write checks, and its history is kept.
A receiving server enforces it on every commit it takes in: a commit not signed by a listed signer, or carrying an invalid signature, is refused. That includes erasure control commits, which closes the gap above.
3. A chain of trust for the list itself. A receiver learns the list from the same commits it verifies, so a forged config commit could add a key. A change to the signer list counts only if a key already trusted signed it. A server starts from an anchor: the list as of when it first cloned the ledger from a remote it chose, or a local server setting that overrides it.
Open questions
- Whether verification is opt-in per ledger (only once the config names signers) or required once any signer is listed. Opt-in keeps existing ledgers unchanged.
- How the first anchor is chosen and recorded on clone, and how an operator resets it.
- Key rotation: how a ledger moves from one server key to the next without a gap.
- Whether commits written before signing was enabled stay acceptable (they would have no signature).
- Interaction with erasure replacements, which keep the original's ID and envelope: the proof already binds the replacement to the original, so the original's signature should carry over rather than be required on the replacement.
Context
Raised in the review of #2280 ("sign control commits with the server's commit key when it has one, receivers checking the sender's DID, and a requester-signed request later"). It was deferred from that PR because a server key without a trust policy adds only an audit trail, and the trust policy is a general feature for all commits, not an erasure special case.
Activity