Users' Manual
Version 1.9 — Rev. 3

# Security

OpenLiteSpeed is designed with security as a top consideration. OLS supports SSL, has access control at server and virtual host levels, and context-specific realm protection. Besides these standard features, OLS also has the following special security features:

## Connection level limits

- IP-level throttling limits network bandwidth to and from a single IP address regardless of the number of connections.
- IP-level connection accounting limits the number of concurrent connections from a single IP address. You can control this with the Connection Soft Limit, Connection Hard Limit, Grace Period, and Banned Period settings in the WebAdmin Console.

## Request checking

Every HTTP request is vetted by OpenLiteSpeed. /. is not allowed in a decoded URL, thus denying accessing hidden files and parent directories.

Request size is limited by OpenLiteSpeed's Max Request URL Length, Max Request Header Length and Max Request Body Length settings.

## Static file checking

OpenLiteSpeed will serve a static file only if the following conditions are satisfied:

- The file is readable by everyone.
- The file is not executable.
- The file is not in the access denied directory list.
- The file does not contain symbolic link if symbolic links are not allowed.
- By default, OpenLiteSpeed does not index a directory by listing its files, it has to be enabled explicitly.

## External application firewall

OpenLiteSpeed forwards requests to external applications to process/generate dynamic content. Those applications can use a lot of system resources. The performance of the whole system will be severely degraded when system resource consumption reaches a certain point — when swapping space has to be used, for example. One way to conduct a DoS attack is to flood the web server with concurrent requests to a cumbersome external application.

OpenLiteSpeed can pipeline requests and control the number of concurrent external application requests to prevent overconsumption of system resources. OLS caches requests and only forwards completed requests to the external application. This means the external application will not be held waiting while the server is receiving the request. OLS also caches the external application's response so that the external application can be released as soon as the response is completed and does not have to wait for the client to receive the complete response. This way the server can utilize fewer external application instances to serve more concurrent requests and achieve higher performance and scalability. OpenLiteSpeed also uses its own virtual memory to cache the request and response body to minimize the usage of system memory without sacrificing performance.

## CGI resources consumption limit

OpenLiteSpeed restricts the amount of system resources that can be consumed by CGI applications. For each request to a CGI script, the web server needs to start a standalone CGI process to handle it. On a Unix system, the number of concurrent processes is limited. With the CGI resources consumption limit, you can configure the maximum number of concurrent CGI instances that the web server can launch. Excessive concurrent processes will degrade the performance of the whole system. (CGI processes are a common weapon for DoS attacks.) A system process limit can be specified per user in order to control the number of processes that can be spawned by a CGI application. Each process is further confined by CPU and memory limits.

## Enhanced CGI/FastCGI security with suEXEC

In order to reduce the security risks of a CGI or FastCGI script, OpenLiteSpeed can restrict the system resources the CGI script can access by running it in suEXEC mode. suEXEC starts the CGI or FastCGI script with a different user ID from that of the web server. This greatly improves security in a shared hosting environment by preventing one user's CGI script from accessing other users' files.