Abstract
In some applications require an audit trail of changed configurations. Once the audit_trail.sh script is loaded and started it takes a snapshot of the current configuration files. After every load from the Sixnet I/O Tool Kit the script compares the configuration files to the snapshots. The sysinfod modification starts the audit_trail.sh script on startup. The definition of the configuration files at the end defines what configurations were changed.
Products
ST-IPm-8460
VT-mIPm-248-D
VT-mIPm-138-D
Use Case: Logging when and which files are modified after a tool kit load
Required Software
Sixnet I/O Tool Kit 5.0.101 or later
Industrial Controller firmware 7.0.101 or later
How audit_trail.sh script works
When audit_trail.sh first starts up on the first hard reset will grab a snapshot of relevant configuration files in the /etc/stacfg. The snap shots are stored in /val/lib/audit_trail_snapshots/audit_trail.snapshot. When a load from the tool kit is sent the script will compare the snapshots with files currently in the station. If there are changes the script will replace the existing snapshots and add an update to /var/log/audit_trail.log indicating which files were modified.
Add startup script sysinfod and audit_trail.sh to files to load
- In the Tool Kit go to Configure>Configure Station/Module>Files to Load Tab
- Add the sysinfod file from this technical note. It has the line to start audit_trail.sh on startup. Select “Copy files to the station.” “Load as (destination)” must be /etc/init.d/sysinfod.
- Add the audit_trail.sh file from this technical note. Select “Copy files to the station.” “Load as (destination)” must be /usr/local/bin/audit_trail.sh.
- Click on each file in the files to load tab. Change the permissions to -rwxr-xr-x or octal 755.
- To load the file to the station go to Operations>Load>Load Advanced. Select only the user files. Clock the load button. After the load is complete cycle power to the Industrial Controller.
How to read /var/log/audit_trail.log
- The /var/log/audit_trail.log will include date stamp, that the filed was modified and the name of the file. When the log indicates the file was modified it means the configuration associated with that file.
Configuration File Definition
The explanation below describes what configuration setting are associated with the files below.
- /etc/stacfg/action.6tl – peer to peer transfer configuration. Configured in the I/O Transfer tab of the station configuration.
- /etc/stacfg/modbus.config – Starting modbus addresses for Floating In/Outs, Long Ins/Outs, Short Ins/Outs. Configured in the Advanced tab of the station configuration.
- /etc/stacfg/portS0.config – RS232 Port B configuration parameters including protocol, baud rate, data bits and parities.
- /etc/stacfg/portS1.config – RS232 Port D configuration parameters including protocol, baud rate, data bits and parities.
- /etc/stacfg/portS2.config – RS232 Port A configuration parameters including protocol, baud rate, data bits and parities.
- /etc/stacfg/portS3.config – RS232 Port C configuration parameters including protocol, baud rate, data bits and parities.
- /etc/stacfg/regalloc.config – Contains I/O register allocation information. Configured in the Advanced tab of the station configuration.
- /etc/stacfg/ringmon.config – Ring switch monitoring configuration. Configured in the Ethernet port configuration>Advanced.
- /etc/stacfg/soeconfig.txt – SoE module configuration. Configured in the SoE Module configuration.
- /etc/stacfg/general.config – Advanced Properties configuration. Configured in the lower half of the Advanced tab of the station configuration.
- /etc/stacfg/porteth0.config – Ethernet port 1 configuration parameters including IP address, subnet, passthru and dhcp settings.
- /etc/stacfg/porteth1.config – Ethernet port 2 configuration parameters including IP address, subnet, passthru and dhcp settings.
- /etc/stacfg/alarm.config – Alarm configuration. Configured in the General>Configure Alarms of the station configuration.
- /etc/stacfg/users – user configuration. Configured in the General>Configure Users of the station configuration.