Security Checklist/Joomla! Setup
From Joomla! Documentation
< Security ChecklistRevision as of 02:07, 22 October 2008 by Rliskey
- 1 Configuring Joomla!
- 2 Extending Joomla!
- 3 Additional Joomla! hardening Tips and Tricks
Install official versions of Joomla!
- To avoid braking your site, search the forums for reports of incompatible extensions before upgrading to a new version of Joomla.
- Upgrade to the latest stable version of Joomla! as soon as possible.
- Use Joomla Diagnostics to ensure that all files were installed correctly. (Note: the version of Joomla Diagnostics made for the initial release of 1.5 does not work for 1.5.3.)
Change the default administrator username
- Change the user name of the default admin user. This simple step greatly increases the security of this critical account by modifying one of the two variables attackers can use to gain admin access. The admin password is the other variable. Change it early and often.
Protect directories and files
- Increase the security of the critical configuration.php file by moving it outside of the public_html directory.
- Ensure that all configurable paths to writable or uploadable directories (document repositories, image galleries, caches) are outside of public_html. Check third party extensions such as DOCMan and Gallery2 for editable paths to writable directories. There is currently no easy way to move the Joomla! /image and /media directories. The best plan is to make sure open_basedir is properly set for all the user accounts on your server. Check with your host if unsure.
Adjust file and directory permissions
- Once your site is configured and stable, write-protect critical directories and files by changing directory permissions to 755, and file permissions to 644. There is a feature in Site --> Global Configuration --> Server to set all folder and file permissions at once. Test third party extensions afterwards, and carefully review the code of any extension that has trouble with such settings. Note: Depending on your server's permissions, you may need to temporarily reset to more open permissions when installing more extensions with the Joomla! installer.
Remove unneeded templates
- Remove all design templates not needed by your site. Never put security logic into template files.
- Delete leftover files. The installation process will require you to delete the installation directory and all its contents. Do this; do not simply rename it. If you upload files to your site as compressed archives (xxxx.zip for example), don't forget to remove the compressed file. In general, do not leave any unneeded files (compressed or otherwise) on a public server.
Turn Register Globals Emulation OFF
- Also turn Joomla's Register Globals Emulation OFF. Although this setting is somewhat safer than PHP register_globals by itself, you are much better off avoiding such settings (as well as any applications that require them). This setting is found in the Back-end, under Global Settings. This setting does not exist in Joomla 1.5.
- For more information on register_globals, please see the section on PHP register_globals.
Backup before installing
- Before installing new extensions, always do a quick backup of your site's files and database. This follows a very basic and key principle:
- Thou shalt at all times be able to return your site to a previous working state if something goes wrong.
- Therefore, it's smart to set up a simple and fast backup script to automated this task. If you don't setup a simple process in advance, you'll be sorely tempted at some point to do a quick upgrade without backing. This very understandable tendency is, however, one of the chief causes of premature developer death.
Check for extension vulnerabilities
- Most security vulnerabilities are caused by third party extensions. Before installing extensions, check the Official List of Vulnerable 3rd Party/Non Joomla! Extensions. There's an entire forum dedicated to vulnerable third part extensions. Subscribe to it.
Download from trusted sites
- The fully qualified and official definition of a "trusted site" is one that YOU trust.
User beware! Check the code quality
- Third party extensions come in all flavors of quality and age. Although Joomla! coding standards exist, third party developers are not required to follow them. Extensions listed on the official Joomla! site are not reviewed for compliance, however if verified vulnerabilities are reported, they will be removed from the list until they are fixed.
Test, test, test...
- Test all extensions on a development site before installing on a production site. Then test on the production site. Don't forget the check the logs for runtime errors and warnings.
Remove junk files
- Remove all unused extensions and double check that related folders and files were actually removed by uninstall scripts. Note that during uninstall, many third party extensions will leave related files on your site, and related database tables complete with data. This is either a feature or a bug depending on your point of view. Any files left on your server remain accessible from the Web via direct URLs, such as http://yousite.com/modules/bad_module.
Avoid encrypted code
- Joomla is (and dispite disinformation campaigns, always has been) a GNU GPL project. This means that all extensions to Joomla must also be free (as in freedom) and open (as in readable code). Encrypted code may be safe, but you can't determine this for yourself, and so you must trust the developers. Using others' encrypted code puts you back in the world of proprietary software where you must wait for security patches from the developer, hoping that attackers don't find your site first before a fix is released.
- You are often not free to modify, improve, or share encrypted code. These restrictions make encrypted code less valuable to the community as a whole, and reduce the overall viability of the Joomla project which depends on open sharing among all participants.
- Of course, code that is not distributed to others is exempt from GNU GPL distribution requirements. Thus you can encrypt Joomla-related code your own servers providing you do not share it with others.
Additional Joomla! hardening Tips and Tricks
- For maximum security, avoid a shared server on which you don't know or can't trust all the other users or their code quality.
Use an SSL server
- SSL servers are currently the only way to securely process confidential transactions and secure user authentication. SSL works by encrypting all HTTP communications between the Web server and Web clients. Thus, even if a transmission is intercepted, it can not be read.
- Joomla! 1.0.x does not allow you to assign an SSL server to individual sub-directories. Search the forums for "Tommy Hack" for one way to deal with this. Joomla! 1.5 has greatly improved SSL options.
Use Apache's .htaccess
- For an additional layer of password protection, you can use .htaccess to password protect critical directories. This is usually adequate for blocking the typical script kiddie, but be aware that .htaccess password protection alone is not a highly secure method. It MUST be combined with an SSL server for maximum protection. An SSL server is required for protecting your site from more sophisticated attacks, such as packet sniffing.
Switch to Joomla! 1.5
- The most significant upgrade in Joomla!'s history includes powerful security and performance enhancements.
Add Joomla! Security Announcements to your site
- The Joomla! Security Team supports and RSS feed that provides the latest Joomla security information. The following FAQ explains how to add this feed to your site.