## 4 Designing a Digital Twin for the Factory of the Future
### Fostering FoF Resilience  
The analysis of the state of the art in Section 2 suggests that progress in DTs and CRs will soon lead to a point of convergence at the intersection between cyber-physical equipment and manufacturing network [49]. However, no known attempt to perform also security tests and simulation in a DT has yet been reported. DTs to date do not provide any simulation to support the understanding of effects of a cyber-incident affecting the represented system in its physical and logical dimensions [93]. This is a very interesting and important point of research since it would give a new dimension to DTs, enabling to support cybersecurity design, training and simulation targeting industrial environments. DTs effectively support applications for safety, taking benefit of their ability to compare actual behavior of machines with normal patterns. Application for security essentially requires further analysis of incident root cause and qualification as intentional or non-intentional [47]. Such analysis could be done based on traces which can be retrieved on the network. In a context where manufacturing automation grows ever more connected and autonomous, the qualification of anomalies either as attacks or incidents becomes more than a secondary detail. In the case of a safety problem, the response is essentially about activating fail safe mode, finding and fixing the issue and bringing the system back to service. In the case of a security problem, one must anticipate the possible next actions of the attacker and prevent them in a predictive way, while identifying the best solution to remediate and recover from already caused damages. Fail-safe and fail-secure in many ways can be antagonist principles [139]. CRs have been developed, primarily used in cyber-defense with a focus on network and information security [104]. A handful of cyber-range editors are currently in the process of adapting their CR to the needs of OT networks and Industrial Control System (ICS) security. In short, while DTs aim to increasingly address the IT layer of Cyber-Physical Systems (CPS), CRs aim to more accurately simulate the physical processes which lie underneath OT networks [109; 110; 112]. By bridging the formidable performance of DTs in application to safety with the unmatched relevance of CRs in  
Figure 6: Optimization using the Digital Twin. application to security, the CyberFactory#1 project enables to address the growing issue of security for safety in application to manufacturing. Just as CRs can be informative to DTs about the origin and nature (intentional/accidental) of a detected anomaly, DTs can be informative to CRs about the chain of impacts of a particular incident on the manufacturing process [49]. Such information is extremely valuable when it comes to selecting the best set of countermeasures and defining an optimal response plan. It is of upmost importance for economic actors, such as factory owners, to minimize attack and response cost, including physical damages, potential casualties and indirect impacts on business, intellectual property or reputation. In short, while DTs inform about physical processes, CRs inform about network traffic, bridging the gap between physical and digital layers. Now, to give the complete picture, further developments are required to better include human behavioral aspects, both in the physical world and on the network. The use of cognitive AI is of certain support to fill this gap. DTs, through high-fidelity models and advanced machine learning abilities, can capture tacit knowledge by observation of human operators, identify deviations from expected behavior and raise meaningful alerts with consideration for safety and/or security. Most of the published work related to DT is in representing entities such as machines, production lines, robots, etc. Fewer works also try to model human behavior, but the focus in these cases are in modeling and simulating human processes by mean of digital manikins [35; 140].