Warden command line
The commands, flags, verdicts and exit codes of warden, the open-source receipt verifier.
Get warden#
warden is the open-source verifier of Panward receipts and attestations (Apache-2.0). It is the same Rust code the gateway uses for its own checks. Published binaries are not available yet: build it from the gateway repository.
$ cargo build --release -p warden
When you give it a receipt id, warden verify reads your key from the PANWARD_API_KEY environment variable to fetch your own receipt. Everything else it fetches is public.
Commands#
warden verify
Runs the six steps over a receipt and prints a verdict. With a receipt id it fetches the receipt with your key (PANWARD_API_KEY); with --bundle it reads the receipt, the archived attestation and the published policies from an evidence bundle downloaded from the console.
$ warden verify rcpt_01JC7Q4N9W3XK2H8ZP5T6V7B8M \ --request request.json --response response.bin
Synopsis: warden verify <receipt.json | receipt id> [--request FILE] [--response FILE] [--attestation fresh|archived] | warden verify --bundle FILE [--request FILE] [--response FILE]
warden attest
Checks the attestation document of a gateway host (a fresh one bound to a nonce of Warden's own, or an archived one) without a receipt.
$ warden attest api.panward.ai
Synopsis: warden attest <api host> | warden attest --archived <FILE | attestation id>
warden releases
Lists the published gateway releases, the measurements each one carries, whether its release statement is in the transparency log, and the receipt keys listed as revoked.
$ warden releasesSynopsis: warden releases [--releases FILE]
warden explain
Prints a receipt in plain words, one line per fact and whose statement each is. Nothing is checked and nothing is fetched.
$ warden explain receipt.jsonSynopsis: warden explain <receipt.json>
warden audit
Runs verify, then lists which of the upstream evidence objects the receipt names (by content hash) are in a directory you were given under an audit agreement. It does not re-check the upstream proofs.
$ warden audit --evidence evidence/ receipt.json
Synopsis: warden audit --evidence DIR <receipt.json>
The six steps#
Each step is reported as pass, fail or skipped, with a reason. A step that cannot run is skipped and the verdict says so; it is never reported as passed.
| Step | Name | What it checks |
|---|---|---|
| 1 | Gateway identity | The attestation document's quote is genuine and current under Warden's own rules (accepted platform status, minimum collateral evaluation number, no debug mode), its report data binds the nonce and the keyset, and the keyset digest is right. |
| 2 | Published software | The gateway's measurements equal a row of the published release file, and that release's statement is in the public transparency log. |
| 3 | Receipt signature | The receipt's signing key is in the attested keyset, and the signature is valid over the canonical form of the receipt without its signature. |
| 4 | Your bytes | The SHA-256 of the request and response bytes you supplied equals the hashes in the receipt's request.received and response.emitted events. Without your bytes the step is skipped. |
| 5 | Stated result | The receipt's upstream.verified event is well formed and consistent. Warden reports what the gateway states it verified (level, signer scope, evidence references, claims) and does not check any of it against the upstream. |
| 6 | TLS binding | When Warden fetched the attestation itself, the key of that connection is in the attested keyset. Skipped when the document came from a file. |
Verdicts and exit codes#
| Verdict | Meaning |
|---|---|
verified | Every step that ran passed, your request and response bytes matched the receipt, and the receipt states a Sealed level. The gateway's own statement about the upstream is reported as the gateway's, not as something Warden checked. |
verified_without_content | Every step that ran passed, but no request and response bytes were given, so step 4 was skipped. The line is always: Gateway signature valid. Contents not checked. |
routed | The receipt is genuine and the gateway states level routed: no upstream enclave evidence exists for that request. |
failed | A step failed. The report names the step and the reason. A receipt that is not final yet is reported this way, with the reason receipt_pending: retry later. |
| Exit code | Meaning |
|---|---|
| 0 | verified, or verified_without_content, or routed when --allow-routed was given |
| 1 | failed (including a receipt that is not final yet) |
| 2 | a usage or input error: no verdict is printed |
| 3 | routed, without --allow-routed |
| 4 | verified_without_content with --require-content |
$ warden verify receipt.json --request request.json --response response.bin --require-content || exit 1
Flags#
| Flag | Commands | What it does |
|---|---|---|
--request FILE | verify, audit | The exact request body bytes you sent. Hashed in the process; step 4 compares the hash with the receipt. |
--response FILE | verify, audit | The exact response bytes you received (for a stream, every byte of the event stream). |
--attestation fresh|archived | verify, audit | Which attestation document step 1 uses: the archived one the receipt names (default) or a fresh one from the live endpoint. |
--attestation-file FILE | verify, attest, audit | The attestation document, read from a file instead of fetched. Without it an archived one is fetched from the public archive by the id the receipt names; Warden checks that it hashes to that id. |
--bundle FILE | verify, audit | An evidence bundle downloaded from the console: the receipt, the archived attestation it names and the published verification policies. Takes the place of the receipt argument; a file flag given as well wins. |
--collateral FILE | verify, attest, audit | Collateral for the attestation's quote, read from a file instead of fetched from the hardware vendor. |
--releases FILE | verify, attest, releases, audit | The release file, read from a file instead of fetched from the site. |
--policies FILE | verify, audit | Published verification policies (default: those in the release file). |
--verification-policy FILE | audit | For audit, with --proof: the verification policy document the receipt names, from the auditor export. The evidence in --evidence is then re-appraised with its refresh records and the platform collateral beside it, and only when every link holds does the audit report full_chain_verified. |
--proof FILE | audit | For audit: the upstream proof kept beside the receipt, from the auditor export. It is re-verified against the --evidence objects: signed by the key the evidence binds in its quote, over the bytes the receipt says were exchanged. |
--checkpoint FILE | verify, audit | Inclusion proof of the receipt in a logged checkpoint: the time bound of the receipt. |
--nonce HEX | verify, attest, audit | The 64-character nonce a fresh attestation document read from a file was requested with. |
--tls-spki HEX | verify, attest, audit | Key hash of the connection that document was fetched over (step 6). |
--offline | verify, attest, releases, audit | Make no network call at all. |
--allow-routed | verify, attest, audit | Exit 0 for a receipt at level routed (default: exit 3). |
--require-content | verify, attest, audit | Exit 4 when your request and response bytes were not checked. |
--min-evaluation-number N | verify, attest, audit | Minimum collateral evaluation number (default 20). |
--accept-status STATUS | verify, attest, audit | Accepted platform status; repeatable (default UpToDate). |
--release-identity URI | verify, attest, releases, audit | Signer of release statements in the transparency log. |
--release-identity-prefix URI | verify, attest, releases, audit | Instead of --release-identity: every signer whose name starts with URI, as the releases of one workflow all are. Panward's: https://github.com/<org>/<repo>/.github/workflows/release.yml@refs/ with --release-issuer https://token.actions.githubusercontent.com. |
--release-issuer URL | verify, attest, releases, audit | Identity issuer of that signer. |
--checkpoint-identity ID | verify, audit | Signer of checkpoints in the transparency log, given with --checkpoint-issuer. Without it no checkpoint is believed. |
--checkpoint-issuer URL | verify, audit | Identity issuer of the checkpoint signer. |
--boot-identity ID | verify, audit | Who enters gateway boot attestations in the transparency log, given with --boot-issuer. Without it the key epoch a checkpoint proof carries is not believed. |
--boot-issuer URL | verify, audit | Identity issuer of the boot attestation signer. |
--now SECONDS | verify, attest, releases, audit | Verify as of this time (Unix seconds; default: the clock). |
--gateway URL | verify, attest, audit | Where to fetch the receipt and the attestation from (default https://api.panward.ai). |
--site URL | verify, attest, releases, audit | Where to fetch the release file from (default https://panward.ai/api). |
--json | verify, attest, audit, releases | Print the report as JSON. |
--archived FILE|ID | attest | attest only: check an archived attestation document, named by file or by attestation id. |
--evidence DIR | audit | audit only: the directory of archived upstream evidence. |
What Warden sends#
Warden never sends request or response content anywhere: the bytes you give it with --request and --response are hashed in its own process. Its network calls are GET requests for public attestation material from the gateway host, the release file from the site, collateral from the hardware vendor's public service, and, when you give a receipt id, your own receipt, with your key.
Offline use#
With --offline Warden makes no network call. Give it the receipt, the attestation document, the collateral for its quote and the release file as files. To verify an old receipt, use the archived attestation document that the receipt names in gateway.attestation_id.
$ warden verify receipt.json \ --request request.json --response response.bin \ --attestation archived --attestation-file attestation.json \ --collateral collateral.json --releases releases.json --offline
The release file is GET /public/releases on the site, which is not served yet, so for now a release file always has to be given with --releases.