# Trusted GNSS-Based Time Synchronization for Industry 4.0 Applications
## 4 Trusted Computing
### Integrity Measurement Architecture (IMA)
First, we retrieve the Process ID (PID) of the running pptpd daemon by watching the content of its status log file, then we overwrite the original configuration file with a maliciously modified version and,finally, we send the appropriate signal (i.e., SIGHUP) to pptd in order to force it to reload its configuration file:

pi@raspberrypi:-/$ watch -n 1 cat /var/log/ptpd2.status.log pi@raspberrypi:-/$ sudo cp -/PTPd/ptpd2.slave.offset.conf -/PTPd/ptpd2.slave.conf pi@raspberrypi:-/$ sudo kill - SIGHUP ->PID>

As in previous attack, these commands trigger new IMA measurements, as follows:

10 e78 bb133849e4e54d8e242b87b13e8 ba14 ima bftzc4854 ad0 cf538387d1543 hae10842 ef80341 /usr/bin/watch
10 06f51 ba1 ee432001a384e905304e203812 eus ima 3 fd7498421b4e7807d154156069e8 befc72b561 /home/pi/PTPd/ptpd2.slave.offset.conf
10 fcd5 aa91 idade87d504791608d744336056a ima15 ad3952012b48b7768070647b406080e4 /bin/xii
10 def7b1554c31101b87b1 ad9537e46545659a705 ima4794842b1 cfc7074154156069e8 befc72b561 /home/pi/PTPd/ptpd2.slave.conf

In this case, the attack is detectable by comparing the digest of the configuration file in the IMA log with the previous value stored in the whitelist. It is worth clarifying that, for both attacks, the detection by the Attestor can have a potential delay with respect to the actual attack initiation. Such a delay depends on the given periodicity at which the Atestor contacts the nodes to attest/verify the integrity of their software and configuration: a frequent execution of such Remote Attestation protocol allows a rapid detection of an ongoing attack, but it comes at the price of an increased computational load and network overhead. In this sense, the periodicity of the attestation procedure represents an important design parameter to be tailored to each use case in Industry 4.0 applications, trading-off security versus complexity. ## 7 Conclusions

This paper has provided a complete analysis of the possible attack vectors to a GNSS-based Time Distribution Network, shedding light on the importance of deploying a software integrity architecture in Industry 4.0 applications. We have proposed and demonstrated a Trusted Computing implementation for embedded devices, together with a real-world option to make a flexible and scalable testbed for further exploration of threats and vulnerabilities due to the combination of diverse attack vectors. Both authors have contributed equally to this work. Both authors have read and agreed to the published version of the manuscript. This work was developed within the ROOT project (www.gnss-root.eu, accessed on 6 September 2021), funded by the European GNSS Agency under the European Union's Horizon 2020-G.A. n. 101004261. **Insuitional Review Board Statement**: Not applicable. **Informed Consent Statement**: Not applicable. **Data Availability Statement**: No data available online. For further query please contact the corresponding author. **Acknowledgments**: The authors would like to thank [PERSON] for the technical support provided during the initial part of this work, all the partners of the ROOT project for their useful suggestions and, finally, the reviewers whose comments helped to improve and clarify this manuscript. **Conflicts of Interest**: The authors declare no conflict of interest. ## Appendix A

_Appendix A.1. Default IMA Policy_

The default IMA policy for the measurement, called ima_tcb, is the following:

dont_measure fsmagic=PROC_SUPER_MAGIC

dont_measure fsmagic=SYSFS_MAGIC

dont_measure fsmagic=DEBUGFS_MAGIC

dont_measure fsmagic=TMPFS_MAGIC

dont_measure fsmagic=SECURITYFS_MAGICdont_measure fsmagic=SELINUX_MAGIC  measure func=BPRM_CHECK  measure func=FILE_MMAP mask=MAY_EXEC  measure func=PATH_CHECK mask=MAY_READ uid=0 and instructs IMA to measure all files loaded for execution and all files read under the user account root, with the exclusion of all special file systems. Files that get modified during OS run-time are re-measured by IMA and can appear multiple times in the IMA log with different measurements.