S 5.117 Integration of a database server into a security gateway

Initiation responsibility: IT Security Officer, Head of IT

Implementation responsibility: Administrator, IT Security Officer

There are two main application scenarios to consider when installing database servers to access an untrustworthy network:

Both application scenarios are described in the following two sections:

Access using a web front-end

The web server and the database server should be installed in different DMZs so that the database server is still protected by a proxy of the application level gateway (ALG) if the web server becomes compromised. However, the protection provided by the proxy is minimal, e.g. the TCP/IP stack of the database server is protected, for example. Furthermore, attacks based on the TCP/IP header data are prevented. If there are no special security requirements, the server may also be placed in the same DMZ as the web server.

The design and the communication links in this case are as follows:

These connections are also shown in the following figure.

Access to a database using a web front-end
Figure 1: Access to a database using a web front-end

The client in the untrustworthy network may only submit queries to the web server using web page requests and direct access to the database itself is impossible.

In this design, it is important that the application preparing the queries and results on the web server is correspondingly securely programmed and does not offer any opportunities for possible attacks to the database (using SQL injection, for example) in addition to securing the transport level. If it is possible to formulate database queries directly in the corresponding database language (for example SQL) using the web front-end, access to the web front-end should only be possible using HTTPS.

Direct access

If access to the database is allowed directly from the untrustworthy network, the server should be placed in its own DMZ. Since only a few proxies are available for database protocols, using a TCP or UDP relay is often unavoidable.

Direct access to a database
Figure 2: Direct access to a database

Due to the lack of security proxies for database query protocols, it is difficult to control the queries using security proxies, and the solution presented first using a web front-end is generally the more secure solution.

Depending on the protection requirements of the data in the database, it is urgently recommended not to grant external access to the "real database", but to copy the data to a separate database that is synchronised with the "real database" at corresponding intervals instead.

Review questions: