Securing applications that are accessible to the Internet is not a trivial task. This page outlines some of the issues and offers tips to help you secure your application using the Mbedthis AppWeb product.
UpdatesEven the best application or HTTP server can experience some security vulnerabilities that are discovered after being deployed in the field. It is highly recommended that you stay up to date with the latest version of AppWeb.Mbedthis offers a Security Enhancement Service as part of the commercial license that will proactively notify you of any security flaws and will expedite fixes or workarounds to minimize the vulnerability. AppWeb User AccountIt is important that you run AppWeb with the lowest system privilege that will get the job done. If any application is compromised, including AppWeb, then the system will be safest if the compromised application has as few privileges as possible.On Linux, AppWeb initially runs as root or administrator and then changes to the user account defined in the AppWeb configuration file. As installed, AppWeb will be configured to run in the nobody account on Linux. You may modify the user and group account for AppWeb by changing the configuration file. On Windows when running as a system service, AppWeb will run using the LocalSystem account. This account has no privileges to access the network using network drives, named pipes, RPC or DCOM. However, it has considerable privileges locally. It is suggested that you create a dedicated account for AppWeb to minimize the priviliges available should AppWeb be compromised. When creating an account for AppWeb, ensure you do the following:
Directory and File PermissionsWhen AppWeb is installed, it is configured for maximum security. This section explains the policy used, incase you need to move or modify files and directories. To enhance security, you need to consider the directory and file permissions for three classes of content:
Scripts run by the AppWeb server should always be outside the directory containing served pages. After all, you don't want prying eyes viewing your scripts! Scripts should be owned by root or administrator and should only be readable and executable by the AppWeb user account. Configuration and log files used by the AppWeb server should always be outside the directory containing served pages or scripts. The directory containing the log files must be writable by the AppWeb user account. ServerRoot PermissionsThe root directory for AppWeb is called the ServerRoot directory and is defined by the ServerRoot directive in the configuration file. The ServerRoot directory and the logs and lib directory below it should be owned by root or admin, be in the group root or administrators, and should only be writable by this user and group.For Linux, these commands will ensure the privileges are correctly setup: cd /etc/appWeb Dynamic ContentAppWeb supports an in-process method of dynamic content creation called Embedded Server Pages (ESP). ESP will execute HTML pages with embedded code and scripts and process them before returning the result to the client. Properly configured, your scripts will not be readable by users and they will only see the generated content.Embedded Server PagesTo keep server-side ESP scripts private, you must have the ESP handler configured to process the required script extensions or URL prefixes. If a script extension is not configured, the static page handler may process the page and return the raw script back to the user. As installed, AppWeb defines the ".esp" and ".asp" extensions for ESP pages.Embedded Gateway InterfaceEGI forms are secure from file-based permission flaws because they run in-process and access no files.SSL ServersIf you configure a SSL virtual server, remember to define a separate DocumentRoot if you want to only serve private content to SSL users. Otherwise those pages will also be visible via the default server.AuthenticationIt is highly recommended that you not use basic authentication and only use digest authentication. As implemented in AppWeb, digest authentication provides many safeguards against known exploits including; man-in-the-middle attacks, client spoofing, and replay attacks.SandboxingSandboxing is the term applied to running AppWeb in a confined environment. When embedding a HTTP server in an application, the profile of user access is often well known. This profile includes the rate of accesses, the length of URLs and the size of pages returned to the user.AppWeb has a set of configuration file directives that allow you to define a sandbox which specifies how AppWeb must be used for a request to be serviced. By using well defined sandbox directives, you can help ensure that your application will not be compromised by malicious requests. By default, AppWeb has a relaxed set of defaults that will permit a wide range of requests. The sandbox directives can specify:
Log FilesAppWeb will log satisfied requests to the access log (usually logs/access.log) and errors to the error log (usually logs/error.log). It is recommended that you regularly review these logs for suspicious activity. |