Securing the data server against host header injection vulnerabilities
To prevent host header injection attacks, the data server allows sessions to be established only with clients (usually by using the data server admin interface) that use specific host names or IP addresses in the URLs used to connect to the data server. These allowed hosts can be determined automatically by the system and provided in a configuration file.
About this task
AppServer.out file in the /deepfs/config directory to see which hosts are allowed. The contents of the file might look like this example:*** RESTART ***
Wed Jun 19 21:15:57 UTC 2019
getAllowedHosts: ['198.51.100.0', 'storediq-ds1']The data server lists the allowed hosts, in this case 198.51.100.0 and storediq-ds1, that can be used by clients. In general, two default hosts are automatically determined by the data server on startup: the primary IP address (198.51.100.0) and the primary host name (storediq-ds1). In addition, one or more hosts that represent the local data server system might also be automatically determined, for example, the localhost IP address of 127.0.0.1.
Often the default hosts are not sufficient, and host names need to be added to the system to allow clients to use those host names in their URLs. To do so, modify the settings.py file in the /usr/lib/python2.6/site-packages/deepfile/ui/djangoweb with a list of allowed hosts to add.
Procedure
Results
*** RESTART ***
Wed Jun 19 21:25:37 UTC 2019
getAllowedHosts: getAllowedHosts: ['198.51.100.0', 'dataserver', 'myds', 'storediq-ds1']This security approach means that URLs employed in browsers to access the data server user interface must use one of the allowed IP addresses or host names listed in the AppServer.out file when the AppServer service initializes. If a client attempts to establish a session using a host name or IP address that was not automatically determined or specified in the ALLOW_HOSTS line of settings.py, the session request is rejected.
Example
A user tries to access the data server admin user interface used in these examples with this URL: https://storediq-dataserver/login
storediq-dataserver is resolved to the data server system (either through DNS resolution or an entry in the client system’s hosts file), the user is presented with the login page as usual. However, the login attempt results in the following error message:Unhandled Exception
An unhandled exception was thrown by the application.This is because storediq-dataserver is not an allowed host. If they instead use the URL https://storediq-ds1/login, the login is processed in the normal way and access should be granted to the data server admin user interface provided suitable credentials are supplied.