📜 ⬆️ ⬇️

Hide 1C for the fireproof wall

image Many system administrators, thinking about the security of their company's data and, in particular, about the security of the 1C database, neglect a simple but effective solution - isolate the server from users. This article analyzes security threats arising when placing the client part of 1C and 1C servers in one network segment, and discusses the process of transferring the server part of 1C to another network segment. This article does not contain fundamentally new solutions, but can serve as a reference tool that combines information from various sources.

Initial data


Security threats

To identify security threats, we draw up a traffic flow pattern in the existing network.
image
Figure 1. Initial traffic flows

Notes to illustration

What we have:

Tasks

  1. Minimize the risks of implementation of operating system vulnerabilities.
  2. Make it impossible to transfer files using SMB protocol from terminal servers to users' computers.
  3. Exclude the possibility of user access to the servers 1C and MS SQL.
  4. Minimize the number of users who can transfer files to their computers using the RDP protocol.

Requirements for implementation

Provide simplicity and ease of use of 1C Enterprise resources.
')
Decision

Let's make the scheme of movement of necessary traffic flows.
image
Figure 2. Required traffic flows
As you can see, for the full functioning of 1C you need not so much.
ComputerOutgoing connectionsInbound connections
AD DCNot requiredAll network computers
1C serverDatabase Server 1CTerminal servers
Database Server 1CNot required1C server
Terminal servers1C serverUsers

The table shows that the network can be divided into three segments:
  1. "Server 1C" + "Database Server 1C";
  2. "Terminal Servers";
  3. "Users" + "AD DC".

Next, I will use the terminology from the Information Technology Security Guideline. Network Security Zoning :
Operation Zone (OZ) is a standard environment for everyday operations, in which most user systems and servers are located. Confidential information can be processed here, but it is not suitable for storing large amounts of confidential information or for critical applications.
Restricted Zone (RZ) - provides a controlled network environment for critical services or for large amounts of confidential information.
To perform tasks 1-3, we divide the network into several zones:
  1. RZ1C - this zone will include “1C Server” and “DB 1C Server”.
  2. RZTS - this zone will include terminal servers.
  3. OZ - the AD DC domain controller and users will enter this zone.

Traffic will be regulated by a router, in which we will enter the necessary rules.
image
Figure 3. Network zoning scheme
To solve problem 4, do the following:

In this way, we can only allow local users to mount local disks.

Implementation

Routing

As a router in this article, I will use a computer with three network cards with the operating system of the GNU / Linux family. Routing software - iptables. The iptables configuration script is shown below.
#!/bin/sh echo 1 > /proc/sys/net/ipv4/ip_forward OZ=192.168.0.0/24 RZTS=192.168.2.0/24 RZ1C=192.168.1.0/24 ADDC=192.168.0.1 #     iptables –F iptables –X iptables –-flush #     iptables –P INPUT DROP iptables –P OUTPUT DROP iptables –P FORWARD DROP #     ESTABLISHED  RELATED   TCP  UDP iptables –A FORWARD –p tcp –m state --state ESTABLISHED,RELATED –j ACCEPT iptables –A FORWARD –p udp –m state --state ESTABLISHED,RELATED –j ACCEPT #   RDP   OZ->RZTS iptables –A FORWARD --src $OZ --dst $RZTS –p tcp --dport 3389:3390 –j ACCEPT #  DNS-   RZTS->ADDC, RZ1C->ADDC iptables -A FORWARD –-src $RZTS --dst $ADDC -p udp --dport 53 -j ACCEPT iptables –A FORWARD --src $RZ1C –-dst $ADDC –p udp --dport 53 –j ACCEPT #    Active Directory iptables –A FORWARD --src $RZTS --dst $ADDC –p udp --dport 88 –j ACCEPT iptables –A FORWARD --src $RZ1C --dst $ADDC –p udp --dport 88 –j ACCEPT iptables –A FORWARD --src $RZTS --dst $ADDC –p tcp --dport 135 –j ACCEPT iptables –A FORWARD --src $RZ1C --dst $ADDC –p tcp --dport 135 –j ACCEPT iptables –A FORWARD --src $RZTS --dst $ADDC –p tcp --dport 139 –j ACCEPT iptables –A FORWARD --src $RZ1C --dst $ADDC –p tcp --dport 139 –j ACCEPT iptables –A FORWARD --src $RZTS --dst $ADDC –p tcp --dport 389 –j ACCEPT iptables –A FORWARD --src $RZ1C --dst $ADDC –p tcp --dport 389 –j ACCEPT iptables –A FORWARD --src $RZTS --dst $ADDC –p udp --dport 389 –j ACCEPT iptables –A FORWARD --src $RZ1C --dst $ADDC –p udp --dport 389 –j ACCEPT iptables –A FORWARD --src $RZTS --dst $ADDC –p tcp --dport 445 –j ACCEPT iptables –A FORWARD --src $RZ1C --dst $ADDC –p tcp --dport 445 –j ACCEPT iptables –A FORWARD --src $RZTS --dst $ADDC –p tcp --dport 1025 –j ACCEPT iptables –A FORWARD --src $RZ1C --dst $ADDC –p tcp --dport 1025 –j ACCEPT #   1 iptables –A FORWARD --src $RZTS --dst $RZ1C –p tcp --dport 1541 –j ACCEPT iptables –A FORWARD --src $RZTS --dst $RZ1C –p tcp --dport 1560:1591 –j ACCEPT #  ,    iptables –A FORWARD --src $RZTS --dst $ADDC –p icmp –j ACCEPT iptables –A FORWARD --src $RZ1C --dst $ADDC –p icmp –j ACCEPT iptables –A FORWARD --src $OZ --dst $ADDC –p icmp –j ACCEPT # REJECT   iptables –A FORWARD –j REJECT # REJECT   iptables –A INPUT –j REJECT 


