# Logging

All VxSuite applications use the same framework to log user actions, application processes, and errors. The logs are persisted to disk and can be exported by election managers or system administrators.

## Application Log Events

VxSuite applications use a [shared logging library](https://github.com/votingworks/vxsuite/tree/v4.0.2/libs/logging) to capture required or otherwise important application log events. The core metadata for each application log event maps roughly to VVSG 2.0 standards, with some additional fields:

* **Log Event ID** - The unique identifier for each event. The full list of log event IDs with descriptions is included in the automatically generated log [documentation](https://github.com/votingworks/docs-vxsuite-v4/blob/main/software-docs/VotingWorksLoggingDocumentation.md).
* **Log Event Type** - Describes whether the event involves an action or a status update, and whether it originated with a user, the application, or the larger system. Log event types can be thought of as categories whereas log event IDs are more specific. Every log event type includes many log event IDs under it. The full list of log event types with descriptions is included in the automatically generated log [documentation](https://github.com/votingworks/docs-vxsuite-v4/blob/main/software-docs/VotingWorksLoggingDocumentation.md).
* **User** - If there was an authenticated user role at the time of a user action, describes the role as `system_administrator`, `election_manager`, `poll_worker` or `vendor`. If no user was authenticated, then `unknown`. If event does not originate from the user but rather automatically from the application or operating system, it will be `system`.
* **Disposition** - For actions that can fail or succeed, `success` or `failure`. Otherwise `na` for not applicable.
* **Source** - Indicates where in the system's architecture the log came from, whether it be the frontend renderer, the frontend server, the backend server, a hardware daemon, or the operating system.
* **Message** - The log message itself, which may not be present if the log event ID sufficiently describes the event.
* **Other Metadata** - Other metadata can be freely included. For example, if a user adds manual tallies on VxAdmin, the metadata of those manual tallies will be included in the logging.
* **Time Written** - Timestamp of when the log was created.

## Log Management

The shared logging library formats the log events as JSON and pushes them to application processes' `stdout`. All `stdout` output from the application processes - both the application log events and any process output - is sent to the system's `logger` utility and assigned the tag `votingworksapp`.

VxSuite uses `rsyslog`, an advanced implementation of the Syslog protocol, to centralize and manage logs from `votingworksapp` and other sources. `rsyslog` has advantages over the built-in Linux `syslog` implementation of the Syslog protocol, including JSON structured messages, advanced filtering, and increased performance. Using `rsyslog`, different types of logs are directed to different log files in `/var/log/votingworks/`:

<table><thead><tr><th width="172">Log File</th><th>Contents</th></tr></thead><tbody><tr><td><code>vx-logs.log</code></td><td><p>Key logs required by VVSG 2.0 or otherwise critical for understanding the behavior of the application or device, including:</p><ul><li>all application log events</li><li>USB device connection events</li><li>machine boot and shutdown events</li><li>all <code>sudo</code> actions</li><li>password events</li><li><code>dm-verity</code> events</li></ul></td></tr><tr><td><code>auth.log</code></td><td>All operating system authentication-related events. Note that this will not include voting system authentication events such as logging in with a smart card - these events are in <code>vx-logs.log</code></td></tr><tr><td><code>syslog</code></td><td>All other events emitted from the application or the operating system that do not fall into the other log files.</td></tr></tbody></table>

`vx-logs.log` is the most important and informative file in most cases. The other files rarely need to be referenced. All logs required by VVSG certification will exist in `vx-logs.log.`

Because each log file can grow very large, the application will rotate logs if necessary with the `logrotate` utility on each startup. Previous log files will be compressed and suffixed with a timestamp.

Including the various log files and log rotation, below is an example of the list of log files that might appear on a device:

<pre><code><strong>/var/log/votingworks/vx-logs.log
</strong><strong>/var/log/votingworks/vx-logs.log-20241104.gz
</strong>/var/log/votingworks/vx-logs.log-20241105.gz
/var/log/votingworks/auth.log
/var/log/votingworks/syslog
/var/log/votingworks/syslog-20241105.gz
</code></pre>

## Default VotingWorks Log Format

```json
{
    "timeLogWritten":"2024-11-05T15:51:51.246232-08:00",
    "host":"VotingWorks",
    "source":"vx-scan-backend",
    "eventId":"auth-login",
    "eventType":"user-action",
    "user":"poll_worker",
    "message":"User logged in.",
    "disposition":"success",
}
```

The default VotingWorks log format is how logs are formatted when emitted from the application and how they appear in `vx-logs.log`. It is a direct mapping of the[#application-log-events](#application-log-events "mention") fields.

## CDF Log Format

Logs can be exported in CDF format, in which case the `vx-logs.log` file is replaced by a `vx-logs.cdf.json` file with the logging attributes mapped as follows:

<table><thead><tr><th width="304">CDF Attribute</th><th></th></tr></thead><tbody><tr><td>ElectionEventLog.GeneratedTime</td><td>ISO formatted timestamp of when logs were exported</td></tr><tr><td>ElectionEventLog.Device</td><td>List containing only the current device</td></tr><tr><td>Device.Type</td><td><p>The CDF <code>DeviceType</code> matching the type of machine:</p><ul><li>VxAdmin -> "ems"</li><li>VxScan -> "scan-single"</li><li>VxCentralScan -> "scan-batch"</li><li>VxMarkScan -> "bmd"</li></ul></td></tr><tr><td>Device.Id</td><td>The serial number of the device</td></tr><tr><td>Device.Version</td><td>The software version e.g. "v3.1.2"</td></tr><tr><td>Device.Event</td><td>List of all events</td></tr><tr><td>Event.Id</td><td>A VotingWorks defined identifier for the type of event, such as "save-election-package-complete"</td></tr><tr><td>Event.Disposition</td><td>"success", "failure", "na", or "other"</td></tr><tr><td>Event.OtherDisposition</td><td>If the disposition is "other", the details appear here</td></tr><tr><td>Event.Sequence</td><td>The index of the log in the list of logs, zero-indexed</td></tr><tr><td>Event.TimeStamp</td><td>ISO formatted timestamp of when the event was logged</td></tr><tr><td>Event.Type</td><td>Log event type</td></tr><tr><td>Event.Description</td><td>Log message</td></tr><tr><td>Event.Details</td><td>JSON including the log source and any additional logging metadata</td></tr><tr><td>Event.UserId</td><td>The user at the time of the log</td></tr></tbody></table>

## Error Logs

The log export flow exposed in all VxSuite applications also allows for exporting an errors-only version of the logs. This will only export a log file for logs where the disposition is "failure" and covers all software and hardware errors that have occurred on the machine.

## 15.1-D Logging Event Types Table

A full list of all logs made in the system with a description of each one can be found [here](https://github.com/votingworks/docs-vxsuite-v4/blob/main/software-docs/VotingWorksLoggingDocumentation.md). For convenience a table is provided below mapping Table 15-1 from VVSG 2.0 Requirement 15.1-D to the appropriate logs in the VotingWorks system. The details and descriptions provided in Table 15-1 have been simplified for brevity in this table. Some items have been expanded into multiple rows to more precisely specify linked logs.

#### General System Functions

| System Event                                                          | Detail                                                                                                                                                                              | Logging Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Device generated error and exception messages                         | Entries into exception handling routines                                                                                                                                            | <p>Errors can be logged with any LogEventId but are indicated by a <code>failure</code> Disposition. All logs contain a Source. Every error is logged when it occurs, and each log can be assumed to correspond to one instance of that error occurring unless otherwise stated in the log.<br><br>Of particular note are logs with LogEventId <code>unknown-error</code>. These represent unexpected system errors, as opposed to user errors.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Device generated error and exception messages                         | Notifications of physical violations of security                                                                                                                                    | <p>VxMarkScan physical violations of security are covered by printer-scanner cover-open logs. These will have a LogEventId of <code>paper-handler-state-machine-transition</code> with a body <code>Transitioned to: "cover\_opened\_unauthorized"</code></p><p><br>The VxScan scanner cover is intended to be opened by poll workers for maintenance, so this does not constitute a physical violation of security. Nonetheless, logs are also emitted for this case. These will have a LogEventId of <code>scanner-state-machine-transition</code> with body <code>Transitioned to: "coverOpen"</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Device generated error and exception messages                         | Other exception events such as power failures, failure of critical hardware components, data transmission errors, or other types of operating anomalies                             | <p>On VxMarkScan, hardware failures are covered by logs with LogEventId <code>paper-handler-state-machine-transition</code> and body <code>Transitioned to: "no\_hardware"</code></p><p><br>On VxScan, hardware failures are covered by logs with LogEventId <code>scanner-state-machine-transition</code> and body <code>Transitioned to: "disconnected"</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Device generated error and exception messages                         | Recovery actions taken                                                                                                                                                              | <p>Recovery actions will vary for every error and can therefore map to any log. Recommended recovery actions for user-facing errors are documented in our user manual under the following pages:</p><p><a data-mention href="https://app.gitbook.com/s/JtZutzGTdCzsGITrdiph/vxadmin-system-setup/vxadmin-error-messages">VxAdmin Error Messages</a></p><p><a data-mention href="https://app.gitbook.com/s/JtZutzGTdCzsGITrdiph/vxcentralscan/vxcentralscan-error-messages">VxCentralScan Error Messages</a></p><p><a data-mention href="https://app.gitbook.com/s/JtZutzGTdCzsGITrdiph/vxmarkscan/vxmarkscan-error-messages">VxMarkScan Error Messages</a><br><a data-mention href="https://app.gitbook.com/s/JtZutzGTdCzsGITrdiph/vxscan/vxscan-error-messages">VxScan Error Messages</a></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Critical system status messages                                       | Diagnostic and status messages upon startup                                                                                                                                         | <p><code>machine-boot-init</code><br><code>machine-boot-complete</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Critical system status messages                                       | The "zero totals" check                                                                                                                                                             | <p><code>polls-opened</code><br><code>toggled-test-mode</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Critical system status messages                                       | The initiation or termination of scanner and communications equipment operation                                                                                                     | <p><code>scanner-state-machine-event</code></p><p><code>scanner-state-machine-transition</code></p><p><code>mark-scan-state-machine-event</code></p><p><code>paper-handler-state-machine-transition</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Critical system status messages                                       | Printer errors                                                                                                                                                                      | <p><code>printer-status-changed</code> and <code>printer-print-complete</code> with a <code>failure</code> Disposition cover VxScan.<br><br><code>paper-handler-state-machine-transition</code> covers VxMarkScan.<br><br>For the VxAdmin printer, we emit a <code>printer-config-added</code> log when VxAdmin successfully registers the printer as connected, and we emit a <code>printer-config-removed</code> log when VxAdmin registers the printer as disconnected. If the printer is connected but the last printer log is <code>printer-config-removed</code>, it can be inferred that there's a problem.</p><p></p><p>For the VxCentralScan imprinter, an <code>imprinter-status</code> log is emitted whenever paper scanning is initiated. The log indicates in its message whether or not the imprinter is registering as attached. It can be inferred that there's a problem if the imprinter is attached, but the log indicates that it is not attached. Note that the VxCentralScan Fujitsu scanner requires you to power cycle it after you either attach or detach the imprinter. If you detach the imprinter while the Fujitsu scanner is on, an indicator on the Fujitsu scanner screen will say that the imprinter cover is open. No scans are accepted in this state. You have to power cycle the Fujitsu scanner to dismiss the warning and renable scanning. After this is done, the logs will indicate on next scan that the imprinter is detached. Vice versa, if you attach the imprinter while the Fujitsu scanner is on, the device jams. It takes a power cycle to get it to register the imprinter attachment.</p> |
| Critical system status messages                                       | Detection or remediation of malware or other malicious software                                                                                                                     | <p>Malware or other malicious software is prevented from being added to VotingWorks systems via our <a href="software-security/system-integrity">System Integrity</a> design. Rather than using a traditional "allowlist" that is only applicable to malware, we create a system-wide hash of the expected system content. If anything changes, whether via malware or some other method, the system will no longer boot.<br><br>Failed cryptographic boot validation intentionally stops the boot process before logging processes can even spin up, so no log will be found in the log file for this case. A representative message will be displayed on screen, however, e.g., "Verity device detected corruption after activation."<br></p><p>If you encounter a failed cryptographic boot validation - since it may be indicative of malware - make note of the error message and reach out to VotingWorks.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Critical system status messages                                       | Cryptographic boot validation success/failure                                                                                                                                       | <p><code>dmverity-boot</code> with a <code>success</code> Disposition indicates successful cryptographic boot validation.<br><br>Failed cryptographic boot validation intentionally stops the boot process before logging processes can even spin up, so no log will be found in the log file for this case. A representative message will be displayed on screen, however, e.g., "Verity device detected corruption after activation."<br><br>If you encounter a failed cryptographic boot validation - since it may be indicative of malware - make note of the error message and reach out to VotingWorks.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Non-critical status messages                                          |                                                                                                                                                                                     | <p><code>device-attached</code><br><code>usb-device-change-detected</code><br><code>scanner-state-machine-event</code></p><p><code>scanner-state-machine-transition</code></p><p><code>mark-scan-state-machine-event</code></p><p><code>paper-handler-state-machine-transition</code><br><br>Various other logs. In the event of failure, please make note of the failure and reach out to VotingWorks.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Events that require election official intervention                    |                                                                                                                                                                                     | <p><code>device-unattached</code><br><code>scanner-state-machine-event</code></p><p><code>scanner-state-machine-transition</code></p><p><code>mark-scan-state-machine-event</code></p><p><code>paper-handler-state-machine-transition</code><br><code>auth-login</code><br><br>Various other logs</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Device shutdown and restarts                                          |                                                                                                                                                                                     | <p><code>machine-shutdown-init</code> indicates the start of a shutdown, and <code>machine-shutdown-complete</code> indicates the successful completion of a shutdown.<br><br>A restart will begin with the above two shutdown logs and then be followed by a <code>machine-boot-init</code> log, which indicates the start of a boot, and a <code>machine-boot-complete</code> log, which indicates the successful completion of a boot.<br><br>Abnormal shutdowns and restarts can take many forms in the logs.<br><br>A <code>machine-shutdown-init</code> log without a corresponding <code>machine-shutdown-complete</code> log indicates a failed shutdown or restart.<br><br>A <code>machine-boot-init</code> log without a corresponding <code>machine-boot-complete</code> log indicates a failed boot or restart.<br><br>Finally, a <code>machine-boot-init</code> log without a previous <code>machine-shutdown-complete</code> log indicates that the last shutdown was abnormal and likely the result of a loss of power rather than user-initiated.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Changes to system configuration settings                              |                                                                                                                                                                                     | It is not possible to change these configuration settings, and any attempt to do so will result in a `sudo-action` log.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Integrity checks for executables, configuration files, data, and logs |                                                                                                                                                                                     | <p>For election package configuration, a failed integrity check will result in an <code>election-configured</code> log with a <code>failure</code> Disposition and <code>Election package authentication erred</code> in the message.</p><p><br>For CVR import, a failed integrity check will result in an <code>import-cast-vote-records-complete</code> log with a <code>failure</code> Disposition and <code>authentication-error</code> in the error details.</p><p><br>All of the above logs, if seen with a <code>success</code> Disposition, indicate successful integrity checks.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| The addition and deletion of files                                    |                                                                                                                                                                                     | <p>The overwhelming majority of machine data is stored in a database, the creation and destruction of which are captured in <code>database-create-complete</code> and <code>database-reset-complete</code> logs.</p><p><br>The only other files stored on the file system are scan images on VxCentralScan and VxScan. On VxCentralScan, scan image file creations pair with <code>scan-sheet-complete</code> logs, and scan image file deletions (without a complete unconfiguration) pair with <code>clear-ballot-data-complete</code> and <code>delete-cvr-batch-complete</code>. On VxScan, scan image file creations pair with <code>scanner-state-machine-transition</code> logs, where the body includes <code>Transitioned to: "interpreting"</code>, and scan image file deletions (without a complete unconfiguration) pair with <code>toggled-test-mode</code> logs.</p><p><br>On all machines, user-triggered exports of reports and logs to USB drives pair with <code>file-saved</code> logs. We don't expose functionality to delete these files individually. They can be cleared by formatting the USB drive, however, for which a <code>usb-drive-format-complete</code> log will be emitted.</p>                                                                                                                                                                                                                                                                                                                                                                                                                               |
| System readiness results                                              | System pass or fail of hardware and software test for system readiness                                                                                                              | <p><code>diagnostic-init</code><br><code>diagnostic-complete</code><br><code>election-configured</code><br><code>polls-opened</code><br><code>toggled-test-mode</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| System readiness results                                              | Identification of the software release, identification of the election to be processed, polling place identification, and the results of the software and hardware diagnostic tests | <p>The software release can be verified using <a data-mention href="../system-overview/signed-hash-validation">signed-hash-validation</a>, for which a <code>signed-hash-validation-complete</code> log will be emitted.<br><br>The election, specifically ballot hash, can be found in the <code>election-configured</code> log.<br><br>The polling place can be found in the <code>polls-opened</code> log as well as the <code>precinct-configuration-changed</code> log if a change was made from the default selection.<br><br>The results of software and hardware diagnostic tests can be found in <code>diagnostic-complete</code> logs.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| System readiness results                                              | Pass or fail of ballot style compatibility and integrity test                                                                                                                       | The `election-configured` log with a `success` Disposition indicates a pass. That log with a `failure` Disposition indicates a fail. More on integrity checks a few rows up in this table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| System readiness results                                              | Pass or fail of system test data removal                                                                                                                                            | <p>On all machines other than VxAdmin, the <code>toggled-test-mode</code> log with a <code>success</code> Disposition indicates a pass. There is no expected circumstance under which a <code>toggled-test-mode</code> log with a <code>failure</code> Disposition will be emitted. If such an error were to occur, the system would surface an error screen indicating an abnormal/unexpected error. VxCentralScan does disallow switching from official mode to test mode if ballots have been scanned and corresponding CVRs have not yet been exported, but this is accomplished by completely disabling the toggle.<br><br>On VxAdmin, the <code>clear-imported-cast-vote-records-complete</code> log with a <code>success</code> Disposition indicates a pass. There is no expected circumstance under which a <code>clear-imported-cast-vote-records</code> log with a <code>failure</code> Disposition will be emitted. If such an error were to occur, the system would surface an error screen indicating an abnormal/unexpected error.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| System readiness results                                              | Zero totals of data paths and memory locations for vote recording                                                                                                                   | <p>On VxScan, the <code>polls-opened</code> log with a <code>success</code> Disposition indicates a pass.<br><br>A <code>polls-opened</code> log with a <code>failure</code> Disposition and <code>User prevented from opening polls because ballots have already been scanned</code> in the body would hypothetically indicate a fail, but this log cannot actually be emitted in practice as we prevent any ballot scanning until polls have been opened.<br><br>On VxAdmin and VxCentralScan, a <code>data-check-on-startup</code> log indicates in its message whether election results or scanned ballot data are present in the database at machine startup.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Removable media events                                                |                                                                                                                                                                                     | `usb-device-change-detected`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Backup and restore                                                    |                                                                                                                                                                                     | <p>On VxCentralScan and VxScan, full CVR exports serve as backups. These pair with <code>cast-vote-records-complete</code> logs. This data is not, however, intended to be loaded back onto VxCentralScan and VxScan, so there is not an equivalent restore operation. Because VxMarkScan does not tabulate, there are no CVRs on it to backup.</p><p>On all machines, user-triggered exports of reports and logs to USB drives pair with <code>file-saved</code> logs. This data is also not meant to be loaded back into the system.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

#### Authentication and Access Control

| System Event                                          | Detail                                                                                                                     | Logging Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Authentication related events                         | Login/logoff events                                                                                                        | <p><code>auth-login</code><br><code>auth-logout</code><br><code>auth-pin-entry</code></p>                                                                                                                                                                                                                                                                                                                                                                                         |
|                                                       | Account lockout events                                                                                                     | <p><code>auth-pin-entry-lockout</code><br><br><code>auth-logout</code> where the log's <code>reason</code> field contains <code>session\_expired</code> on VxMarkScan and VxScan, and <code>machine\_locked\_by\_session\_expiry</code> on VxAdmin and VxCentralScan</p>                                                                                                                                                                                                          |
|                                                       | Password changes                                                                                                           | <p><code>smart-card-program-complete</code> covers all smart card PIN changes.<br><br>For the vendor menu, accessed via a vendor smart card with a PIN and then additionally gated by a vendor password, changing the latter password results in a<br><code>password-change</code> log.</p>                                                                                                                                                                                       |
| Access control related events                         | <p>Use of privileges (such as a user running a process<br>as an administrator)</p>                                         | `sudo-action`                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Access control related events                         | Attempts to exceed privileges                                                                                              | `sudo-action` with a message indicating that the action was disallowed                                                                                                                                                                                                                                                                                                                                                                                                            |
| Access control related events                         | <p>All access attempts to application and underlying<br>system resources</p>                                               | To access underlying system resources, one would need to either break out of kiosk mode (which is not possible) or have access to a vendor card and its PIN. One would then need to use sudo. As such, a `sudo-action` log would be emitted.                                                                                                                                                                                                                                      |
| Access control related events                         | <p>Changes to the access control configuration of the<br>voting device</p>                                                 | The access control configuration is controlled by the system settings file within the election package. As such, the access control configuration can only be changed by reconfiguring with a new election package. This emits an `election-configured` log.                                                                                                                                                                                                                      |
| User account and role (or groups) management activity | Addition and deletion of user accounts and roles                                                                           | <p>New users are created by programming smart cards, for which a <code>smart-card-program-complete</code> log is emitted.</p><p>Users can be "deleted" by unprogramming smart cards, for which a <code>smart-card-unprogram-complete</code> log is emitted.</p>                                                                                                                                                                                                                   |
| User account and role (or groups) management activity | User account and role suspension and reactivation                                                                          | As noted above, `smart-card-program-complete` and `smart-card-unprogram-complete` cover this.                                                                                                                                                                                                                                                                                                                                                                                     |
| User account and role (or groups) management activity | Changes to account or role security attributes such as password length, access levels, login restrictions, and permissions | Security settings are controlled by the system settings file within the election package. As such, security settings can only be changed by reconfiguring with a new election package. This emits an `election-configured` log.                                                                                                                                                                                                                                                   |
| User account and role (or groups) management activity | Administrator account and role password resets                                                                             | <p>The system administrator role is itself smart card authenticated, and password changes are accomplished by reprogramming, so <code>smart-card-program-complete</code> covers this.<br><br>For the vendor menu, accessed via a vendor smart card with a PIN and then additionally gated by a vendor password, changing the latter password results in a<br><code>password-change</code> log. All other substantive vendor actions result in a <code>sudo-action</code> log.</p> |

#### Networking

| System Event                                   | Logging Details                                                                                                                                                      |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enabling or disabling networking functionality | It is not possible to enable wired or wireless networking. Any attempt to bypass protections in place blocking this will result in an error and a `sudo-action` log. |

#### Software

| System Event                                                               | Detail                                                                                                                                                                                                      | Logging Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Installing, upgrading, patching, or modifying software or firmware         |                                                                                                                                                                                                             | <p>Because we update software by completely reimaging machines, all logs prior to updating are cleared. We procedurally make sure that logs are exported before beginning a software update.<br><br>A <code>sudo-action</code> log that references an <code>expand-var-filesystem.sh</code> command is indicative of a freshly imaged/updated machine.<br><br>The software version/hash, both before and after update, can be verified using <a data-mention href="../system-overview/signed-hash-validation">signed-hash-validation</a>, for which a <code>signed-hash-validation-complete</code> log will be emitted.<br><br>The software version/hash is also logged on every boot in a subset of the <code>dmverity-boot</code> logs. Searching for <code>verity.hash</code> in the vx-logs.log file will help you hone in on these logs.</p> |
| Changes to configuration settings                                          | Changes to critical function settings, including location of election definition file, contents of the election definition file, vote reporting, location of logs, and voting device configuration settings | <p>The location of the election definition and logs cannot be changed; both are stored in static locations. Changes to the contents of the election definition pair with <code>election-configured</code> and <code>election-unconfigured</code> logs.<br><br>The are no controls outside of election definition configuration that affect how votes are reported.<br><br>Other voting device configuration settings are covered by <code>continuous-export-toggled</code>, <code>double-sheet-toggled</code>, <code>sound-toggled</code>, and <code>toggled-test-mode</code> logs.</p>                                                                                                                                                                                                                                                           |
| Changes to configuration settings                                          | Changes to device settings including, but not limited to, enabling and disabling services                                                                                                                   | As noted above, device settings are covered by `continuous-export-toggled`, `double-sheet-toggled`, `sound-toggled`, and `toggled-test-mode` logs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Changes to configuration settings                                          | Starting and stopping processes                                                                                                                                                                             | <p>For lower-level hardware daemons run in a separate process, we have <code>process-started</code> and <code>process-terminated</code> logs. The only machine that currently runs a lower-level hardware daemon in a separate process is VxMarkScan for the accessible controller and PAT input.<br><br>The only known circumstance under which a <code>process-terminated</code> log can be emitted is during VxMarkScan electrical testing. Shocking the PAT input with an ESD pulse can cause the hardware daemon to terminate and restart.</p>                                                                                                                                                                                                                                                                                               |
| Abnormal process exits                                                     |                                                                                                                                                                                                             | <p><code>unknown-error</code><br><br>There is no expected circumstance under which a process will exit abnormally. If such an error were to occur, the system would surface an error screen indicating an abnormal/unexpected error.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Successful and failed database connection attempts (if a database is used) |                                                                                                                                                                                                             | <p><code>database-connect-init</code><br><code>database-connect-complete</code><br><br>There is no expected circumstance under which a database connection attempt will fail. If such an error were to occur, the system would surface an error screen indicating an abnormal/unexpected error.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Changes to cryptographic keys                                              |                                                                                                                                                                                                             | A machine TPM key is created during initial configuration by VotingWorks after software imaging. This operation pairs with a `sudo-action` log that references a `generate-key.sh` command. No additional keys can be added, nor can this key be deleted. The key can however be changed by VotingWorks, via use of a vendor smart card. The change will also show up in the logs as a `sudo-action` that references the `generate-key.sh` command.                                                                                                                                                                                                                                                                                                                                                                                               |

#### Voting Functions

| System Event                       | Detail                                                     | Logging Details                                                                                                                                                                                                                                                                                                      |
| ---------------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Ballot definition and modification |                                                            | <p><code>election-configured</code></p><p><code>election-unconfigured</code></p>                                                                                                                                                                                                                                     |
| Voting events                      | Opening and closing polls                                  | <p><code>polls-opened</code></p><p><code>polls-closed</code></p><p><code>voting-paused</code></p><p><code>voting-resumed</code></p><p><code>reset-polls-to-paused</code><br><br>These logging events are the internal tests that verify that the prescribed closing or suspension procedures have been followed.</p> |
| Voting events                      | Casting a vote                                             | <p>VxMarkScan: <code>vote-cast</code><br><br>VxScan: <code>scanner-state-machine-event</code> with the event <code>scanStart</code> to indicate the voter has started feeding a ballot. If the voter has to cast from adjudication there will be an <code>accept</code> event.</p>                                   |
| Voting events                      | Canceling a vote during verification                       | <p>VxMarkScan: <code>ballot-invalidated</code><br><br>VxScan: <code>scanner-state-machine-event</code> with event <code>reject</code></p>                                                                                                                                                                            |
| Voting events                      | Success or failure of log and election results exportation | <p><code>export-cast-vote-record-complete</code><br><code>file-saved</code></p>                                                                                                                                                                                                                                      |
