Configuring data acquisition using the OPC UA protocol
Kaspersky IoT Secure Gateway 100 receives data from equipment residing within the internal enterprise network over the OPC UA protocol, which is described by the OPC Unified Architecture specification. You can read about the OPC UA protocol specification on the developer's website. Kaspersky IoT Secure Gateway 100 supports OPC UA protocol version 1.04.
The None
security profile in the Kaspersky IoT Secure Gateway 100 settings is the security profile that is most compatible with various types of industrial equipment for OPC UA connections.
When generating certificates for a connection between a client (Kaspersky IoT Secure Gateway 100) and the OPC UA server, make sure that the certificates comply with the following settings:
- The settings of keys and certificates are compliant with the selected security policy.
- DER or PEM format is used for certificates and client keys.
- For the client certificate, the Subject Alt Name field contains the value URI:urn:aprotech:KISG100:OpcUaClient.
Kaspersky IoT Secure Gateway 100 uses the following folders to store certificates and keys for a connection with an OPC UA server:
- /app/Core/pki/private/transfer/opc_ua/client/ – folder in the TGW-HW-IDS section of the SD card for storing OPC UA client keys.
- /app/Core/pki/certs/transfer/opc_ua/client/ – folder in the TGW-HW-IDS section of the SD card for storing certificates of the OPC UA client and OPC UA server.
You can configure the settings for receiving data from monitored objects over the OPC UA protocol in the OpcUaClientSettings-0.json configuration file.
To configure data acquisition using the OPC UA protocol:
- Create an OpcUaClientSettings-0.json configuration file and put it in the folder /app/Core/config/transfer/opc_ua/client in the TGW-HW-IDS section of the SD card.
All of the actions described next are performed within the OpcUaClientSettings-0.json file.
- To correctly route data from industrial equipment to the MindSphere repository, specify the ID and name of the OPC UA client:
- In the mandatory
id
parameter, define the that will receive data from the OPC UA server (industrial facility). For example,"id": 0
. - In the mandatory
name
parameter, define the name of the OPC UA client that will receive data from the OPC UA server (industrial facility). For example,"name": "Kaspersky IoT Secure Gateway 100 OPC UA Client"
.
- In the mandatory
- To make it easier to read the configuration, you can use the optional
description
parameter to enter a description of the OPC UA client that will receive data from the OPC UA server (industrial facility). For example,"description": "Collect data from CNC by Kaspersky IoT Secure Gateway 100"
. - To connect an OPC UA client to equipment, specify the OPC UA server address and port in the mandatory
url
parameter. For example,"url": "opc.tcp://192.168.177.7:4840"
. - Specify a time interval (in seconds) in the
readingCycle
parameter to define how frequently the gateway will read data. For example,"readingCycle": 1
. - Configure the in the mandatory
security
settings block:- In the
mode
parameter, indicate the security management mode for the connection of the client application that is being used on your OPC UA server. The following security management modes are available:Sign
means that the connection requires a digital signature for data.SignAndEncrypt
means that the connection requires both a digital signature and data encryption.None
means that the connection does not require a digital signature or data encryption. It is not recommended to use this mode because it does not ensure a secure connection between the OPC UA client and the OPC UA server.Any
means that the connection will use any of the listed modes that are supported by the server:Sign
,SignAndEncrypt
,None
.
- In the
policy
field, specify the name of the security profile that is being used on your OPC UA server. The following security profile options are available:Basic128Rsa15
.Basic256
.Basic256Sha256
.None
.Any
means that any of the listed policies can be used (if supported by the server):Basic128Rsa15
,Basic256
,Basic256Sha256
,None
.
- For secure communication over OPC UA, you must create a private key and certificate and put them into the client and server configuration. To set up a secure connection over OPC UA, define the following settings in the
clientPkiData
settings block:- In the
certificate
field, specify the name of the certificate file for the OPC UA client. For example,"certificate": "client.crt"
. - In the
privateKey
field, specify the name of the private key file for the OPC UA client certificate. For example,"privateKey": "client.key"
.The
clientPkiData
settings block must be completed even if theNone
value is set for themode
andpolicy
fields.
- In the
- In the
trustList
field, specify the array that contains the names of trusted certificate files. For example,"trustList": ["server.crt"]
. If the OPC UA server configuration prescribes the use of a custom trusted list, add the client certificate to the list of trusted certificates of the server. If certificate verification is not required, indicate theAllowAll
value for this parameter.
If you do not need to complete the
mode
,policy
andclientPkiData
settings blocks, define thenull
value for thesecurity
settings block. The security mode will be set toNone
in this case. - In the
- For OPC UA client authentication on the OPC UA server, provide the user account credentials for the connection in the mandatory
userCredentials
settings block:- In the
username
field, enter the name of the user account for authorization on the OPC UA server. - In the
password
field, enter the password of the user account for authorization on the OPC UA server.
If you want to allow anonymous connection of the OPC UA client to the OPC UA server, define the
null
value in theuserCredentials
block. In this case, you do not need to fill in theusername
andpassword
fields. - In the
- If you want to configure (heartbeat) of Kaspersky IoT Secure Gateway 100 to the Siemens MindSphere cloud platform, do the following:
- Make sure that the Siemens MindSphere cloud platform has a data point configured for implementing the heartbeat transmission function.
- In the optional
heartbeat
settings block, define the following settings:- Enter the data node ID in the
id
field. For example,"id": 0
. - Specify the data node name in the
name
field. For example,"name": "Heartbeat"
. - In the
timeout
field, specify the time period (in seconds) between the generation of heartbeat signals. For example,"timeout": 60
. This field is optional. The default value for the time period between generated signals is 30 seconds.
- Enter the data node ID in the
If you skip configuration of periodic heartbeat signal transmission or define "
heartbeat": null
, no heartbeat signals will be transmitted. - In the mandatory
nodes
settings block, specify the following parameters for each data node:- Enter the data node ID in the
id
field. - Specify the in the
name
field. - In the
nodeId
settings block, provide the following data:- ID of the OPC UA server namespace in the
ns
(namespace index) field - ID of the data node in the OPC UA server namespace The following options are available:
s
(string identifier) – string value for the data node ID. For example,"nodeId": "ns=1;s=Variable temperature"
.i
(numeric) – numerical value for the data node ID. For example,"nodeId": "ns=2;i=2045"
.
- ID of the OPC UA server namespace in the
- Enter the data node ID in the
- Save the changes in the OpcUaClientSettings-0.json file.
The settings defined in the OpcUaClientSettings-0.json file will be applied the next time Kaspersky IoT Secure Gateway 100 is started.
Kaspersky IoT Secure Gateway 100 will receive data from industrial facilities within the internal enterprise network via the protocol that is described by the OPC Unified Architecture specification.