π Day 284 β Signing Recovery Requests and Rejecting Replays
π Topic
I reviewed the authentication added to the control requests that let an Ubuntu service ask a Mac to launch, inspect, and verify recovery work. The lesson was how to bind an authenticated request to the operation it actually authorizes.
π― Goal
Prevent a request from being altered, reused, or moved to a different recovery action. Reaching the control endpoint should not be enough to authorize a job.
π What I Reviewed
The implementation signs a canonical sequence containing the protocol version, action, recovery identifier, repository key, timestamp, nonce, and SHA-256 hash of the exact request body. The Mac takes the action from the route being called rather than trusting a caller-supplied action header.
The Ubuntu service holds the Ed25519 private signing key; the Mac holds the public verification key. This separates request-signing authority from verification on the machine where repair workers run. It does not make the Mac immune to compromise or protect a private key stolen from the Ubuntu account that owns it.
The verifier refuses missing headers, malformed values, a missing verification key, invalid signatures, timestamps outside a 60-second tolerance, and previously accepted nonces. It remembers a nonce only after checking the signature, so an invalid signature cannot consume a nonce in that store.
π Freshness and Duplicate Work Are Different
The nonce identifies one signed request. The recovery identifier identifies the operation being tracked. They solve different problems.
The recorded bounded smoke accepted a signed request and refused the same request when replayed. It also sent a newly signed launch request for an already launched recovery identifier. That request reached the operationβs idempotency check: the result was βalready launched,β and the job count stayed unchanged.
Rejecting a replay does not by itself prevent a legitimate client from signing a duplicate operation. I need both request authentication and operation-level duplicate handling.
π§ͺ What the Evidence Covered
The dated hardening record describes a smoke through the real tunnel using a disposable fixture repository. It includes refusals for missing authentication, replay, the wrong action, the wrong repository, expiry, and body tampering.
I also inspected the matching tests and verifier code. The tests generate temporary keys and use a controlled clock to exercise accepted requests and negative cases. This write-up does not repeat the smoke, read signing credentials, or launch a new recovery job.
π Key Cybersecurity Connections
This is authentication, request integrity, and replay resistance at a control-plane boundary. Repository allowlisting, fixed route grammar, and job identity checks remain separate controls. A valid signature does not make every repository or command permissible.
The refusal response is deliberately uniform to the caller, while a local reason code distinguishes the failure. That supports diagnosis without returning detailed authentication failures over the control interface.
β Evidence Limits
The smoke established the exercised routes and fixture behavior at the recorded point in time. It did not demonstrate resistance to a compromised signing account, every denial-of-service pattern, or every future route change. Clock drift beyond the allowed tolerance can also refuse a legitimate request.
π What I Learned
An authenticated request needs an exact meaning: which action, repository, recovery operation, and body were approved, and whether this particular request is still usable.
π TL;DR
I reviewed signed recovery requests with body and action binding, timestamp checks, and single-use nonces. A separate idempotency check keeps a newly signed duplicate launch from creating another job.
