Assurance
The rest of pqdoctor protects or checks one connection at a time. pqdoctor assure answers the
question about a whole application. In the example below, the customer-to-gateway connection is
verified hybrid post-quantum, the gateway-to-API connection uses classical key establishment, and
the card network has no evidence at all. Together that means full-path quantum-resistant
confidentiality hasn’t been demonstrated.
pqdoctor assure init assurance.toml # nodes, edges, paths, policypqdoctor assure collect assurance.toml # evidence → assurance.evidence.jsonlpqdoctor assure verify assurance.toml # every segment and path, with the reasonspqdoctor assure plan assurance.toml # what to do about each findingpqdoctor assure close assurance.toml gateway->api#1 --apply --approved-by alicepqdoctor assure certify assurance.toml --key bridge/signing.keyEvidence
Section titled “Evidence”Every record (pqdoctor-evidence/1, JSONL) says what a connection used and how strong the
evidence is:
| Level | Comes from |
|---|---|
observed |
Real traffic, from four sources. Proxy telemetry: a pqdoctor proxy’s /status, covering inbound handshakes by key exchange, the groups of its own backend connections, client-certificate keys and handshake failures. OpenTelemetry spans: tls.curve and tls.protocol.version with server.address and server.port, from the semantic conventions. The identity bridge: identity-bridge authz --evidence F --edge FROM->TO (and guard), one record per verified assertion with algorithms only, never subjects. Imported logs: any JSONL, through a field mapping you give (--import F --map endpoint=host --map kex=tls.group) |
probed |
An active handshake by pqdoctor’s engine, with the vantage point recorded |
configured |
A proxy config says the hop is loopback, plaintext or TLS. Configuration can prove a violation (plaintext on a network), never protection |
A proxy’s counters are cumulative since it started, so assure collect records the change since the previous collection. Otherwise a fixed segment would carry its old classical connections forever. Newer evidence from the same place replaces older: a re-probe, a proxy’s latest change.
Traces and imports are separate observations and all count. Evidence older than policy.max_age
doesn’t count. No application payloads are collected: only algorithms, counts and names.
Verification
Section titled “Verification”Each segment gets one of four results, separately for key exchange, server authentication and client authentication:
| Result | Means |
|---|---|
verified |
The policy is met, by evidence strong and fresh enough. Zones in policy.require_observed (default internet) need runtime observation; a probe alone isn’t enough there |
violated |
Evidence shows classical key exchange (or plaintext) where the policy needs post-quantum. In strict mode any classical connection counts; majority mode allows max_classical_share |
unknown |
No evidence, too old, too weak, or no authorized way to observe it. Unknown is never counted as secure |
exempt |
The segment stays on one host (loopback, Unix socket) |
A path is verified only when every segment is verified or exempt, and each path gets one plain-language statement of what holds.
Authentication is reported apart from key exchange. When identity crossed a delegating gateway
(the identity bridge, minted certificates), the segment says so: the gateway’s ML-DSA signature on
one side, the original client’s own key on the other. The ML-DSA signature never makes an ECDSA
client’s authentication post-quantum; client_auth = "pq" in the policy checks the client’s own
key.
Handshakes that fail (for example, a client that can’t verify an ML-DSA chain) are reported as a compatibility finding, apart from the key-exchange verdict.
Quantum exposure. Edges can carry data classes (financial, pii, credentials,
public, …) and retention_years. An unprotected segment’s exposure score combines how sensitive
the data is, how long it must stay confidential, and how exposed the segment is (internet,
partner, internal). Findings are ordered by that score, so the classical hop carrying ten years of
financial records comes first. Only the metadata you write in the topology is used.
Regressions and the radar
Section titled “Regressions and the radar”verify --history F appends each assessment. assure regressions --history F lists every segment
that went from verified or exempt to violated or unknown, dated between the last good and first
bad assessment, and every rise in classical fallback over 5 points. assure radar --history F --html radar.html charts the post-quantum share, the verified segments and the evidence coverage
over time. The page is self-contained, with no scripts.
The migration compiler
Section titled “The migration compiler”assure plan gives each failing segment steps from mechanisms pqdoctor has, chosen by what the
segment is and who owns it:
| Step | When |
|---|---|
fix-config |
The edge names the server’s config and a stack pqdoctor fix knows (nginx, Apache, HAProxy, Postfix, Dovecot, sshd, or a pqdoctor proxy.toml). Needs a TLS library with ML-KEM |
proxy-in-front |
The library can’t do ML-KEM: pqdoctor proxy on that host, the service moved to loopback. The config is generated |
tunnel |
Both ends are yours and the inner TLS (or mTLS) must stay end to end: pqdoctor proxy wrap |
unix-socket |
A plaintext hop that should stay on the host |
ml-dsa-server-cert, ml-dsa-client-certs |
The policy needs post-quantum authentication |
add-evidence |
The segment is unknown. This step is not a fix and is never reported as one |
vendor |
owner = "partner" / "vendor": the request to make, not a pretend fix |
Each step says what resolves it.
Closure and the controller
Section titled “Closure and the controller”assure close TOPO STEP --apply --approved-by NAME works in four stages:
- It checks the approver against
[approvals] approvers. - It applies the step: for
fix-config, throughpqdoctor fix’s safe path, which writes, runs the config test (edge.test, or the stack’s own), reloads (edge.reload) and re-checks, and rolls back if any of that fails. - It re-collects evidence and re-verifies the segment with the topology’s policy, using only evidence from after the change.
- It marks the step resolved only if that fresh evidence verifies the segment. If the change went in but the segment still fails the policy, it puts the original back.
After a change goes in (or is put back), close writes a change record for the segment and takes
a proxy baseline at that moment. From then on, verify counts only evidence whose window starts
after the change. A proxy aggregate that straddles it mixes connections from before and after (a
keep-alive connection opened to the old server, say), so it isn’t counted, and the reason says so.
Without --apply, close only re-verifies, for changes the owner made. Every action goes to an
append-only audit log (assurance.audit.jsonl): who approved it, what ran, before and after, and
the digests of the evidence.
assure run TOPO [--every 1h] is the controller loop: collect → verify → plan → apply the actions
listed in [approvals] auto (pre-approved by policy) → verify → audit.
Evidence certificates
Section titled “Evidence certificates”assure certify signs an assessment with ML-DSA: a JWS with typ: pqdoctor-assurance+jwt, the
same key format as the identity bridge. It covers the scope (topology and its SHA-256, the policy,
the time), each segment’s result per dimension with the evidence levels and the SHA-256 of every
evidence record behind it, and each path’s statement. assure check-cert CERT --jwks F verifies
the signature and the expiry. With --topology T --evidence F… it also recomputes the whole
assessment as of the certificate’s time and checks every evidence digest. A certificate claiming
more than its evidence supports fails, and so does one whose results were edited.
The topology
Section titled “The topology”name = "online-banking"[policy]kex = "pq" # or "any"server_auth = "any" # "pq": ML-DSA / SLH-DSA server keysclient_auth = "any" # "pq": the clients' own keysmax_age = "24h"require_observed = ["internet"]
[approvals]approvers = ["alice"]auto = [] # e.g. ["fix-config"] for `assure run`
[[node]]id = "gateway"kind = "gateway" # clients, gateway, service, externalzone = "dmz" # internet, dmz, internal, host, partnerproxy_admin = "127.0.0.1:9477" # telemetryproxy_config = "/etc/pqdoctor/proxy.toml" # its listeners become edges
[[edge]]from = "gateway"to = "api"endpoint = "10.0.0.5:8443"data = ["financial", "pii"]retention_years = 10stack = "nginx"config = "/etc/nginx/nginx.conf"owner = "ours" # ours, partner, vendor
[[path]]name = "online payment"via = ["customers", "gateway", "api", "card-network"]Without [[path]], every maximal chain from a node with no inbound edge is a path.
Checked
Section titled “Checked”-
Unit and integration tests (
assurance::*) cover:- the bank example’s statements;
- probes not satisfying internet zones, and stale evidence;
- strict and majority fallback;
- delegated identity kept apart from the client’s own key;
- loopback exemption and dated regressions;
- OTel, proxy-status and import collection;
- a plan that offers only what fits;
- closure refused without the right approver, resolved on fresh post-quantum evidence, rolled back when the server stays classical, and resolved verify-only;
- the radar;
- certificates that verify, re-derive, expire, and catch edited or unsupported claims.
-
End to end on Windows (
tests/assure_e2e.rs), with real proxies and real handshakes on loopback:- The hybrid edge is verified (observed). The classical internal API is violated. The ML-DSA assertion and the client’s own ECDSA key are reported apart. The ML-DSA server is verified, with a legacy client’s failed handshakes reported. The card network is unknown.
- The plan has a fix-config step. Close is refused without an approver and for the wrong approver. The approved fix runs with 30 concurrent requests, all 200.
- An independent client then negotiates X25519MLKEM768, and the recovery is observed at runtime.
- The certificate verifies and re-derives; a forged one fails.
- A regression is detected. A failing config test leaves the original. The audit log and the radar record it all.
-
The five-service acceptance test on the Ubuntu lab VM: network namespaces, real nginx, OpenSSL 3.5 (
lab/acceptance/). 23 of 23 pass, covering:- every condition found and explained;
- the plan;
- close refused without approval, then applied, with 60 customer requests during the change, all 200;
- an independent OpenSSL re-test (X25519MLKEM768);
- a signed certificate that re-derives, and an edited one that fails;
- a dated regression;
- a failing config test rolled back;
- bridge key rotation;
- connections over
max_connectionsrefused and counted.
Its first run found the straddling-aggregate problem above, and a missing
refusedLimitin/status. Both are fixed.