Debian Codegraph @

Documentation/security.rst

raw
1 .. SPDX-License-Identifier: BSD-2-Clause
2 ..
3 .. Copyright (C) 2025 Linutronix GmbH
4 .. Author Kurt Kanzenbach <[email protected]>
5 ..
6 .. Testbench documentation security file.
7 ..
8
9 Security
10 ========
11
12 Motivation
13 ----------
14
15 Driven by legal requirements like EU Cyber Resilience Act (CRA), security for industrial
16 communication systems is more and more playing a crucial role. The RTC ``Testbench`` can also be
17 used to measure and optimize the performance of a particular security implementation for
18 authentication and/or encryption of each processed frame.
19
20 The RTC ``Testbench`` demonstrates one exemplary Profinet security implementation. The Profinet
21 security specification is still under development. This implementation is to be used only for
22 performance measurements. For instance, what impact does real time frame encryption and decryption
23 have on quantity structures? Key management, updates, rotation etc. and other mechanisms are not
24 covered.
25
26 Configuration parameters
27 -------------------------
28
29 The parameters which allow to configure frame authentication or encryption are shown below:
30
31 .. list-table:: Features & configure options
32 :widths: 50 100
33 :header-rows: 1
34
35 * - Option
36 - Description
37
38 * - SecurityMode (String)
39 - One of ``None``, ``AO`` (Authentication only), ``AE`` (Authentication and Encryption)
40
41 * - SecurityAlgorithm (String)
42 - One of ``AES256-GCM``, ``AES128-GCM``, ``CHACHA20-POLY1305``
43
44 * - SecurityKey (String|Hex)
45 - Key to be used for crypto functions either 16 or 32 bytes depending on selected algorithm
46
47 * - SecurityIvPrefix (String|Hex)
48 - Prefix of the IV which is 6 bytes in size
49
50 These options are valid for classes TSNHigh, TSNLow, RTC and RTA.
51
52 Implementation
53 --------------
54
55 The current implementation uses OpenSSL v3 or later. This means the authentication and encryption
56 work is performed in software. Therefore, enabling security can have a significant performance
57 impact.
58
59 Future hardware like ASIC(s) or newer generation NIC(s) may provide Profinet security hardware
60 offloading with the goal of zero performance impact. This is not covered yet.
61
62 Example
63 -------
64
65 There are examples for Profinet Authentication only and Authentication and Encryption:
66
67 - ``tests/profinet_auth``
68 - ``tests/profinet_crypt``
69
70 For measuring the security performance impact the CPU run times of the involved real time tasks can
71 be traced. See ``scripts/trace_rtc.bt`` for an example.