ADR-082: Passkey (WebAuthn) Signer Credentials for Browser-Signed Intake Reports

Status

Proposed (2026-10-02). Amends ADR-042 §D8/§D9 and its 2026-08-29 amendment (signing receipts). ADR-018 (detached JWS) is unchanged for machine clients. The ADR-045 cache and its #892 revocation-generation eviction apply to both credential kinds unchanged.

Context

A mandated reporter on the standalone-SHINES edge signs a report in the browser today as follows:

  1. /keygen generates a P-256 key pair with WebCrypto, registers the public JWK with the keyring through intake’s same-origin proxy, and downloads the private key as a {kid, privateKeyJwk} file.

  2. An operator approves the kid at the keyring.

  3. On /report, the reporter re-imports the file, and craig-sign.js signs a detached JWS ({alg, kid, jti, iat}) over the canonical report.

The goal of this change is usability: reporters should not have to manage a key file. Passkeys (WebAuthn) remove the file and bring security gains with it:

  • The private key stays inside an authenticator and is never handed to page script, so a script injected into the intake origin cannot steal it.

  • Every signature carries a user-presence flag and a user-verification flag (biometric or PIN).

  • Every signature is bound to the calling origin.

Every current browser offers a passkey without extra hardware: platform authenticators (Windows Hello, iCloud Keychain, Google Password Manager), password-manager extensions such as Bitwarden, or a phone over the hybrid QR flow. No reporter holds a production key file yet, so nobody needs migrating.

