security: verify registration proof-of-possession (PPA-003 server side)#101
Merged
Merged
Conversation
…server side) Completes the server half of PPA-003 (client signing lands in common#37). HandleRegister now verifies the optional `signature` field over "register:<listen_addr>:<public_key>" against the submitted public_key, using the same ed25519 primitive as heartbeat/deregister/resolve. Backward-compatible by default (verify-if-present): - unsigned registrations from old agents are still accepted; - a present-but-invalid signature is rejected (catches tampering / forged re-registration endpoint-repoints); - the new -strict-registration-auth flag / RENDEZVOUS_STRICT_REGISTRATION_AUTH requires a valid signature (opt-in; enable only once the fleet signs). Mirrors the existing default-off StrictDirectoryAuth (WS2) wiring. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the server half of PPA-003. The client-signing half is pilot-protocol/common#37; the daemon already signs
register:<listen_addr>:<public_key>with the same ed25519 identity it uses for heartbeat/deregister.HandleRegisternow verifies the optionalsignaturefield overregister:<listen_addr>:<public_key>against the submittedpublic_key, using the samecrypto.Verifyprimitive as the existing signed operations. The verify runs lock-free (beforeHandleReRegistertakess.mu), per the file's lock-ordering rule.Backward-compatible by default (verify-if-present):
-strict-registration-auth/RENDEZVOUS_STRICT_REGISTRATION_AUTHrequires a valid signature (opt-in; enable only once the fleet signs). Mirrors the existing default-off-strict-directory-auth(WS2) wiring exactly.End-to-end compatibility verified: daemon signer is
base64(ed25519.Sign(identity, challenge))(web4 daemon.go:2260); this verify ised25519.Verify(pub, "register:<addr>:<pubkey>", sig)— identical challenge + primitive.Tests:
TestHandleRegisterSignatureVerification— 7 cases (unsigned-allowed-by-default, unsigned-rejected-when-strict, valid-accepted both modes, wrong-key-rejected both modes, malformed-rejected). Fullgo test -race ./...green (20 pkgs), no regressions.Deploy note: ship with the flag off, let the signing client roll out fleet-wide, then flip
-strict-registration-authfor the airtight guarantee.🤖 Generated with Claude Code