Install
Securing the FileRun installation
If you use the official Docker image
The official image is built by us and arrives configured. Everything in the list below that belongs to the web server, to PHP and to the layout of the files is already set inside it:
- The web server refuses every
.phpfile under/apps, and answers with404for/systemand for/cron. - PHP has
display_errorsoff,session.cookie_httponlyon,expose_phpoff andallow_url_includeoff. - The user files live on their own volume,
/user-files, outside the folder the web server serves. - The container runs as an ordinary user account, not as
root. - In the example of the Docker installation guide, the database container publishes no port, so the database is reachable only from the FileRun container and not from the network.
One item of the list below is different inside the image, on purpose: PHP can change the application files, because the container installs FileRun itself, and an update from the control panel replaces those files.
Two things stay yours to do, with Docker as without it:
- Give the superuser a password that cannot be guessed. That account is the only one not protected against brute force sign-in attempts.
- Serve the installation over HTTPS. The example in the guide publishes plain HTTP on port 80, meant to sit behind something that terminates TLS. See Docker with SSL and Reverse proxies.
Use only an official FileRun Docker image.
If you set the installation up yourself
Once you have FileRun running, it is strongly recommended following these steps in order to secure it:
- Make sure all the user folders are outside the public area of your HTTP server!
- Configure your HTTP server to block access to
.phpfiles inside the/appsfolder. FileRun applies a.htaccessfile for Apache and aweb.configfile for IIS. For NGINX, see the file/apps/security.nginxon suggested configuration that you will need to set in your NGINX configuration.- Test to make sure
.phpfiles are not accessible via the web server.
- Test to make sure
- Configure your HTTP server to block access to the folder
/system. FileRun applies a.htaccessfile for Apache and aweb.configfile for IIS. For NGINX, see the file/apps/security.nginxon suggested configuration that you will need to set in your NGINX configuration.- Test to make sure the folder is not accessible via the web server.
- The default user account,
superuser, is the only account not protected against brute force login attacks, so it is very important that you set a password that cannot be guessed by a computer. Set a long password, containing also uppercase letters, digits and symbols. - Don't use FileRun (or any website) via unencrypted HTTP!
- Make sure
session.cookie_httponlyis set toOn, in your server's PHP configuration file, for increased security against cross-site-scripting attacks. - Remove the
ALTERandDROPprivileges from the MySQL user account that FileRun is configured with. An update changes the structure of the database and needs both, so do one of the following when you update:- Give the privileges back before the update, and remove them again afterwards.
- Leave them removed, and let the update use the MySQL
rootaccount instead. The database step of the update offersUse root credentials, with a field for the root password. The update runs asroot, the root password is not stored, and FileRun keeps using its own restricted account afterwards. This option needs the administrative MySQL account to be namedroot.
- Make sure the permissions of the FileRun application files do not allow PHP (or any other system user) to make changes to them. Make an exception for the
system/datafolder and its contents, where FileRun needs to be able to make changes. An update from the control panel replaces the application files, so give PHP write access to them before you update, and take it away again afterwards. - Make sure
display_errorsis set toOff, in your server's PHP configuration file. - Do not expose the MySQL/MariaDB database server to the Internet. Do not leave the root account without a password.