What are the actions that one should take after a new Joomla installation in order to keep it secure? Both on shared hosting servers and dedicated ones.
9 Answers
Keeping a Joomla Website Secure
- Use strong passwords.
- Minimise the number of administrator accounts.
- Disable or remove unused user accounts.
- Minimise the number of third party extensions and where third party extensions are necessary, use well supported extensions from established developers you trust.
- Regularly apply the latest updates to Joomla and third party extensions including security hotfixes for Joomla EOL versions where applicable.
- Subscribe to the Joomla Security News feed so you are kept informed of core Joomla security updates
- Subscribe to the Joomla Vulnerable Extensions List (VEL) so new vulnerabilities can be quickly attended to. Scroll to the bottom of the page for the subscription link - you can also follow the VEL on Twitter.
- Use good quality secure web hosting including an appropriate PHP file handler such as suPHP or FastCGI and security extensions such as mod_security. Use a supported version of PHP.
- Rather than relying solely on your web hosting company backups, regularly perform your own backups of the website, copy the backup files off-site and regularly run test restores to a test location to check the quality of your backups.
- Enable https.
- Implement a web application firewall such as that provided with the professional version of Akeeba Admin Tools.
- Don't use the standard table prefix.
- Change the default Super Administrator user name and ID to something else. The professional version of Akeeba Admin Tools has a tool to change the Super Administrator ID.
- Restrict access to the Joomla Admin by IP. Only allow trusted IPs.
- Enable 2 factor authentication for administrator accounts (applies to Joomla 3.2 and later).
- Repeat the above steps for other websites that share the same hosting account or ideally, separate websites to their own web hosting accounts to prevent cross contamination.
- Ensure the personal computers of website administrators are similarly secured. For example, implement a good quality virus and malware scanner. This helps protect any website credentials that are stored on personal computers. Ideally use an encryption tool or application to store website and other credentials.
- Read the Top 10 stupidest administrator tricks for information on what not to do.
For more detailed instructions, see the official Security Checklist.
-
This list can probably be added to (feel free to edit). :) Commented Apr 23, 2014 at 11:48
-
2Maybe you could link to the "Vulnerable Extensions list"? (I can't seem to edit your answer for some reason; I can edit others?)– MrWhiteCommented Apr 23, 2014 at 15:07
-
Thanks @w3d - I have added a link to the VEL subscription page and also to the Joomla Security News feed too. Commented Apr 24, 2014 at 1:08
-
That's just total bullcrap to follow so many steps to secure CMS. Just use WordPress and be done with it. It's so easy to get Joomla site hacked. Joomla and Drupal are dead, WordPress will continue to evolve and dominate the rest. I dumped Joomla long time back and I don't think it's a viable option for a serious project. Good luck messing with unending security options.– RaymondCommented Mar 30, 2022 at 13:12
-
Hi @Raymond, most of this advice applies equally to WordPress, Drupal and probably any CMS you can think of. Security is an exercise in risk management and it makes sense to take precautions especially the steps that are easy to do and cost you nothing! Expending effort on preventing websites from being hacked may be easier than trying to fix a hacked website where there can never be absolute certainty that all malware has been found and fixed. Commented Mar 31, 2022 at 23:34
It's very important to store backups on a separate server. I see a lot of people who are faithfully running Akeeba Backups... and they're being stored on the same server in the same root directory. Not so helpful if you are hacked in a serious way, and certainly not helpful to recover from a hosting failure.
Akeeba Backup Pro allows you to store and manage backup files in external storage like the Amazon cloud.
-
4It is also important to check your backups for corrupted compression after transfer from your hosting directory. A corrupted backup is no backup. This goes for all backup systems, Akeeba, CPanel and so on.– UhlBelkCommented Apr 24, 2014 at 15:58
As an alternative to .htaccess file or locking it down by IP, you can also use jSecure to secure your admin login.
One thing that hasn't been mentioned is using a reputable hosting provider. You want one that not only keeps up with security but will also work with you if you are hacked or there is a problem (database gets corrupted for example). The idea is to limit the damage your site does while allowing you to get it cleaned up.
The basic idea, you want someone who..
- will be around
- isn't a fly-by-night operation
- will work with you
- and provides a solid environment.
If you want a list of questions to ask a host to get a better feeling, just let me know.
Hope this helps.
Try this too,
- Keep your Joomla up-to-date together with its extensions.
- Keep regularly backups of your site in clouds.
- Do not open
robots.txt
for secured folders. - For the latest Joomla versions, making use of the two-factor authentication will be more secure.
- Make sure folders and files have the right permissions allowed.
- Use Cloudfare for Joomla.
Hope its helps..
Basically in my experience, with the size of Joomla there is no way to truly secure it completely. So rather then a perfect security policy that stops it all, its best to bring your expectations down to try and lower the overall damage.
This can be done with an extremely frequent backup policy so that at any intrusion the site can be rolled back, as well as malware scans. So far not one hack we have had was due to our admin panel being brute forced.
Most hacks we see are from third party components or the Joomla core, we have even seen hacks manage to get into the latest versions of Joomla as well. This is because the hack can typically look like a normal request, using bad filtering to push a file onto the server. Once a file is on the server everything is fair game, it can be on ANY site in an entire shared server and still affect yours, so if one person on a shared server does not keep up to date, it can affect you.
This may be a little extreme, but based on personal experience its best to be prepared for the worst, then overconfident that your policy will prevent it all.
So the best way to secure a new Joomla install is to backup often and enable malware scans, if the malware scanner can email you as soon as it finds something, then you can roll back to the latest backup within a very short timeframe.
-
"bring your standards down"??? Should that maybe have been "improve your standards?– chesedoCommented Apr 24, 2014 at 6:52
-
Figured this would get a down vote, I just don't want anyone thinking that if they follow guidelines they are safe. Meant bring your standards down as in don't expect not to get hacked, but instead be prepared for it happening. Most people I know might backup once a week or once a month because they feel getting hacked is rare, but its not. Commented Apr 24, 2014 at 16:16
-
Then you should probable have used "bring your expectations down" (of not being hacked) :)– chesedoCommented Apr 24, 2014 at 17:57
-
Good note, edited that, thank you. Not trying to say anything bad about Joomla, I love it, its just fighting with hacks is never going to go away, so its best to be prepared :). Commented Apr 25, 2014 at 19:15
-
Quite correct - sometimes the best way to help is to be straight :).– chesedoCommented Apr 25, 2014 at 20:14
Change username and keep administrator password strong, use two-factor authentication (inbuilt for 3.3+, for others http://www.readybytes.net/labs/two-factor-authentication.html)
Install kSecure (http://extensions.joomla.org/extensions/access-a-security/site-security/login-protection/12271)
Safeguard your website from various attacks by using this htaccess http://docs.joomla.org/Htaccess_examples_(security)
Borrowing this list from a whitepaper "Pen-testing a Joomla site" found on blog. I think this list is a thorough guideline for the basics of Joomla security.
- Always keep you Joomla up to date. Install the latest upgrade as soon as the upgrade is released.
- Whatever extensions are being used, they must be properly patched with latest upgrade releases. Any old extension may give attacker a way to compromise the site.
- Do not use extensions which have not being used by, or which have not been tested properly.
- All user inputs must be properly validated. These inputs can be inputs in forms, URI, image uploads, etc. Suppose if a BROWSE button enables the user to upload the image, it must only enable him to upload an image and not a PHP shell which may later work like a backdoor on the server.
Use strong passwords for all logins. At least 8 characters, one special character, one number, and one case sensitive letter. It will protect your installation from a brute force.
Always keep a track of “Latest Visitors” in the Web Server’s log files for catching potential attacks. Never consider your log files just a piece of information. It is highly useful in tracking and monitoring the users.
Put some stress to implement more security to the whole server on which you Joomla based site is hosted; being it hosted on shared server or a dedicated one.
Make a list of all the extensions you use and keep monitoring them.
Keep yourself up to date with latest vulnerabilities and disclosures at various security advisories. Exploit-db, osvdb, CVE, etc. are some of the good resources.
Change the permission on your .htaccess file as it is by default using write permissions (as Joomla has to update it). The best practice is to use 444 (r-xr-xr-x).
Proper file permissions on the public directories must be given so that any malicious file must not be uploaded or executed. The best practice in this context is 766 (rwxrw-rw-), i.e. only Owner can read, write and execute. Others can only read and write.
No one must have the permission to write into PHP files on the server. They all must be set with 444 (r—r—r--), everyone can read only.
Delegate the roles. It makes your Administrator account goes safe. In case someone hacks into your machine, it must have access to the respective user only, and not the administrator account.
The database users must only have permission to give commands like INSERT, UPDATE, and DELETE rows. They must not be allowed to DROP tables.
Change the names of backend folders, e.g. you can change /administrator to /admin12345. 16. Last but not the least, keep updated with latest vulnerabilities.
- The complete whitepaper can be found here: http://www.exploit-db.com/wp-content/themes/exploit/docs/22763.pdf
-
Further suggestion ad 12: no one except the Web server must have permission to read the PHP files on the server too. Set the user to the Web server's user (www-data or http) and set it to 400, or 600 for editable files through backend (css,...). Commented Feb 9, 2017 at 22:23
Your first line of defense is your hosting service
- Lease a dedicated server from a reliable hosting service
- Ensure that you activate 2FA on your server and use a 'VERY STRONG' password
- Install a reliable firewall on your server - I use ConfigServer
- Install / Configure an anti-virus program, I use ClamAV
- Ensure that each website username does NOT use the 1st 8 characters of the domain name and uses a 'VERY STRONG' password
- Ensure each website has a SSL certificate installed
- Ensure each website is 'In Jail' meaning they do not have root access unless you need access to the server root. In that case, ensure you have Secure Shell (SSH) installed and configured. I use my server domain website but have all other websites 'In Jail'.
- Ensure that all server updates are installed promptly!!!!
Your next line of defense is your cPanel
- Use a "VERY STRONG" password
- Configure user password strength for users
- Setup a cron job to do a cPanel full backup and save to an external source
- Ensure that cPanel has been setup to use SSL for access
- Run 'Site Security Check' to see what other tweaks may be needed
- Ensure that all cPanel updates are installed promptly!!!!
Your next line of defense is your administrator panel
- Edit the password format requirements to ensure strong passwords (Upper/lower case characters, numbers and at least 1 punctuation mark with a minimum length of 18 characters.
- Enable 2FA for users - Use for Super User and Administrator accounts
- Limit the # of Super User accounts (best to have just one)
- Limit the # of Administrator accounts (the fewer the better)
- Limit the areas that Administrators can access
- Limit the areas that Publishers,Editors and Authors can access
- Install and configure AdminTools
- Setup an administrator URL password via AdminTools
- Ensure that critical files (HTACCESS, ROBOTS.TXT, WEBCONFIG, INDEX.PHP (both root and template) are set to 444. You can still the files edit via cPanel pr Plesk control panel file manager
- Install and configure AkeebaBackup
- Configure AkeebaBackup to save backups externally, offsite
- Only install add-on's via the Joomla Extension pages, never install an add-on from a 3rd party that is not listed on the Joomla Extension page.
- Disable and/or uninstall add-on's that are not used and are not needed for Joomla functionality
- Install Joomla and add-on updates promptly!!!
I'm sure there are other steps but these are the main ones that I use on my server hosting over 70 websites from around the country. I recently had a massive attack similar to a DDoS attack and not one website was accessed. I kind of felt 10 feet tall and bullet proof but I know I can't be complacent as tomorrow is another day! LOL
I'm not a fan of two-factor authentication
Install Akeeba Admin Tools, enable advanced htaccess, check the options and the software firewall
https://www.akeebabackup.com/download/admin-tools.html
- Enable backend Url password
-
1Would you mind to share why you are not a fan of two-factor authentication?– chesedoCommented Apr 24, 2014 at 6:54
-
2I see - that makes sense. But why include not using it amongst the points to help with security? If you do want it in your post then why not have it as a side note together with the reason?– chesedoCommented Apr 24, 2014 at 11:17
-
1You are right. I'm just learning how to answer questions here ;-) BTW This answer received -2 :-(– AnibalCommented Apr 24, 2014 at 13:00
-
4Let's leave it as a first naive answer on the system of this author. It has some charm in its own way.– AnibalCommented Apr 24, 2014 at 21:54
-
1Hehe! Really, the point of the SE system is 'get the best answers' or making good answers better - I would suggest that your answer, with it's explanation could be deleted and added as a comment, as together with explanation it does enhance one's understanding of the impact of 2 factor authentication when addressing security.– NivF007Commented Apr 25, 2014 at 2:01