Three facts shape the decision:

  • Passkeys do not fit machine clients. craig-intake-sdk and the Python and TypeScript SDKs sign detached JWS for third-party systems (ADR-042 §D9). A server has no authenticator, so the JWS path has to stay.

  • Most passkeys are synced, and many can be exported. Bitwarden includes passkeys in its vault export, and since 2026 the FIDO Credential Exchange Protocol moves passkeys between Apple, Google, Bitwarden, 1Password and others. Apple lets users share passkeys with a group. Platform and extension passkeys send no attestation, so the server cannot tell which product holds a key. A passkey signature therefore proves "a holder of this credential, who passed the authenticator’s user-verification check". That is less than "this person", but more than the current file proves.

  • No WebAuthn server library fits. webauthn-rs (Kanidm, the mature choice) depends on openssl and openssl-sys, both denied in deny.toml (musl ⇒ rustls). Its pure-Rust backend request (kanidm/webauthn-rs#423) was closed as a duplicate, with no timeline. The pure-Rust relying-party crates are weeks to months old, each with one maintainer: passkey-auth 0.1.3 (2026-05), webauthn-kit 0.3.1 (2026-09), passkey-rp 0.1.0 (2026-08, about 100 downloads).

Decision

D1 — Two credential kinds, passkeys in identity groups

signer_keys gains credential_kind (jws | webauthn; migration default jws). Both kinds share the existing lifecycle: pending → approved → revoked, expires_at, the max_keys cap, the admin-token approve/revoke routes, and the revocation-generation bump.

  • Identity groups. A new signer_identities table holds an immutable user_identifier and a mutable display_name. Every webauthn key belongs to exactly one identity. jws keys have no identity and keep their labels on the key row, so machine clients are untouched.

  • Columns on a webauthn row: the credential ID (credential_id BYTEA, unique), the RP ID it was created under (rp_id), and the backup-eligible flag observed at registration (backup_eligible). CHECK constraints enforce the per-kind shape.

  • Passkey kid. Derived as wa_ + base64url(SHA-256(credential ID)), always 46 characters. This keeps the existing 64-character key_id cap and the by-kid route even though a raw credential ID can be up to 1023 bytes. Reporters never see it.

  • One key format, one algorithm. The public key is stored as a P-256 JWK for both kinds, so the by-kid response shape and the signature code stay shared. Only ES256 (COSE algorithm -7) is offered or accepted.

  • Kind binding. The by-kid response (SignerKeyInfo) gains credential_kind; the change is additive, and an absent value (craig-security in integrated mode) means jws. The verifier must match the credential to the kind of proof it receives. A WebAuthn assertion verifies only against a webauthn row, and a JWS only against a jws row. Without this check, anyone holding a JWS private key could forge authenticatorData with the user-verification flag set and skip the user-verification requirement.

D2 — The keyring owns WebAuthn configuration and verifies registration

Keyring settings:

  • CRAIG_INTAKE_KEYRING__WEBAUTHN_RP_ID

  • CRAIG_INTAKE_KEYRING__WEBAUTHN_ALLOWED_ORIGINS (HTTPS, plus http://localhost for devstack)

  • CRAIG_INTAKE_KEYRING__WEBAUTHN_REQUIRE_DEVICE_BOUND (D7)

  • CRAIG_INTAKE_KEYRING__WEBAUTHN_MAX_ACTIVE_PER_IDENTITY (D5)

The keyring serves the first three at GET /webauthn/config (internal, unauthenticated).

Intake reads the configuration from the keyring. Under BackendProfile::Shines, intake fetches it once at boot and refuses to boot if it cannot (fail-closed). Intake has no WebAuthn settings of its own, so the two services cannot disagree. Changing the configuration needs an intake restart.

Browser ceremony. /keygen calls navigator.credentials.create with:

  • residentKey: "required" (a discoverable credential, so no key file and no username is needed to sign later)

  • userVerification: "required"

  • attestation: "none"

  • pubKeyCredParams: [{alg: -7}]

  • a fresh random user.id

The challenge is SHA-256 of the canonical {display_name, iat, user_identifier}. This ties the labels the admin will see to the credential that was created.

The keyring verifies registration. Intake’s POST /signed/v1/keys/register relays the raw ceremony (attestation_object, client_data_json, labels, iat), and the keyring checks:

  • clientDataJSON has type = webauthn.create, the expected challenge, an allowed origin, and crossOrigin absent or false;

  • iat is inside the existing JWS freshness window;

  • authenticatorData has an rpIdHash equal to SHA-256 of the RP ID, and both user-presence and user-verification flags set;

  • the key, decoded from the COSE structure inside attestationObject (D6), is ES256 P-256.

It then creates an identity and a pending key. The store therefore only ever holds passkeys whose ceremony it verified itself. Like JWS registration today, this route is unauthenticated: anyone can propose a credential, and it signs nothing until it is approved.

D3 — Report signing: intake verifies, the challenge binds the report

/report calls navigator.credentials.get at submit time, with an empty allowCredentials (the authenticator offers its discoverable credentials) and userVerification: "required". The challenge is:

base64url(SHA-256(canonical{"iat", "jti", "payload_sha256"}))

The client mints jti and iat as it does today, so the edge keeps no challenge state (ADR-017). This applies to both the JSON and the multipart transports.

The assertion travels in a new X-WebAuthn-Assertion header as base64url JSON: {credential_id, authenticator_data, client_data_json, signature, jti, iat}. A request carrying both X-JWS-Signature and X-WebAuthn-Assertion is rejected with 401.

Intake verifies report assertions itself, because this is the hot path and it already holds the cached SignerAuthClient. verify_signed_jws becomes verify_signed_credential, one entry point with one branch per kind. The WebAuthn branch:

  1. Canonicalizes the raw report bytes, as today, and recomputes the challenge.

  2. Checks clientDataJSON type = webauthn.get, the challenge, and the origin against the configuration fetched at boot.

  3. Checks the authenticatorData rpIdHash and both the user-presence and user-verification flags. When device binding is required, it also rejects backup-eligible credentials.

  4. Looks up the derived kid through the existing cached SignerAuthClient. The row must be an approved, unexpired webauthn key (D1).

  5. Verifies the ES256 signature over authenticatorData ‖ SHA-256(clientDataJSON). WebAuthn ES256 signatures are ASN.1 DER, not the raw r‖s used by JWS.

  6. Applies the same iat window, the same jti replay check, and the same revocation-generation re-check as JWS.

The uniform 401 stays (#707). A pending, unknown, revoked or expired passkey, and every other credential failure, gets a bare 401. A keyring outage is a 500. The report page does no up-front approval check. On any 401 it shows one hedged message ("Signature not accepted — if you registered recently, your passkey may still be awaiting approval") and keeps the filled form. The self-service page (D5) is where a reporter sees whether a passkey is approved.

The signature counter is recorded in the receipt but not enforced. Synced passkeys report 0, and enforcing it would need a write to signer_keys on every assertion.

D4 — Receipts stay re-verifiable, and an operator command re-verifies them

signing_receipts gains credential_kind. jws becomes nullable. Nullable authenticator_data, client_data_json, signature, flags and sign_count are added. A CHECK constraint requires exactly one evidence shape per row. Existing JWS receipts are untouched.

The replay-check wire extension gains an optional webauthn_receipt object beside the existing three JWS fields. The all-or-nothing rule applies to each shape, and a request carrying both shapes gets 400. A WebAuthn receipt re-verifies from the stored authenticatorData, the stored clientDataJSON and the original canonical payload, against the registered key. The payload still never reaches the keyring: only its hash appears, inside the challenge.

The keyring binary gains craig-intake-keyring verify-receipt --jti <uuid> --payload <file>. It re-verifies every receipt for that jti, of either kind, against the key registered under its signer_kid, and prints VALID or INVALID per receipt with the failing check. Exit codes: 0 if all are valid, 1 if any is invalid, 2 if no receipt was found or the payload is unreadable. It dispatches like the existing migrate subcommand and never applies DDL.

D5 — Reporter self-service on /passkeys

Each self-service action is one passkey assertion. Its challenge binds {op, iat, jti, …​op fields}, with these operations:

  • view

  • rename {display_name}

  • revoke {target_kid}

  • add_device {new_kid}

Intake proxies each action raw. The keyring verifies the assertion with the D3 rules, using its own configuration and its own jti replay store, then authorizes the action.

  • View. Shows the identity’s labels and every passkey in the group: effective status, created_at, backup_eligible, and which passkey signed. It never shows a JWK or a credential ID.

  • Rename. Changes the identity’s display_name only. user_identifier is immutable, because it is what the admin approved on. A rename needs no re-approval and is logged as a structured event.

  • Revoke. Revokes the signing passkey or, when signed by an approved passkey, any sibling in the group. This is how a reporter recovers from a lost device. It is terminal and bumps the revocation generation in the same transaction. A target outside the caller’s group gets 404, indistinguishable from an unknown kid.

  • Add device. Two ceremonies on one page: first create() on the new device, using the D2 challenge with the identity’s labels; then get() with an approved passkey of the group, on the same device or by hybrid QR. The keyring verifies both and links the new key to the identity. The new key is auto-approved if the group has fewer active (approved and unexpired) passkeys than MAX_ACTIVE_PER_IDENTITY (default 3), and pending otherwise. The check runs under a per-identity lock, so concurrent adds across keyring instances cannot overshoot the cap.

What a pending passkey may do. View, rename and revoke itself. That reveals its pending status only to someone who just produced a valid signature with it, and it does not touch the report path (D3). Revoked and expired passkeys get the uniform 401.

Admin surface.

  • Approve and revoke are unchanged for both kinds. Admin approval is not limited by the cap; the cap governs auto-approval only.

  • A new admin-token route, PUT /identities/{identity_id}/revoke, revokes a whole group with one generation bump. This is the backstop for the auto-approval risk (see Consequences).

  • The metadata key list gains credential_kind, identity_id and backup_eligible.

  • There is still no browser admin UI.

D6 — A narrow in-house verifier crate

A new workspace crate, craig-webauthn, holds the protocol parsing and checks:

  • authenticatorData, including the attested credential data;

  • the attestationObject CBOR, with only the none format accepted;

  • COSE EC2 P-256 → JWK conversion;

  • the clientDataJSON checks;

  • derive_kid;

  • the DER ES256 verification.

Both the keyring (registration and self-service) and intake (report signing) use it. The cryptography is the RustCrypto p256/ecdsa/sha2 the workspace already uses, so no new primitive is introduced.

The COSE key is always parsed server-side, and the browser’s getPublicKey() is not relied on. That gives one code path for every authenticator, including password-manager extensions, at the cost of a CBOR dependency. Before that crate is used, its choice is recorded with a comparison of at least three candidates on maintenance, adoption, security and fit (pure Rust, musl, AGPL-compatible).

The crate covers only this profile: ES256, none attestation, discoverable credentials, and user verification required. If a later need (attestation, more algorithms) outgrows it, revisit webauthn-rs (once it has a pure-Rust backend) or a matured pure-Rust relying-party crate.

D7 — Assurance: user verification required, device binding a deployment policy

User verification is required at registration, at signing and on every self-service action. By default any passkey is accepted, synced passkeys included. backup_eligible is recorded at registration and shown to admins and on the self-service page. The backup-eligible and backed-up flags are recorded in every receipt.

CRAIG_INTAKE_KEYRING__WEBAUTHN_REQUIRE_DEVICE_BOUND (default false) refuses backup-eligible credentials at registration, at add_device, and at assertion (intake reads it from the keyring configuration). A deployment that needs hardware-level assurance enables it and provisions security keys. Attestation is out of scope.

D8 — Browser surface

  • Browser keygen and report form: /keygen creates passkeys only, and /report signs with a passkey only. The private-key download, the {kid, privateKeyJwk} file and key-file import are removed. No production reporter holds a key file, and this is pre-1.0, so there is no compatibility path.

  • JWS stays on /signed/v1/reports for SDK and machine clients.

  • WebAuthn unavailable. If there is no PublicKeyCredential, or the page is not a secure context, the page explains why and does not offer signing.

  • Cancelled prompt. If the reporter cancels the passkey prompt or it times out, the page shows a non-error "signing cancelled" message, keeps the form, and sends nothing.

D9 — Testing

Most coverage is automated. Real authenticators need a recorded manual pass.

  • Automated (pre-push and CI).

    • Unit and property tests: proptest invariants on every craig-webauthn parser (no panic on arbitrary bytes; a round trip where one exists).

    • Rust integration tests: a software authenticator in craig-test-lib builds authenticatorData and clientDataJSON and signs with p256, with no new dev-dependency. These cover every D3 rejection, the cross-kind cases (D1), both headers on one request, device-bound enforcement, the cap boundary, pending-passkey permissions, sibling and out-of-group revoke, identity revoke, receipt re-verification through the D4 command, and intake refusing to boot without keyring configuration.

    • Multi-instance: a race test proves the per-identity cap holds.

    • E2E: Playwright drives Chromium’s CDP virtual authenticator against the ADR-046 TLS instance. It covers keygen → approve → sign → submit, a failed user-verification check, a prompt timeout, the pending-passkey 401 message, and self-service (with two virtual authenticators for add_device).

  • Captured vectors. Registration and assertion output from each real authenticator class below, plus Chromium’s virtual authenticator, is checked into sdks/test-vectors/webauthn/. Tests verify each vector and reject it after a one-byte mutation, so real-world output stays a regression test after a single capture.

  • Manual compatibility pass (a hard requirement before shipping). Register, sign a report, one self-service action, and add_device by hybrid QR, on each of: Windows Hello (Edge or Chrome) and iCloud Keychain (Safari); Google Password Manager (Chrome); the Bitwarden browser extension; a FIDO2 hardware key with a PIN. The browser and OS versions used are recorded. These cannot run in CI. Playwright’s virtual authenticator is Chromium-only, so Safari and Firefox are covered only by this pass. It is repeated for release candidates and after major browser or extension releases.

Alternatives considered

  • Replace JWS with passkeys entirely. Rejected: machine clients cannot hold passkeys. Dropping signed machine submission is a product decision outside this ADR.

  • Keep JWS and make the browser key non-extractable (a WebCrypto key in IndexedDB). This removes the file and stops script from exporting the key. Rejected: no user verification, no origin binding, and the key is lost whenever site storage is cleared, with no recovery path.

  • Intake verifies registration and forwards a normalized key. This keeps the keyring unaware of WebAuthn. Rejected: any internal caller could then store a passkey whose ceremony nobody verified, and RP configuration would live where the keys do not.

  • Configure the RP ID and origins in both services. Rejected: a mismatch silently fails every passkey. The keyring-served configuration costs one fail-closed boot dependency.

  • An up-front approval check on /report (a kid remembered in localStorage, or an extra passkey prompt). Rejected: either per-device or an extra biometric prompt. The self-service page covers the need.

  • A distinguishable "pending" error on report submit. Rejected: it adds a status oracle to the report path (#707). Self-service shows pending status only after a valid signature.

  • Added devices always need admin approval. This is safer, but makes multi-device use depend on an operator. Rejected in favour of auto-approval capped per identity.

  • webauthn-rs. Rejected: OpenSSL is denied (musl ⇒ rustls, deny.toml), and it has no pure-Rust backend.

  • A pure-Rust relying-party crate (passkey-auth, webauthn-kit, passkey-rp). Rejected for now: months-old, single-maintainer crates on a mandated-reporter authentication path.

  • Require hardware or attestation for every reporter. Rejected as the default because of rollout cost and the usability goal. The device-bound setting (D7) gives the hardware option without attestation.

Consequences

  • Positive:

    • The browser private-key file is gone.

    • Reporters sign with whatever authenticator they already have, and can sign from several devices.

    • A lost device can be revoked from a sibling passkey without an operator.

    • Script injected into the intake origin can trigger a signature but can no longer steal a key.

    • Every browser signature carries user verification and is bound to the intake origin.

    • The keyring, replay, receipt and revocation machinery is reused, not duplicated.

    • Receipts of both kinds can be re-verified with one operator command.

  • Negative:

    • There are two credential kinds and an identity model to support and test.

    • The keyring becomes WebAuthn-aware and is a boot dependency of intake.

    • WebAuthn evidence is not standard JOSE: re-verifying a receipt needs craig-webauthn or equivalent code. This matters for the SHINES evidence mapping (#691).

    • Credentials are bound to the RP ID: each deployment domain has its own, and changing the domain orphans every credential.

    • craig-webauthn is security-critical parsing the project now owns, plus a new CBOR dependency.

    • Each release candidate needs a manual compatibility pass.

  • Residual risk:

    • With the default policy, a signature proves possession of a credential that may be synced, shared or exported. It does not prove a specific person signed (D7).

    • Someone who steals or borrows an approved passkey can add up to cap − 1 more active passkeys to that identity. They are bounded by the cap, visible on the self-service page and in the admin list, and removed together by the identity revoke route.

    • Each passkey gets a fresh user.id, so authenticators may list the passkeys of one identity as separate accounts.

Out of scope

  • A browser admin approve/revoke UI.

  • How signer evidence reaches SHINES (#691).

  • Integrated-mode (craig-security / craig-web) passkeys.

  • Attestation verification and authenticator allow-lists.

  • Algorithms other than ES256.

Open questions

  1. CBOR crate: which crate, decided by the D6 comparison before first use.

  2. Two devstack origins, one RP ID: the keyring holds a single RP ID, but devstack serves intake on two origins (:8011 HTTP and the :8013 TLS instance). Options are a second keyring configuration or targeting one instance per e2e run; the choice is documented in devstack.adoc.

  3. Playwright RP ID: confirm the virtual authenticator accepts the e2e host (host.docker.internal over ADR-046 TLS) as an RP ID.

Edit this page · latest