gunk-dev/the-valley
the-valley:qn-be047c5questionopen

Where is an approval signed when the change is shown over ssh, on the web or in an app?

State
question or idea
Created
2026-11-09 by contributor

Body

Approving means signing an approval statement with the key on the machine the operator sits at. `approval sign --piv` reaches a YubiKey over USB through `valley-piv-signer`, so the statement has to be signed where the key is plugged in. Three places that show a change are somewhere else:

1. a terminal on another machine, over ssh;
2. a web page at the edge;
3. a phone or desktop app.

These should be designed together, as one answer, rather than one at a time.

What each can do with today's format, an ordinary Ed25519 note signed by a PIV key:

- **ssh, agent forwarding.**
  - OpenSSH 10.1 and later can load an Ed25519 PIV key through PKCS#11 (YubiKey firmware 5.7 and later), and a forwarded agent can sign a note's bytes.
  - The agent signs whatever bytes the remote sends, so the touch confirms nothing the operator can read.
- **ssh, a forwarded signer.**
  - A signer on the machine holding the key listens on a socket forwarded to the remote (`ssh -R`). It shows the statement's own fields, then signs when the key is touched.
  - The statement names the exact head. A remote that shows one change and sends another is caught by what the signer shows.
- **Web.**
  - A browser reaches FIDO keys through WebAuthn, never a PIV slot.
  - A WebAuthn assertion doesn't sign the statement itself. It signs authenticator data and a hash of client data that carries a challenge.
  - Accepting it means a second approval format: the challenge is the statement's digest, and the verifier checks user presence and origin.
  - The alternative is for the page to hand the statement to a signer on the operator's machine.
- **App.** A phone app reaches a PIV slot over NFC through the YubiKey mobile SDKs, and signs the same note the CLI signs.

A candidate single shape:
1. The surface that shows the change writes the statement.
2. A signer beside the key shows the statement's fields and takes the touch.
3. The note goes back to the surface.

The signer is then the one display an approval relies on, and each surface is only a way of reaching it. The alternative is to accept WebAuthn as a second format. That lets a browser approve with no helper, but it gives up the decision on oc-3bc80df that every approval is one format.

To settle:
- one signer reached in several ways (a forwarded socket, a local bridge for the web, NFC in an app), or a second format for the web;
- what the signer must show for a touch to mean "this head of this change", and what it shows for a batch;
- whether a software key may sign through a surface on another machine;
- whether any of this belongs in the first release of hardware approvals, or waits for the design work after it.

Related:
- oc-3bc80df: its first release signs on the machine with the key;
- ida-28f247f: signed claims as the one auth model;
- ida-61b28ec: read links issued by signed record from the operator's machine.

Comments

  1. contributor2026-11-14 20:08 UTC
    Decision by the operator: signing where the change is shown from another machine (ssh), on the web or in an app is deferred to the design work after the base milestone. The first release of hardware approvals signs on the machine that holds the key. This question stays open for that design work and does not block oc-3bc80df.
  2. contributor2026-11-15 14:28 UTC
    Web approval, design notes and order (operator, 2026-11-15). Possible through WebAuthn: the challenge is the hash of the approval statement, and the signed authenticator data carries the presence and verification flags. Costs: a second proof kind beside plain Ed25519 notes (revisits the one-format decision), a second enrollment tied to the web origin, and a policy that admits only credentials attested as hardware (synced passkeys are not device-bound). Browsers cannot reach PIV, so the web cannot produce the CLI's signature.
    
    Trade-off: the CLI prevents a wrong-change approval because the operator's machine builds what is signed; on the web the host's page shows the change and builds the challenge, so a compromised host can obtain a valid signature over a different change. That is only detectable, and needs: approval notes and change records kept after landing; the registry pinned by the client; an audit from a client the host does not control that lists what a key approved; and a transparency log so the host cannot show one reader a different history.
    
    Order agreed: the gate and activation by CLI first; then the architecture and design review; web approval after the review, with the audit and the log before it. For the gate slice: treat the accepted proof kinds as a list with one entry, so another kind is an addition.