Typo3 Security Cookbook v-0.5
Typo3 Security Cookbook v-0.5
Introduction
Basically being the result of a discussion at T3Board04 in Kitzbühel, this document will of course have grow in the future. If you
want to contribute by adding new chapters, please send your text to the author of this document.
Requirements
The checklist ties up on a working TYPO3 environment. It is not intended to be another installation manual!
Thus, you can just install your server as usual, and use this list for checking each chapter one by one.
TYPO3
Secure the Install Tool
Priority: High
Explanation of Backgrounds: The TYPO3 Install Tool is the powerful center of your TYPO3 system. As a basic rule, it should
never be accessible from the Web unless you actually need it.
Measures:
disable the Install Tool (remove the comment in front of the “die()” line in typo3/install/index.php) OR
move away the typo3/install/ directory or make it inaccessible for the web server OR
limit access to typo3/install to specific hosts / networks / domains (using .htaccess) – depreciated !
you may want to add .htaccess authentication (though also not considered secure)
at LEAST make sure to change the Install Tool password to a non-trivial value
Avoid config.baseURL=1
Priority: High
Explanation of Backgrounds: In older versions, your cache may be poisoned, resulting in foreign pages being displayed
instead of your own.
Measures:
use the absolute URL instead OR
make sure the website can only be accessed with the correct URL (i.e. use name based virtual hosts in your web server)
FE User Security
Priority: Medium
Explanation of Backgrounds: Please take your FE users security concerns seriously, i.e. protect their sensitive data.
Measures:
Use SSL for FE logon
Use SSL for FE user self-registration and password change
Use SSL for all sensitive data like forms (not only credit card data…) or personal output
do not store FE user passwords in clear - use an extension like kb_md5fepw, or use secure external password storage like
LDAP (preferably via SSL) with MD5
Logging / Auditing
Priority: High
Explanation of Backgrounds: Know your log files, and be sure they are configured to audit all information you need.
Measures:
The sys_log table is your default BE user log (accessible via Tools->Log)
xxxxxxxxxxxxxxxxx you can enable additional logging using the [logfile_dir] and [logfile_write] Keywords
The [trackBeUser] setting is intended for debug purposes
The [enable_DLOG] (in conjunction with constant TYPO3_DLOG)
Error Handling
Priority: Medium
Explanation of Backgrounds: Even if you try to avoid it – your system may run into one (or more :-) errors one day - so "be
prepared". Make sure errors are tracked, and user output is convenient and does not expose any internal information.
Measures:
PHP errors should be handled, but normally through PHP means (see below). Thus [displayErrors] should be set to 0.
More a cosmetical thing: TYPO3-internal "Page not Found" errors can be configured using the [pageNotFound_handling] and
[pageNotFound_handling_statheader] setting.
Apache
In httpd.conf don't load modules, you don't need. Best is not to even install them. Directory listing for example is not needed.
This can be done via php script if needed
Only install required modules
disable version info in error pages, tell possible attackers as little as possible
MySQL
dissallow network connections to mysql, if needed, tunnel it through a secure connection (stunnel)
don't use the mysql root user, use one user per database
set an own password for mysql root user, don't use the server root password
General
problems according to shared hosting
requirements to the isp
activate su_exec
don't store passwords on servers ! If you need a password.txt file: store it on a sheet of paper, or on a box which is not
connected to the web. (i know, this one is nagging, but ...)
subscribe to the security lists of your distribution / Operating System Vendor. (OS, ssh, apache, php, mysql, openssl, …)
if possible, run updates daily through a cron job
try to use secured connections for all protocols (sftp, etc)
restrict acces for users only to needed directories ( i.e. Proftpd: users home = htdocs ; DefaultRoot = ~)
monitor your servers to see, if something unusual happens (i.e. nagios, tripwire, tiger, logsurfer, ...)
harden system (disabel unneeded services, remove compilers, ...)
protect phpMyAdmin with .htaccess
don't do dumps or backups to fileadmin or htdocs, if you use backup extensions, delete the backups after downloading them.