DNP3 Secure Authentication- Between ClearScada and Kingfisher RTU, and between two Kingfisher CP-30s
Posted by Bita Javershian on 11 January 2018 02:58 PM
This article is an explanation of how to set DNP3 Secure Authentication between ClearScada and Kingfisher RTU, and between two Kingfisher RTUs along with sample projects for CP-30s and ClearScda configurations. ClearSCADA and CP30, both support DNP3 Secure Authentication version 2.00. It is possible to optionally enable DNP3 Secure Authentication on a per outstation basis in ClearSCADA. When enabled:
Due to factors such as the necessary increase in bandwidth and extra processing involved, ‘challenges’ are only sent in relation to requests or responses that are deemed to be ‘critical’. The DNP3 standard dictates those function codes that are always deemed critical; other function codes can be set to critical if required. In ClearSCADA, you define the criticality of function codes on a per server basis. In CP30, there are default defined critical functions.
When a DNP3 device receives a request or response that is deemed to be critical, that device replies with a ‘challenge’. The challenge requires the sending device (the ‘Responder’) to send a reply within a defined time period.
If an authentic reply is received within the required time period, the device that issued the challenge (the ‘Challenger’) executes the critical function. If the challenger is an outstation, it performs the requested critical function and sends the appropriate response to the DNP3 master. If the challenger is a DNP3 master, it processes the stored response that triggered the challenge.
If a challenge is unsuccessful, the challenger rejects the critical request or response. If the challenger is an outstation, it does not perform the rejected critical request. If the challenger is a DNP3 master, it throws out the data that it received in relation to the rejected critical response. The challenger might also send an error message to the responder, but the number of error messages is actively limited.
In order to communicate using DNP3 Secure Authentication, both the DNP3 master and the DNP3 outstation must support DNP3 Secure Authentication version 2.00 and have that feature enabled. Both devices must also be provided with a pre-shared private Update Key.
With DNP3 Secure Authentication, each DNP3 user requires their own Update Key. The outstation uses the Update Key to authenticate Session Key Change requests from its DNP3 master.
You might need to use a third-party random number generator application to generate a suitable Update Key. The key must comprise a sequence of hexadecimal digits. The key is case insensitive. The size of the Update Key is determined by the Key Wrap algorithm. The algorithm AES-128 requires a 128-bit key comprising 32 hexadecimal digits (for example, 0123456789ABCDEF0123456789ABCDEF).
Session Keys are used to authenticate any messages that are challenged. Two Session Keys are in use per outstation at any particular time—one Session Key per communications direction. This means that if a Session Key is compromised in one direction, it does not compromise communications in the other direction.
The DNP3 master initializes the Session Keys on communications start-up (for instance, when the DNP3 driver starts up, or when communications are first established with the outstation). The Session Keys are changed periodically thereafter, to maintain . On systems on which ClearSCADA is the DNP3 master, the size of the Session Keys is set using the ClearSCADA Server Configuration Tool .
Session Key Change
During the Session Key Change process, the DNP3 master generates a new pair of Session Keys and sends an encrypted copy of those Session Keys to the outstation. The DNP3 master encrypts the Session Keys using another key, the Update Key, and a Key Wrap algorithm. The Update Key permits the DNP3 master to change the Session Keys even after a Session Key is compromised. Session Keys are changed on a regular basis to maintain security. The DNP3 master also initiates a Session Key Change whenever it re-establishes communications with an outstation.
With DNP3 Secure Authentication, two Session Keys are required. One Session Key authenticates data transmitted in the monitoring direction (from a DNP3 outstation to its DNP3 master); the other Session Key authenticates data transmitted in the controlling direction (from the DNP3 master to a DNP3 outstation). Use the Session Key Length field in the DNP3 Master’s Security section of the ClearSCADA Server Configuration Tool to specify the length of both Session Keys. Specify a Session Key length that is supported by all of the DNP3 outstations on your system. The minimum length that you can specify is 128 bits. For systems on which ClearSCADA is the DNP3 master, ClearSCADA generates Session Keys of the specified length using FIPS 186-2 including Change Notice 1.
The Key Wrap algorithm is the algorithm that is used to encrypt the Session Keys and Challenge Data during a Session Key Change. All devices that use DNP3 Secure Authentication must support the Advanced Encryption Standard (AES) AES-128 algorithm.
2.1 Scope of work
Secured DNP3 Authentication on Direct Operate function from Cleasr Scada to slave RTU; and from master RTU to slave RTU. Check results in wireshark while both right and wrong update keys are entered in ClearScada, and compare them.
2.2.1 Defined objects in Data base tree
a. Channel: configured on network TCP
Security enables, HMAC : SHA-1 truncated to 10 octets(network).
Set update key: right click on outstation, on pop up menu; select Set update key, paste the update key copied from RTU.
Note: When pasting the update key , please note that there should not be any gaps in between the characters.
2.2.2 Define Which Function Codes are Critical
Use the check boxes on the DNP3 Master section of the ClearSCADA Server Configuration Tool to determine the criticality of function codes for systems on which ClearSCADA is the DNP3 master. Set the function codes’ criticality so that it matches that of your outstations. For this test “Direct Operate” should be ticked.
2.3 Required settings in RTU
Require authentication for critical functions:
5- When enabled, an Update key can be entered (consisting of 16 hexadecimal bytes). This Update key must then be provided by a DNP3 master device before it can request a critical function. (copy it to a file to paste in ClearScada)
2.3.2 Between 2 RTUs
1- Create new project
The DNP3 Secure Authentication standard for Kingfisher RTUs are:
Write; Select; Operate; Direct Operate; Direct Operate No Acknowledgement; Cold restart; Warm Restart; Initialise Application; Start Application; Stop Application; Enable Unsolicited Messages; Disable Unsolicited Messages; Record Current Time; Authenticate; and Activate Configuration.
Request wireshark capture detailed:
Respond wireshark capture detailed:
2.4.1wireshark capture with wrong update key