Repository navigation
Description
internal/distributed gossip has no message authentication. Grep across the package for hmac, HMAC, sharedSecret, SharedSecret, authKey returns zero non-test hits.
So any host that can reach the gossip port can join the cluster, announce cache ownership for arbitrary keys, and — once #141/#142 land cache-warming reads that fetch from peers — serve arbitrary bytes as the contents of a cached object. That is the part that makes this a data-integrity issue rather than an availability one: a peer's response becomes file content the kernel hands to a reading process.
Today the exposure is bounded because the cache-coordination path is not wired (cache.NewFromConfig has no caller, #178) and executeLocally calls the backend directly. It stops being bounded the moment the v0.12.0 cache-warming issues land. This should be resolved before #142, not after — a peer-fetch path with unauthenticated peer discovery is a remote content-injection primitive, and retrofitting auth under a working feature is how it gets deferred indefinitely.
Design notes, to avoid the obvious wrong turns:
- A shared cluster secret with HMAC on every gossip message is the proportionate answer for the deployment model here (a trusted HPC network, single tenant). Not TLS/mTLS — the cost of certificate distribution across compute nodes is what would make it never get deployed.
- The secret has to come from a file or environment, never a YAML field in a config users are told to copy.
configs/example.yamlis installed to/etc/objectfs/config.yamlbypostinstall.sh, world-readable. - Replay protection matters for ownership announcements specifically: an HMAC that authenticates a stale "I own key K" is still wrong. Include a nonce or a monotonic sequence per node, which the gossip heartbeat work (A1-5: Populate NodeInfo stats via gossip heartbeat #132) is already touching.
- Reject unauthenticated messages loudly and count them. A silent drop makes a misconfigured secret indistinguishable from a network problem.
Verification: an unauthenticated peer's join and its ownership announcements are both rejected; a replayed authenticated announcement is rejected; and — the one that catches the real failure — a node with the wrong secret fails to join with an error naming the reason, rather than joining a cluster of one.
Activity
Merge origin/main: #265's Added section beside #206's Security section
feat: authenticate gossip messages, and refuse to start without a sec…
release: v0.12.0, cut from the merge commit that closes both its mile…