Run the Audit
This procedure audits all areas and contests of one tally with one command. The auditor does it. The command runs the audit image with the backups directory and the output directory.
The command does these steps:
- It checks the digest of each backup. It stops if a digest is missing or different.
- It restores the backups into copies inside the container, with the read-only account
ballot_audit_reader. It gives the ImmuDB copy a new admin password, so you do not need the password of the source. - It starts the B3 server on the B3 copy.
- It runs
audit-tally.audit-tallymakes one scope for each area and contest of the tally, exports the evidence, prepares and audits each scope, checks the cast-vote history of each election and runs the Braid verifier. - It writes the results to the output directory and stops. The copies are removed.
The container has no network. The copies can connect only to each other.
audit-tally calculates the pin of each file that it writes and gives it to the next step. It
records all pins in audit-record.json. The digest of audit-record.json protects all of them.
Before you start
- You did Prepare the Backups.
AUDIT_IMAGEis set. See Set Up the Audit Workstation.- You have these three values from the election authority, through a trusted channel that is not
the backups:
- The tally ID.
- The public key hash: the SHA-512 digest of the election public key on the bulletin board, in 128 lowercase hexadecimal characters.
- The electoral log system public key: DER/SPKI, encoded in standard base64.
- The directory
~/audit/outputis empty.
1. Set the trusted values
-
Set the three values from the election authority:
export TALLY_SESSION_ID=<tally ID>
export PUBLIC_KEY_SHA512=<public key hash>
export ELECTORAL_LOG_SYSTEM_PUBLIC_KEY=<electoral log system public key> -
Write the three values in the audit notes.
Expected result: the three variables are set. The audit notes contain the three values.
2. Run the audit
-
Run the audit:
docker run --rm --network none \
-v ~/audit/backups:/backups:ro -v ~/audit/output:/output "$AUDIT_IMAGE" \
--tally-session-id "$TALLY_SESSION_ID" \
--public-key-sha512 "$PUBLIC_KEY_SHA512" \
--electoral-log-system-public-key "$ELECTORAL_LOG_SYSTEM_PUBLIC_KEY"
The command runs the steps one after the other. A large tally can take a long time.
Expected result: the command shows SHA-512 matches for each backup, the copies are ready, one line for each scope, the overall status, the digest of the audit record and, in the
last line, the exit status:
scopes/001: election <ID> area <ID> contest <ID>: Success
scopes/002: election <ID> area <ID> contest all: Success
Overall: Success
audit-record.json SHA-512: <digest>
ballot-audit: exit status 0 (all steps passed)
contest all is a scope whose ballots encrypt all contests together.
3. Read the results
-
If the command shows
WARNING: pg_restore reported ... error(s), read the log that the warning names in~/audit/output/restore. Write each error in the audit notes. -
Read the exit status in the last line of the command:
Exit status Meaning 0All steps passed. 1A step found a contradiction, or the command stopped before the audit. Read the message. 3Evidence is missing, or a step did not run. The audit is incomplete. 4An input was refused. -
Open
~/audit/output/public-summary.json. Readstatus, thestatusof each scope, of eachcast_vote_historyentry and ofbraid. -
For each status that is not
success, open~/audit/output/audit-record.json. Find the steps of that scope or election insteps. Read theirexit_codeandmessage. -
Find each message in Troubleshooting.
-
Write the overall status and the status of each scope in the audit notes.
A step with the status not_run did not run because an earlier step did not pass. Correct the
cause of the first step that did not pass, then run the audit again with a new, empty output
directory.
See Read the Results for all statuses.
Expected result: you know the status of each scope, of each election history and of the Braid verifier.
4. Record the digest of the audit record
-
Calculate the digest of the audit record:
shasum -a 512 ~/audit/output/audit-record.json -
Compare it with the digest that the command showed.
-
Write the digest in the audit notes.
-
Ask a second person to make sure that the digest in the audit notes is the digest of the file. Then ask the person to sign the audit notes.
Expected result: the audit notes have the digest of the audit record and a second signature.
If there is a problem
| Problem | Action |
|---|---|
backup digest mismatch: backups/...; do not restore it | Stop. Do not use the backup. Tell the election authority. |
the output directory is not empty; use a new one | Use a new, empty output directory. Do not delete evidence that you need. |
missing backup: backups/... or no digest for ... in backup-digests.txt | Put the backup in ~/audit/backups with its file name, and its digest in the digests file. See Prepare the Backups. |
... did not start | The command shows the end of the log. Read the logs in ~/audit/output/restore. |
Exit status 3, expected exactly one tally session row, found none | The tally ID is wrong, or the backup is from before the tally. Check the tally ID with the election authority. |
| You must repeat or examine one step. | Use Run Each Step Separately. |
See Troubleshooting for all messages.