Script Notes

The DROP action simply “drops” the packet and iptables “forgets” about its existence. “Discarded” packages stop their movement completely, i.e. they are not transferred to other tables, as is the case with the ACCEPT action. It should be remembered that this action can have negative consequences, since it can leave unclosed "dead" sockets both on the server side and on the client side, the best method of protection would be to use the REJECT action especially when protecting against port scans ( Iptables Tutorial ).

If the HASP keys are not installed on the terminal server and the license manager is located on another network, you need to perform several actions.
  1. Allow UDP and TCP packets to pass through the router on port 475 in the two-way direction License_server <-> Client_1C.

    iptables –A FORWARD --src _ --dst _ –p udp --dport 475 –j ACCEPT
    iptables –A FORWARD --src _ --dst _ –p tcp --dport 475 –j ACCEPT
    iptables –A FORWARD –-src _ --dst _ –p udp --sport 475 –j ACCEPT
    iptables –A FORWARD –-src _ --dst _ –p tcp --sport 475 –j ACCEPT

  2. Specify the address of the license server in the nethasp.ini file (should be located in the same directory with the executable file of the program).
    --------------------- nethasp.ini-------------------------------
    [NH_COMMON]
    NH_TCPIP = Enabled
    ...
    [NH_TCPIP]
    NH_SERVER_ADDR = 168.192.1.10 // ip- , .
    NH_TCPIP_METHOD = TCP
    NH_USE_BROADCAST = Disabled
    ---------------------------------------------------------------


Map Local Client Disks

Through visual wizards, we cannot simply add a new listening port on the terminal server: for this, these connections must be available from different interfaces or using different protocols, which is what the error that appears when trying to deceive fate says.
image
Figure 4. Attempting to create a new connection with existing parameters
However, we are not satisfied with this scenario.
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\_ connection is named “RDP-Tcp”, and information about it is stored in the registry key HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\_
To create a new connection, you must:

After the described manipulations, we will create a TerminalDisk group and add to it those whom we will entrust the local disk mapping.
Then, in the properties of our new connection, we indicate that only the TerminalDisk group can connect to it and allow the mapping of local disks, and in the properties of the old connection, we prohibit the mapping of disks and the clipboard.

Conclusion

In the future, you can strengthen the scheme by introducing an intrusion detection system.
That's all. I hope someone this material will be useful. Regards and best regards.

Sources

  1. Information Security Technology Guideline (ITSG-38) - Network Security Zoning (Design Considerations for Services within Zones) - http://www.cse-cst.gc.ca/its-sti/publications/itsg-csti/itsg38- eng.html .
  2. Services and network ports in Microsoft Windows server systems - http://support.microsoft.com/kb/832017 .
  3. Restricting Active Directory replication traffic to a specific port - http://support.microsoft.com/kb/224196/en-us .
  4. Guide to iptables (iptables Tutorial 1.1.19) - http://www.opennet.ru/docs/RUS/iptables/ .
  5. How can I add a new RDP terminal server to Windows 2000/2003? - http://www.petri.co.il/add_a_new_rdp_listening_port_to_terminal_server.htm .
  6. 1C: Enterprise 8.2. Client-server option. Admin Guide.
  7. 1C typical problems when working with HASP - http://itunion.com.ua/article.php?id=39 .

Source: https://habr.com/ru/post/122037/


All Articles