Code Revisions

The Code Revision tab (for Controllers only) shows the various versions of the controller's code that were captured by OT Security “snapshots”. Each "snapshot" version includes information about the code revision at the time that the "snapshot" was taken, including details about specific sections (code blocks/rungs) and tags. Whenever a "snapshot" isn't identical to the previous "snapshot" of that controller, a new Version of the code revision is created. You can compare between versions to see what changes were made to the controller code.

A snapshot can be triggered in the following ways:

  • Routine – snapshots are taken at regular intervals, as set by the user in the system settings screen.

  • Activity Triggered – the system triggers a snapshot when a particular code activity is detected (for example a code download).

  • User Initiated – the user can manually trigger a snapshot by clicking the Take Snapshot button for a specific asset.

You can configure a “Snapshot Mismatch” Policy to detect additions, deletions, or changes made to a controller’s code, see Configuration Event — Controller Activities Event Types.

The following sections describe the various sections of the Code Revision display as well as how to compare different "snapshot" versions.

Version Selection Pane

This pane shows a list of all available versions of the code revision for this controller. For each version the Start time that the version is known to have been in place is displayed. A new version is created each time that a change is detected from the previous "snapshot". The "Baseline" tag indicates which version is currently set as the baseline version for the purpose of comparison. Select a version to show its code revisions in the Snapshot Details pane.

Snapshot Details Pane

The details pane shows detailed information about the specific code blocks, rungs and tags for the selected snapshot version. The code elements are displayed in a tree structure with arrows for expanding/minimizing the details shown. For each element, the name, size, and date compiled are shown. You can compare the selected version to the previous version or to the "baseline" version to see what changes were made, see Compare Snapshot Versions.

Version History Pane

This pane shows details about the "snapshot" that captured the selected version, including the method by which it was initiated as well as the date and time that it was captured.

If no changes were made between snapshots, then several snapshots are grouped together as a single version. All the identical snapshots are listed in the Snapshot History pane for that version.

Compare Snapshot Versions

You can compare a Snapshot version either to the previous version or to the baseline version. Once a comparison has been run, the Snapshot Details pane shows the changes that were made to the controller's code between the two snapshots.

Changes are marked in the following manner:

Added – new code that was added in the selected version.

Deleted – code that was deleted from the selected version.

Edited – code that was edited in the selected version.

To compare a snapshot version to the previous version:

  1. On the Inventory > Controllers screen, select the desired controller.

  2. Click on the Code Revision tab.

  3. In the Version Selection pane, select the version that you would like to analyze.

  4. At the top of the Snapshot Details pane, in the comparison field, select Previous Version from the dropdown menu.

  5. Click the Compare to checkbox.

    The Snapshot Details pane shows all differences between the two versions. For each change, an icon indicates the type of change that occurred.

 

To compare a snapshot version to an earlier version (other than the previous version):

  1. On the Inventory > Controllers screen, select the desired controller.

  2. Click on the Code Revision tab.

  3. In the Version Selection pane, select the version that you would like to use as the baseline for comparison.

  4. In the top of the Snapshot Details pane, click Set Version as Baseline.

    The Baseline tag is shown for the selected version, indicating that it is set as the baseline version.

    Note: Setting a version as the baseline affects only comparisons made using this screen. It does not affect Policies that check for Snapshot Mismatch.
  5. In the Version Selection pane, select the version that you would like to compare to the baseline.

  6. Click the Compare to checkbox. In the field next to the Compare to checkbox, select Baseline Version from the dropdown menu.

  7. The Snapshot Details pane shows all differences between the two versions. For each change, an icon indicates the type of change that occurred.

Create a Snapshot

A snapshot can be initiated manually by the user. For example, it is recommended to perform a snapshot before and after a technician services a controller.

To create a snapshot of a controller:

  1. On the Inventory > Controllers screen, select the desired controller.

  2. Click on the Code Revision tab.

  3. In the upper right-hand corner of the Snapshot Details pane, click Take Snapshot.

    The User Initiated Snapshot is created.

  4. If no changes are identified, then a new User Identified Snapshot is added to the Revision History pane for the latest version. If changes are identified, then a new version is created showing the code revision changes.