Controller.Firewall
The functionality of the Controller Firewall is available since FW Version 01.09.00. The firewall refers exclusively to the Engineering Port X16 and not to the fieldbus interfaces.
Since Firmware Version 01.11.00 the Controller Firewall is also available for Profinet and the dual network.
The »PLC Designer« is used to put the controller firewall into operation and to parameterize it. A general procedure can be found in the following picture.
Activity Diagram
Controller.Firewall: Configuration
This chapter describes the parameter configuration of the Controller Firewall.
Controller Firewall Configuration Data
The configuration data of the Controller Firewall is stored in the parameter set of the controller. The individual setting options are mapped to individual indexes, subindices, bitcoding or enumerations. The index range extends from 0x5910 to 0x5913. This parameter set can be parameterized with the help of the »PLC Designer« and is part of the »PLC Designer« project. Likewise, the parameter set is part of the project, which is transferred to the controller. The parameter set is located on the SD card of the controller.
During commissioning, additional measures must be taken to protect this parameter set from unauthorized modification. Therefore, when commissioning a machine, it is necessary to consider and evaluate the individual communication channels from a cyber security point of view. Examples include the following:
(a) changes made with the "EASY Starter";
(b) changes made via SSH;
(c) changes made via SFTP; and
(d) others.
Furthermore, the SD card must be protected from removal because the data on it can be accessed and modified with any SD card reader. Therefore, it is recommended that the operator mechanically protect the control cabinet from unauthorized use.
Settings Dialog for the Controller.Firewall
Parameters for the Controller Firewall
The parameter concept contains four indexes:
-
0x5910: Basic parameters for the Controller Firewall, which apply generically
-
0x5911: Well-Known Port Settings (Ports 1 bis 1.023)
-
0x5912: Registered Port Settings (Ports 1.024 – 49.151)
-
0x5913: Application Port Settings
All four areas are described below.
Basic parameters for the Controller Firewall 0x5910
In the default settings, the firewall is deactivated. This is necessary for compatibility reasons with older versions. You can activate it with parameter 0x5910:001.
|
Address |
Name |
Info |
|
|---|---|---|---|
|
0x5910:001 |
Firewall: Firewall activation |
|
|
|
0 |
Deactivated |
Controller Firewall is deactivated. |
|
|
1 |
Activated |
Controller Firewall is activated. |
|
The following setting option affects the IP clients that want to access the controller. The IP address ranges of the clients are specified here.
Example:
If 0x5910:002 and 0x5910:003 are parameterized as 192.168.5.100 and 192.168.5.120, respectively, then the range of IP addresses is allowed. For example, a client with an IP address of 192.168.5.110 could access the network, but a client with an IP address of 192.168.5.90 or 192.168.5.130 could not. You can also select the same start and end addresses to allow only one IP address. Four IP ranges are offered to allow setting IP clients on different networks separately. The parameters for IP client addresses are:
|
Address |
Name |
Info |
|---|---|---|
|
0x5910:002 |
Firewall IP Range: IP Range Start |
Start of IP-Range for the IP-Clients |
|
0x5910:003 |
Firewall IP Range: IP Range End |
End of IP-Range for the IP-Clients |
Please remember that, at this point, only the limits of the IP address ranges of the clients are set. The selection and activation take place for the individual protocols. These IP addresses apply to all protocols and are therefore generic.
-
Setting the IP ranges for clients only affects the engineering port and the switch as a network. Clients on the fieldbus are not considered in terms of their IP addresses.
Parameters for the Well-Known Port Settings (Port 1 – 1,023)
The firewall settings are stored in the device parameter set. Below the index is the range of subindices. The subindex range is divided into blocks of 10 subindices each. Each block Contains parameters for each possible protocol. There are three setting options for each protocol (other subindices are reserved):
|
Address |
Name |
Info |
|
|---|---|---|---|
|
0x5911:xx1 |
Firewall <protocol>: Network |
|
|
|
0 |
Engineering Port |
Engineering Port via X16 |
|
|
1 |
Profinet |
Profinet |
|
|
2 |
Dual Network |
Dual Network |
|
|
0x5911:xx2 |
Firewall <protocol>: Client IP Range |
|
|
|
0 |
Any |
All Client-IP-Addresses are allowed. |
|
|
1 |
IP Range 1 |
IP Range 1 defined in 0x5910:002 and 0x5910:003. |
|
|
2 |
IP Range 2 |
IP Range 2 defined in 0x5910:004 and 0x5910:005. |
|
|
3 |
IP Range 3 |
IP Range 3 defined in 0x5910:006 and 0x5910:007. |
|
|
|
4 |
IP Range 4 |
IP Range 4 defined in 0x5910:008 and 0x5910:009. |
|
0x5911:xx3 |
Firewall <protocol>: Activation |
|
|
|
0 |
Drop |
Deny Connection without notifying the Sender. |
|
|
1 |
Reject |
Deny Connection with notifying the Sender. |
|
|
2 |
Allow |
Allow Connection |
|
As mentioned above, these options are available for each protocol.
Parameters for the Registered Port Settings (Ports 1,024 – 49,151)
The subindex range is divided into blocks of 10 subindices each. Each block contains the parameters for each possible protocol. For each protocol there are three setting options that correspond to the setting options of the well-known ports.
Parameters for the Application Port Settings (Ports 49,152 – 65,535)
In contrast to the previously mentioned ports, it is not possible to perform a factory default setting for the application ports. This is due to the dynamic use of e.g. sockets in the IEC application. This may make it necessary to open additional ports in the firewall. This is precisely what the application ports are designed to do.
The special feature here is that the required protocols behind the ports are unknown and are only defined by the application. In this respect, further setting options are necessary, which are explained below. These setting options are additional. Each protocol still contains the three subindices for Network, Client IP Range and Activation.
In addition, there are four additional parameters for each application port:
|
Address |
Name |
Info |
|
|---|---|---|---|
|
0x5911:xx7 |
Firewall: Protocol Type |
|
|
|
0 |
None |
|
|
|
1 |
TCP |
|
|
|
2 |
UDP |
|
|
|
3 |
TCP&UDP |
|
|
|
0x5911:xx8 |
Firewall: Port Range Start |
Start Port Address |
|
|
0x5911:xx9 |
Firewall: Port Range End |
End Port Address |
|
|
0x5910:x10 |
Firewall: Protocol Name |
Help note for the protocol name |
|
The user can open an application port with these parameters:
0x5910:x10 Protocol Name
This parameter is only available to give the firewall rule a name. Here, the customer can to assign a name, which is stored in the parameter set and then displayed on the interface of the tool. This name is not relevant to the actual function.
0x5910:xx8 Port Range Start and 0x5910:xx9 Port Range End
These two parameters can be used to set the port range of the firewall rule. In special cases where start and end are the same, one single port is addressed. By default, the port range 49,152 to 65,535 is set here. This is the range where customers should put their ports. However, these parameters can range from 1 to 65,535. This means that by adjusting the parameters accordingly, values in the ranges of the well-known or registered ports are also possible. Only port 0 is prohibited and is outside the addressable range.
Customers may select a port for the application ports, that is already listed as a well-known or registered ports. If the rules for the application port and the well-known or registered port contradict each other, the rule for the well-known or registered ports leads.
0x5911:xx7 Protocol Type
This parameter can be used to set the log type of the rule. The following settings are offered:
-
None
The firewall rule does not refer to any protocol and is therefore inactive.
-
TCP
The firewall rule applies to TCP protocols.
-
UDP
The firewall rule applies to UDP protocols.
-
TCP&UDP
The firewall rule applies to both UDP and TCP protocols.
Controller.Firewall: Good to know …
This chapter discusses some topics that are relevant for the controller firewall.
Validity of Controller Firewall parameters
The prerequisite is a controller with an executable application. For this purpose, a boot application must be created. Restart the controller. With this configuration, it is possible to describe any parameter of the controller Firewall and it is effective immediately. This can be ideally used to test firewall settings. These changes can be saved using the command "Save parameter sets..." so that they are available again after a restart.
Handling IP-Ranges
The controller checks the IP range for admissibility in the settings. Among other things, it verifies that the upper value must be greater than the lower value. As a result, the upper value must be entered first, followed by the lower value.
Exclude from the controller
You can deactivate the currently used protocol and the currently used communication channel which will exclude you from access. There are three workarounds that can be used.
-
Connect via a different communication channel or protocol and reopen the previously closed port.
-
Connect via a different communication channel or protocol and deactivate the complete Controller Firewall.
-
Remove the SD card and delete the parameter set regarding the project and reinstall it.
Note: The parameter set that contains the parameters of the firewall is located on the SD card under /plc/prg/PlcParameterSet/PLC_0_0.pprm.
Handling of the parameter set:
Since the Controller Firewall parameters are part of the parameter set, they are subject to the same mechanisms for the parameter set itself. This means that they are part of the »PLC Designer« project and the Application Loader Package. They are displayed in difference lists and can also be used and changed by the »EASY Starter« if it has passed authentication for the controller.
Philosophy of Default Assignment
The philosophy for the default assignment of the Controller Firewall parameters is as follows: Rules for the ports:
-
By default, the Controller Firewall is deactivated and must be activated.
-
In general, all ports are closed by default and must be opened.
-
An exception are the ports for a »PLC Designer« at the interface of the engineering port.
-
An exception are the ports required for the production of the components.
Prioritization of Controller Firewall Rules
The rules of the Controller Firewall are applied as follows:
-
All ports are closed.
-
The ports in the Well-Known area are opened according to the settings.
-
The ports in the Registered area are opened according to the settings.
-
The ports in the Application area are opened according to the settings.
-
If the settings of the first two areas contradict the application area settings, the settings of the first two areas take precedence.
Using http via Port 80 or via Port 8080
Since http is no longer the state of the art from a security point of view, the http ports are no longer displayed in the firewall. If the http ports are required, two options are available:
-
Applications must be switched from http with port 80 or port 8080 to https with port 443. An example is the connection of the visualization. For a corresponding description see UIDesigner.TargetDeviceManager.Certificate.
-
The http ports 80 and/or 8080 must be added to the scope of the Application Port Settings and opened explicitly.
-
Deactivate the Controller Firewall (not recommended).
-
The http port for the Process-Visualization (designed by the UI Designer) or the Diagnose-Visualization is tcp/80. The http port for the Controller.WebVisu (only available with extended Controller versions) is tcp/8080.
Workaround: Handling of outbound connections
This chapter is relevant for the Controller firmware versions between 01.09.00 and 01.11.00. The Controller.Firewall focuses on incoming rather than outgoing connections. However, if an outgoing connection is established, usually response is made in most cases, which in turn must be taken into account by the firewall. For example, the OPC-UA connection is considered here. If a connection is established from controller A with an OPC-UA Client to controller B with an OPC UA Server, four steps in the respective firewalls of the controllers are relevant:
-
Controller A with OPC-UA Client and an outgoing connection
The OPC-UA Client communicates via a randomly selected dynamic port (from the range 32,768 – 60,999). Outgoing ports are generally not blocked by the firewall. -
Controller B with OPC-UA Server and an incoming connection
In this example, the incoming connection takes place on the OPC-UA Server port 4840, which must be enabled in the firewall. -
Controller B with OPC-UA Server and an outgoing connection
The OPC-UA Server responds via port 4840 and creates an outgoing connection. Outgoing ports are generally not blocked by the firewall. -
Controller A with OPC-UA Client and an incoming connection
The OPC-UA Client receives the response on the same randomly selected dynamic port. This port must be opened in the firewall. Since the port is chosen randomly, the dynamic range in the Controller. Firewall must be specified as the application port range.
-
A Controller. Firewall rule for the controller A might look like this:
-
Protocol name: e.g. "Open dynamic ports"
-
Port Range Start: 32768
-
Port Range End: 60999
-
Protocol Type : TCP
-
Activation: Allow
-
Client IP Range: Any
-
Controller.Firewall: Security functionality verification
There are different ways to verify the correct functionality of the firewall. The following example explains how this can be tested.
First, a connection must be established to that the PLC connection is working properly.
In order to establish a connection, the firewall must be configured to allow it.. In this example, communication between the PLC and the UI Designer will be established.
At the firewall, configure the ports for UI Designer communication as open.
Firewall.Security functionality verification
The correct parameterization be tested. Follow the instructions in the “UIDesigner.ServerManagerUI.Certificate” chapter to establish a connection between the plc and the UI Designer.
After establishing the connection, switch to offline mode and change the parameterization of the firewall as follows.
Firewall.Security functionality verification check
To test the correct functionality of the firewall, try to establish a connection with the UI Designer. The connection should be dropped.