{"id":702,"date":"2012-01-29T17:46:24","date_gmt":"2012-01-29T17:46:24","guid":{"rendered":"https:\/\/noi3.org\/site\/?p=702"},"modified":"2012-01-29T17:46:24","modified_gmt":"2012-01-29T17:46:24","slug":"joomla-how-to-site-security","status":"publish","type":"post","link":"https:\/\/site.noi3.org\/?p=702","title":{"rendered":"Joomla How To: Site Security"},"content":{"rendered":"<p> \tSecurity matters<br \/> \t&nbsp;<\/p>\n<p> \tInternet security is a fast moving challenge and ever present threat. There is no one right way to secure a website, and all security methods are subject to instant obsolescence, incremental improvement, constant revision. All public facing website are open to constant attack. Are you willing and able to invest the time it takes to administer a dynamic, 24&#215;7, world-accessible, database-driven, interactive, user-authenticated website? Do you have the time and resources to respond to the constant flow of new Internet security issues?<\/p>\n<p> \tThe <a href=\"http:\/\/docs.joomla.org\/Top_10_Stupidest_Administrator_Tricks\" title=\"Top 10 Stupidest Administrator Tricks\">Top 10 Stupidest Administrator Tricks<\/a> is a comic\/tragic look at what can go wrong. Don&#39;t learn these tricks the hard way! Depending on your own experience, reading the <em>Stupidest Tricks<\/em> will either make you laugh or cry. Luckily, there are some well-established principles upon which to base your defensive plans. The following checklists point you toward current best practices for Joomla security.<\/p>\n<p>  <!--more-->  <\/p>\n<p> \tSecurity matters<br \/> \t&nbsp;<\/p>\n<p> \tInternet security is a fast moving challenge and ever present threat. There is no one right way to secure a website, and all security methods are subject to instant obsolescence, incremental improvement, constant revision. All public facing website are open to constant attack. Are you willing and able to invest the time it takes to administer a dynamic, 24&#215;7, world-accessible, database-driven, interactive, user-authenticated website? Do you have the time and resources to respond to the constant flow of new Internet security issues?<\/p>\n<p> \tThe <a href=\"http:\/\/docs.joomla.org\/Top_10_Stupidest_Administrator_Tricks\" title=\"Top 10 Stupidest Administrator Tricks\">Top 10 Stupidest Administrator Tricks<\/a> is a comic\/tragic look at what can go wrong. Don&#39;t learn these tricks the hard way! Depending on your own experience, reading the <em>Stupidest Tricks<\/em> will either make you laugh or cry. Luckily, there are some well-established principles upon which to base your defensive plans. The following checklists point you toward current best practices for Joomla security.<\/p>\n<h3> \tThe most important guidelines<\/h3>\n<dl>\n<dd> \t\tThese checklists are long and growing because the full plot is thick, complex, and expanding, but don&#39;t despair! Here are a few essential guidelines for securing any website. Following them will protect you from most catastrophes.<\/dd>\n<\/dl>\n<ol>\n<li> \t\t<strong>Backup early and often:<\/strong> Setup (and use and test) a regular backup and recovery process. When done well, this ensures that you can recover from almost any imaginable disaster.<\/li>\n<li> \t\t<strong>Update early and often:<\/strong> Promptly update to the latest <em>stable<\/em> version of Joomla! and any installed third-party extensions. This ensures that your site is protected from the newest vulnerabilities as soon as a fix is released and from the latest attack methods as soon as a defense is developed.<\/li>\n<li> \t\t<strong>Use a secure host<\/strong> Use a high-quality Web host. Do not be fooled by offers of &#39;unlimited bandwidth, unlimited hard drive space, unlimited databases, etc.<\/li>\n<li> \t\t<strong>Use the community<\/strong> Don&#39;t forget the truism, &quot;If a deal is too good to be true, it is.&quot; It seems that nothing on Earth is unlimited&#8211;except perhaps the gullibility of fools and the greed of those who prey upon them. Consider hiring professional assistance if you have inadequate experience or knowledge in this area. One of the advantages of GNU software is that user support is free. Take good advantage of this by asking good questions within the <a href=\"http:\/\/forum.joomla.org\/\" rel=\"nofollow\" title=\"http:\/\/forum.joomla.org\">Joomla! Forums<\/a>. When doing so, be sure to use the the most appropriate board, such as Installation, Migration and Updating, Administration.<\/li>\n<\/ol>\n<h3> \tThe bad news<\/h3>\n<ol>\n<li> \t\t<strong>There is no perfect security on the Web!<\/strong> As economists would say, &quot;There&#39;s no free lunch.&quot; Don&#39;t be fooled by Joomla&#39;s award winning ease-of-use. Maintaining a secure Web site on the open Internet is not easy. Maintaining adequate security requires a wide and ever-growing range of skills and knowledge, constant watchfulness, and a robust backup and recovery process.<\/li>\n<li> \t\t<strong>There&#39;s no one right way!<\/strong> Due to the variety and complexity of modern web systems, security issues can&#39;t be resolved with simple, one-size-fits-all solutions. You (or someone you trust) must learn enough about your server infrastructure to make valid security decisions. Strong security is a moving target. Today&#39;s expert might be tomorrow&#39;s victim. Welcome to the game&#8230;<\/li>\n<li> \t\t<strong>There&#39;s no substitute for experience!<\/strong> To secure your Web site, you must gain real experience (some of which will be bitter), or get experienced help from others. If you haven&#39;t invested the considerable time it takes to learn how to maintain a secure Web site, be sure you can consult with someone who has. Read this tongue-in-cheek description of the <a href=\"http:\/\/docs.joomla.org\/Top_10_Stupidest_Administrator_Tricks\" title=\"Top 10 Stupidest Administrator Tricks\">Top 10 Stupidest Administrator Tricks<\/a> which illustrates typical, blow-by-blow examples of how to learn Web security the hard way.<\/li>\n<\/ol>\n<hr \/>\n<h2> \tChoose a Qualified Hosting Provider<\/h2>\n<p> \t<a id=\"The_most_important_decision\" name=\"The_most_important_decision\"><\/a><\/p>\n<h3> \tThe most important decision<\/h3>\n<dl>\n<dd> \t\tProbably no decision is more critical to site security than the choice of hosts and servers. However, due to the wide variety of hosting options and configurations, it&#39;s not possible to provide a complete list for all situations. Check this unbiased <a href=\"http:\/\/forum.joomla.org\/viewtopic.php?t=6856\" rel=\"nofollow\" title=\"http:\/\/forum.joomla.org\/viewtopic.php?t=6856\">list of recommended hosts<\/a>who fully meet the security requirements of a typical Joomla site. (<a href=\"http:\/\/docs.joomla.org\/Security_and_Performance_FAQs#How_do_I_choose_a_quality_hosting_provider.3F\" title=\"Security and Performance FAQs\">FAQ<\/a>)<\/dd>\n<\/dl>\n<p> \t<a id=\"Shared_server_risks\" name=\"Shared_server_risks\"><\/a><\/p>\n<h3> \tShared server risks<\/h3>\n<dl>\n<dd> \t\tIf you are on a tight budget and your site does not process highly confidential data, you can probably get by with a shared server, but you must understand the unavoidable risks. Most of the tips listed below are appropriate for securing sites on shared server environments.<\/dd>\n<\/dl>\n<p> \t<a id=\"Avoid_sloppy_server_configurations\" name=\"Avoid_sloppy_server_configurations\"><\/a><\/p>\n<h3> \tAvoid sloppy server configurations<\/h3>\n<dl>\n<dd> \t\tFor a real eye-opener, <a href=\"http:\/\/www.nexen.net\/articles\/dossier\/php_configuration_statitstics.php\" rel=\"nofollow\" title=\"http:\/\/www.nexen.net\/articles\/dossier\/php_configuration_statitstics.php\">read this report<\/a> on thousands of sites that allowed Google to index the results of phpinfo(). Don&#39;t make this mistake on your site! The report includes alarming statistics on the percentage of sites that use depreciated settings such as register_globals ON or that don&#39;t have open_basedir set at all: By the way, if <em>phpini<\/em> and <em>register_globals<\/em> are unfamiliar terms you are probably not ready to securely manage your own site.<\/dd>\n<dd>\n<hr \/>\n<\/dd>\n<\/dl>\n<p> \t<a id=\"Configuring_Apache\" name=\"Configuring_Apache\"><\/a><\/p>\n<h2> \tConfiguring Apache<\/h2>\n<p> \t<a id=\"Use_Apache_.htaccess\" name=\"Use_Apache_.htaccess\"><\/a><\/p>\n<h3> \tUse Apache .htaccess<\/h3>\n<p> \t<em>See also <a href=\"http:\/\/docs.joomla.org\/Htaccess_examples_%28security%29\" title=\"Htaccess examples (security)\">.htaccess examples<\/a><\/em><\/p>\n<dl>\n<dd> \t\tBlock typical exploit attempts with local Apache <em>.htaccess<\/em> files. This option is not enabled on all servers. Check with your host if you run into problems. Using <em>.htaccess<\/em>, you can password protect sensitive directories, such as administrator, restrict access to sensitive directories by IP Address, and depending on your server&#39;s configuration, you may be able to increase security by switching from PHP4 to PHP5.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tJoomla ships with a <a href=\"http:\/\/docs.joomla.org\/Preconfigured_.htaccess\" title=\"Preconfigured .htaccess\">preconfigured .htaccess<\/a> file, but *you* need to choose to use it. The file is called htaccess.txt; to use it rename it to .htaccess and place it in the root of your webpage.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tConsider following the &quot;Least Privilege&quot; principle for running PHP using tools such as PHPsuExec, php_suexec or suPHP. (Note: These are advanced methods that require agreement and coordination with your hosting provider. Such options are enabled or disabled on a server-wide basis and are not individually adjustable on shared servers.)<\/dd>\n<\/dl>\n<p> \t<a id=\"Use_Apache_mod_security\" name=\"Use_Apache_mod_security\"><\/a><\/p>\n<h3> \tUse Apache mod_security<\/h3>\n<dl>\n<dd> \t\tConfigure Apache mod_security and mod_rewrite filters to block PHP attacks. See <a href=\"http:\/\/www.google.com\/search?q=apache%20mod_security\" rel=\"nofollow\" title=\"http:\/\/www.google.com\/search?q=apache%20mod_security\">Google search for mod_security<\/a> and <a href=\"http:\/\/www.google.com\/search?q=apache%20mod_rewrite\" rel=\"nofollow\" title=\"http:\/\/www.google.com\/search?q=apache%20mod_rewrite\">Google search for mod_rewrite<\/a>. (Note: These are advanced methods that usually require agreement and coordination with your hosting provider. Such options are enabled or disabled on a server-wide basis and are not individually adjustable on shared servers.)<\/dd>\n<\/dl>\n<p> \t<a id=\"Configuring_MySQL\" name=\"Configuring_MySQL\"><\/a><\/p>\n<hr \/>\n<p> \t&nbsp;<\/p>\n<p> \t&nbsp;<\/p>\n<h2> \tConfiguring MySQL<\/h2>\n<h3> \tSecure the database<\/h3>\n<dl>\n<dd> \t\tBe sure MySQL accounts are set with limited access. The initial install of MySQL is insecure and careful configuration is required. (See the <a href=\"http:\/\/dev.mysql.com\/doc\/\" rel=\"nofollow\" title=\"http:\/\/dev.mysql.com\/doc\/\">MySQL Manuals<\/a>) Note: This item applies only to those administering their own servers, such as dedicated servers. Users of shared servers are dependent on their hosting provider to set proper database security.)<\/dd>\n<\/dl>\n<h2> \tConfiguring PHP<\/h2>\n<h3> \tUnderstand how PHP works<\/h3>\n<dl>\n<dd> \t\tUnderstand how to work with the php.ini file, and how PHP configurations are controlled. Study the <a href=\"http:\/\/us3.php.net\/manual\/en\/ini.php#ini.list\" rel=\"nofollow\" title=\"http:\/\/us3.php.net\/manual\/en\/ini.php#ini.list\">Official List of php.ini Directives<\/a> at <a href=\"http:\/\/www.php.net\/\" rel=\"nofollow\" title=\"http:\/\/www.php.net\">http:\/\/www.php.net<\/a>, and the well-documented default php.ini file included with every PHP install. Here is the <a href=\"http:\/\/cvs.php.net\/viewvc.cgi\/php-src\/php.ini-dist?view=co\" rel=\"nofollow\" title=\"http:\/\/cvs.php.net\/viewvc.cgi\/php-src\/php.ini-dist?view=co\">latest default php.ini file<\/a> on the official PHP site.<\/dd>\n<\/dl>\n<h3> \tUse PHP5<\/h3>\n<dl>\n<dd> \t\tCurrently, both PHP4 and PHP5 are maintained, and both are often available on servers. Before PHP4 becomes obsolete, upgrade your custom scripts to PHP5. Don&#39;t worry about core Joomla code; all current versions are PHP5 compatible. (See <a href=\"http:\/\/www.php.net\/\" rel=\"nofollow\" title=\"http:\/\/www.php.net\/\">PHP News<\/a>)<\/dd>\n<\/dl>\n<h3> \tUse local php.ini files<\/h3>\n<dl>\n<dd> \t\tOn shared servers you can&#39;t edit the main php.ini file, but you may be able to add custom, local php.ini files. If so, you&#39;ll need to copy the php.ini files to every sub-directory that requires custom settings. Luckily a <a href=\"http:\/\/tips-scripts.com\/free\" rel=\"nofollow\" title=\"http:\/\/tips-scripts.com\/free\">set of scripts at B &amp; T Scripts and Tips<\/a> can do the hard work for you.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\t<strong>There are a few important things to keep in mind.<\/strong><\/dd>\n<\/dl>\n<ol>\n<li> \t\tLocal <em>php.ini<\/em> files <em><strong>only<\/strong><\/em> have an effect if your server is configured to use them. This includes a <em>php.ini<\/em> file in your <em>http_root<\/em> directory. You can test whether or not these file affect your site by setting an obvious directive in the local <em>php.ini<\/em> file to see if it affects your site.<\/li>\n<li> \t\tLocal <em>php.ini<\/em> files only effect <em>.php<\/em> files that are located within the same directory (or included() or required() from those files). This means that there are normally only two Joomla! directories in which you would want to place a <em>php.ini<\/em> file. They are your <em>http_root<\/em>(your actual directory name may vary), which is where Joomla&#39;s Front-end <em>index.php<\/em> file is located, and the Joomla! <em>administrator<\/em> directory, which is where the Back-end administrator <em>index.php<\/em> file is located. Other directories that don&#39;t have files called via the Web do not need local <em>php.ini<\/em> files.<\/li>\n<li> \t\tIf you have a <em>php.ini<\/em> file in every directory, some script probably did this for you. If you didn&#39;t intend it to happen, you probably should root them out, but given #2 above, you probably only have to panic about the <em>php.ini<\/em> files in <em>http_root<\/em> and the <em>administrator<\/em> directories.<\/li>\n<\/ol>\n<h3> \tUse PHP disable_functions<\/h3>\n<dl>\n<dd> \t\tUse <em>disable_functions<\/em> to disable dangerous PHP functions that are not needed by your site. Here is a typical setup for a Joomla! site:<\/dd>\n<\/dl>\n<pre>      disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open<\/pre>\n<h3> \tUse PHP open_basedir<\/h3>\n<dl>\n<dd> \t\t<em>open_basedir<\/em> should be enabled and correctly configured. This directive limits the files that can be opened by PHP to the specified directory-tree. This directive is NOT affected by whether Safe Mode is ON or OFF.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tThe restriction specified with open_basedir is a prefix, not a directory name. This means that <em>open_basedir = \/dir\/incl<\/em> allows access to <em>\/dir\/include<\/em> and <em>\/dir\/incls<\/em> if they exist. To restrict access to only the specified directory, end with a slash. For more information, see <a href=\"http:\/\/us3.php.net\/manual\/en\/features.safe-mode.php#ini.safe-mode\" rel=\"nofollow\" title=\"http:\/\/us3.php.net\/manual\/en\/features.safe-mode.php#ini.safe-mode\">PHP Security and Safe Mode Configuration Directives<\/a>.<\/dd>\n<\/dl>\n<pre>     open_basedir = \/home\/users\/you\/public_html<\/pre>\n<dl>\n<dd> \t\tIn some system configurations, at least with PHP 4.4.8, the use of the trailing slash to restrict the access to only the specified directory may cause Joomla to warn <em>JFolder::create: Infinite loop detected<\/em> when saving the Back-End Global Configuration. This warning is triggered because PHP <em>file_exists()<\/em> function fails, for example, when asked if <em>\/home\/user\/public_html\/joomla_demo<\/em> exists and <em>open_basedir<\/em> is set to <em>\/home\/user\/public_html\/joomla_demo\/<\/em> (see the trailing slash).<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tAdditionally, if <em>open_basedir<\/em> is set it may be necessary to set PHP <em>upload_tmp_dir<\/em> configuration directive to a path that falls within the scope of <em>open_basedir<\/em> or, alternatively, add the <em>upload_tmp_dir<\/em> path to <em>open_basedir<\/em> using the appropriate path separator for the host system.<\/dd>\n<\/dl>\n<pre>     open_basedir = \/home\/users\/you\/public_html:\/tmp<\/pre>\n<dl>\n<dd> \t\tPHP will use the system&#39;s temporary directory when <em>upload_tmp_dir<\/em> is not set or when it is set but the directory does not exist, therefore it may be necessary to add it to <em>open_basedir<\/em> as above to avoid uploading errors within Joomla.<\/dd>\n<\/dl>\n<h3> \tAdjust magic_quotes_gpc<\/h3>\n<dl>\n<dd> \t\tAdjust the <em>magic_quotes_gpc<\/em> directive as needed for your site. The recommended setting for Joomla! 1.0.x is ON to protect against poorly-written third-party extensions. The safest method is to turn <em>magic_quotes_gpc<\/em> off and avoid all poorly-written extensions, period.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tJoomla! 1.5 ignores this setting and works fine either way.<\/dd>\n<\/dl>\n<p> \tFor more information, see either <a href=\"http:\/\/docs.joomla.org\/Magic_quotes_and_security\" rel=\"nofollow\" title=\"http:\/\/docs.joomla.org\/Magic_quotes_and_security\">Magic quotes and security<\/a> or <a href=\"http:\/\/us3.php.net\/magic_quotes\" rel=\"nofollow\" title=\"http:\/\/us3.php.net\/magic_quotes\">PHP Manual, Chapter 31. Magic Quotes<\/a>.<\/p>\n<pre>      magic_quotes_gpc = 1<\/pre>\n<h3> \tDon&#39;t use PHP safe_mode<\/h3>\n<dl>\n<dd> \t\tAvoid the use of PHP safe_mode. This is a valid but incomplete solution to a deeper problem and provides a false sense of security. See the official PHP site for an explanation of this issue.<\/dd>\n<\/dl>\n<pre>      safe_mode = 0<\/pre>\n<h3> \tDon&#39;t use PHP register_globals<\/h3>\n<dl>\n<dd> \t\tAutomatically registering global variables was probably one of the dumbest decisions the developers of PHP made. This directive determines whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables where they become immediately available to all PHP scripts, and where they can easily overwrite your own variable if you&#39;re not careful. Luckily, the PHP developers long since realized the mistake and have depreciated this &#39;feature&#39;.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tIf your site is on a shared server with a hosting provider that insists <em>register_globals<\/em> must be on, you should be very worried. Although you can often turn register_globals off for your own site with a local php.ini file, this adds little security as other sites on the same server remain vulnerable to attacks which can then launch attacks against your site from within the server. For more information, see <a href=\"http:\/\/www.zend.com\/manual\/security.globals.php\" rel=\"nofollow\" title=\"http:\/\/www.zend.com\/manual\/security.globals.php\">ZEND Chapter 29. Using Register Globals<\/a>.<\/dd>\n<\/dl>\n<pre>      register_globals = 0<\/pre>\n<h3> \tDon&#39;t use PHP allow_url_fopen<\/h3>\n<dl>\n<dd> \t\tDon&#39;t use PHP <em>allow_url_fopen<\/em>. This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files using the ftp or http protocol, some extensions like zlib may register additional wrappers. Note: This can only be set in php.ini due to security reasons.<\/dd>\n<\/dl>\n<pre>      allow_url_fopen = 0<\/pre>\n<h2> \tSetup a backup and recovery process<\/h2>\n<h3> \tThe most important rule:<\/h3>\n<dl>\n<dd> \t\tThou shalt at all time be able to return your site to a previous working state through regular use of a strong, off-site backup and recovery process. Be sure your backup and recovery process is in place and tested BEFORE you go live. This is the single best way (and often the only way) to recover from such inevitable catastrophes as:<\/dd>\n<\/dl>\n<ol>\n<li> \t\tA compromised\/cracked site.<\/li>\n<li> \t\tBroken site due to a faulty upgrade.<\/li>\n<li> \t\tHardware failure, such as dead hard drives, power failures, server theft, etc.<\/li>\n<li> \t\tAuthoritarian government intervention. (More common than some think.)<\/li>\n<li> \t\tNeeding to quickly relocate to a new server or hosting provider.<\/li>\n<\/ol>\n<hr \/>\n<h2> \tSite Administration<\/h2>\n<h3> \tUse well-formed passwords<\/h3>\n<dl>\n<dd> \t\tChange passwords regularly and keep them unique. A strong password has a random combination of letters, numbers, or symbols. Avoid using single names or words found in a dictionary. Never use the names of your relatives, pets, etc. Search the forums for a script supplied by Wizzie that automatically changes passwords. This is a great tool for administrators or multiple sites. There are numerous handy websites that have <a href=\"http:\/\/strongpasswordgenerator.com\/\" rel=\"nofollow\" title=\"http:\/\/strongpasswordgenerator.com\">strong password generators<\/a>.<\/dd>\n<\/dl>\n<h3> \tFollow a password leveling scheme<\/h3>\n<dl>\n<dd> \t\tMost users may not need more than three levels of passwords and webmasters no more than five. Each level must be completely unrelated to the others in terms of which usernames and passwords are used. Learn how to do this: <a href=\"http:\/\/docs.joomla.org\/How_do_you_setup_a_powerful_password_scheme%3F\" title=\"How do you setup a powerful password scheme?\">How do you setup a powerful password scheme?<\/a><\/dd>\n<\/dl>\n<h3> \tMaintain a strong site backup process<\/h3>\n<dl>\n<dd> \t\tNever rely on others&#39; backups. Take responsibility for your backup procedures. Many ISPs state in their contract that you can not rely solely on their backups.<\/dd>\n<\/dl>\n<h3> \tMonitor crack attempts<\/h3>\n<dl>\n<dd> \t\tVPS and dedicated server users can run TripWire or SAMHAIN. These applications provide exhaustive file checking and reporting functionality, and can be installed in a stealthy manner to help protect themselves in the event of a serious infiltration. (Note: Users of shared servers can not use this technique.)<\/dd>\n<\/dl>\n<h3> \tPerform automated intrusion detection<\/h3>\n<dl>\n<dd> \t\tUse an Intrusion Prevention\/Detection Systems to block\/alert on malicious HTTP requests.<\/dd>\n<\/dl>\n<ul>\n<li> \t\t<a href=\"http:\/\/www.google.com\/search?q=Intrusion+Prevention\" rel=\"nofollow\" title=\"http:\/\/www.google.com\/search?q=Intrusion+Prevention\">Google search<\/a><\/li>\n<\/ul>\n<h3> \tPerform manual intrusion detection<\/h3>\n<dl>\n<dd> \t\tRegularly check raw logs for suspicious activity. Don&#39;t rely on summaries and graphs.<\/dd>\n<\/dl>\n<h3> \tStay current with security patches and upgrades<\/h3>\n<dl>\n<dd> \t\tApply vendor-released security patches ASAP.<\/dd>\n<\/dl>\n<ul>\n<li> \t\tReview the <a href=\"http:\/\/docs.joomla.org\/Vulnerable_Extensions_List\" rel=\"nofollow\" title=\"http:\/\/docs.joomla.org\/Vulnerable_Extensions_List\">vulnerable extensions<\/a><\/li>\n<\/ul>\n<h3> \tProactively seek site vulnerabilities<\/h3>\n<dl>\n<dd> \t\tPerform frequent web scanning.<\/dd>\n<\/dl>\n<ul>\n<li> \t\t<a href=\"http:\/\/www.google.com\/search?q=%22web+scanning\" rel=\"nofollow\" title=\"http:\/\/www.google.com\/search?q=%22web+scanning\">Google Search<\/a><\/li>\n<\/ul>\n<h3> \tProactively seek SQL injections vulnerabilities<\/h3>\n<dl>\n<dd> \t\tUse tools such as Paros Proxy for conducting automated SQL Injection tests against your PHP applications.<\/dd>\n<\/dl>\n<ul>\n<li> \t\t<a href=\"http:\/\/www.google.com\/search?q=%22SQL+Injection\" rel=\"nofollow\" title=\"http:\/\/www.google.com\/search?q=%22SQL+Injection\">Google Search<\/a><\/li>\n<li> \t\t<a href=\"http:\/\/en.wikipedia.org\/wiki\/SQL_injection\" rel=\"nofollow\" title=\"http:\/\/en.wikipedia.org\/wiki\/SQL_injection\">Wikipedia Article<\/a><\/li>\n<\/ul>\n<h3> \tUse shell scripts to automate security tasks<\/h3>\n<dl>\n<dd> \t\tSearch the forums for these popular scripts:<\/dd>\n<\/dl>\n<ul>\n<li> \t\tJoomla! Version Checking<\/li>\n<li> \t\tJoomla! Component\/Module Version Checking<\/li>\n<li> \t\tExploit Checking<\/li>\n<\/ul>\n<h3> \tLearn about security software<\/h3>\n<dl>\n<dd> \t\tThere is not a single tool that can protect your site. If there were, it would be so heavily targeted that it would probably become a liability.<\/dd>\n<\/dl>\n<h3> \tDon&#39;t reinvent every wheel<\/h3>\n<dl>\n<dd> \t\tEvery now and then hire a professional Joomla! security consultant to review your configurations. Do you remember the adage, <em>&quot;Anyone who acts as their own lawyer has a fool for a client.&quot;<\/em> The same goes for Web development. Don&#39;t expect to catch all of your own security mistakes.<\/dd>\n<\/dl>\n<hr \/>\n<h3> \tInstall official versions of Joomla!<\/h3>\n<dl>\n<dd> \t\tTo avoid breaking your site, search the forums for reports of incompatible extensions before upgrading to a new version of Joomla.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tUpgrade to the <a href=\"http:\/\/www.joomla.org\/download.html\" rel=\"nofollow\" title=\"http:\/\/www.joomla.org\/download.html\">latest stable version of Joomla!<\/a> as soon as possible.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tDownload Joomla! from official sites only, such as <a href=\"http:\/\/joomlacode.org\/\" rel=\"nofollow\" title=\"http:\/\/joomlacode.org\/\">JoomlaCode.org<\/a>, and check the <a href=\"http:\/\/www.joomla.org\/content\/category\/5\/39\/95\/\" rel=\"nofollow\" title=\"http:\/\/www.joomla.org\/content\/category\/5\/39\/95\/\">MD5 hash<\/a>.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tUse <a href=\"http:\/\/extensions.joomla.org\/component\/option,com_mtree\/task,viewlink\/link_id,1146\/Itemid,35\/\" rel=\"nofollow\" title=\"http:\/\/extensions.joomla.org\/component\/option,com_mtree\/task,viewlink\/link_id,1146\/Itemid,35\/\">Joomla Diagnostics<\/a> 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.)<\/dd>\n<\/dl>\n<p> \t<a id=\"Change_the_default_administrator_username\" name=\"Change_the_default_administrator_username\"><\/a><\/p>\n<h3> \tChange the default administrator username<\/h3>\n<dl>\n<dd> \t\tChange the user name of the default admin user. This simple step effectively increases the security of this critical account 50% by modifying one of the two variables attackers must know to gain access. The password is the other variable. Change it early and often. <strong>(<a href=\"http:\/\/docs.joomla.org\/Security_and_Performance_FAQs#Why_should_I_immediately_change_the_name_of_the_default_admin_user.3F\" title=\"Security and Performance FAQs\">FAQ<\/a>)<\/strong><\/dd>\n<\/dl>\n<p> \t<a id=\"Protect_directories_and_files\" name=\"Protect_directories_and_files\"><\/a><\/p>\n<h3> \tProtect directories and files<\/h3>\n<dl>\n<dd> \t\tIncrease the security of the critical <em>configuration.php<\/em> file by moving it outside of the <em>public_html<\/em> directory. For more information visit <strong>(<a href=\"http:\/\/docs.joomla.org\/Security_and_Performance_FAQs#How_do_I_move_confidential_files_outside_of_public_html.3F\" title=\"Security and Performance FAQs\">FAQ<\/a>)<\/strong><\/dd>\n<\/dl>\n<dl>\n<dd> \t\tEnsure 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.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\t<a href=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Image%3ACompat_15.png\" title=\"Image:Compat_15.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-699\" alt=\"Image:Compat_15.png\" border=\"0\" height=\"16\" src=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Compat_15.png\" width=\"75\" \/><\/a> In the Back-End Global Configuration, change the log path. Some extensions use the built in JLog class. This will, by default write logs to <a href=\"http:\/\/yousite\/logs\" rel=\"nofollow\" title=\"http:\/\/yousite\/logs\">http:\/\/yousite\/logs<\/a>. Change this to a place that a casual browser cannot find (and don&#39;t pick \/tmp\/), or lock it down with http authentication. Because we are dealing Open Source software, attackers can read the code of third-party extensions and may be able to guess log file names.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\t<a href=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Image%3ACompat_15.png\" title=\"Image:Compat_15.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-699\" alt=\"Image:Compat_15.png\" border=\"0\" height=\"16\" src=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Compat_15.png\" width=\"75\" \/><\/a> In the Back-End Global Configuration, change the temp folder path.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tIf the log and temp paths are changed and PHP <em>open_basedir<\/em> configuration directive is set, make sure that the new paths fall within the scope of <em>open_basedir<\/em>.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tThere is currently no easy way to move the Joomla! \/image and \/media directories. This is because thousands of third party extensions expect to find these important directories at the current location. 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.<\/dd>\n<\/dl>\n<p> \t<a id=\"Adjust_file_and_directory_permissions\" name=\"Adjust_file_and_directory_permissions\"><\/a><\/p>\n<h3> \tAdjust file and directory permissions<\/h3>\n<p> \t<strong>This option no longer appears in Joomla.<\/strong> On Older versions of Joomla&nbsp;: 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 &#8211;&gt; Global Configuration &#8211;&gt; 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&#39;s permissions, you may need to temporarily reset to more open permissions when installing more extensions with the Joomla! installer. <strong>This option no longer appears in Joomla.<\/strong> but is included for historical purposes.<\/p>\n<p> \t<a id=\"Remove_unneeded_files\" name=\"Remove_unneeded_files\"><\/a><\/p>\n<h3> \tRemove unneeded files<\/h3>\n<dl>\n<dd> \t\tRemove all design templates not needed by your site. Never put security logic into template files.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\t<a href=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Image%3ACompat_15.png\" title=\"Image:Compat_15.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-699\" alt=\"Image:Compat_15.png\" border=\"0\" height=\"16\" src=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Compat_15.png\" width=\"75\" \/><\/a> Disable the XML-RPC server if you don&#39;t need it.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tClean up after installs. 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&#39;t forget to remove the compressed file. Check the \/temp\/ directory as temporary files may remain there after a failed installation attempt.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tIn general, do not leave any unneeded files (compressed or otherwise) on a public server. Each unused (and perhaps long forgotten) file is a potential security hole.<\/dd>\n<\/dl>\n<p> \t<a id=\"Turn_Register_Globals_Emulation_OFF\" name=\"Turn_Register_Globals_Emulation_OFF\"><\/a><\/p>\n<h3> \tTurn Register Globals Emulation OFF<\/h3>\n<dl>\n<dd> \t\t<a href=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Image%3ACompat_10.png\" title=\"Image:Compat_10.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-701\" alt=\"Image:Compat_10.png\" border=\"0\" height=\"16\" src=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Compat_10.png\" width=\"75\" \/><\/a> Turn Joomla&#39;s Register Globals Emulation OFF. Although this setting is somewhat safer than PHP register_globals, you are much better off avoiding such settings all together (as well as any applications that require them). On pre-1.0.13 versions of Joomla, this setting is found in the globals.php file. As of version 1.0.13, it can be turned off in the Back-end, under Global Settings.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\t<a href=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Image%3ACompat_15.png\" title=\"Image:Compat_15.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-699\" alt=\"Image:Compat_15.png\" border=\"0\" height=\"16\" src=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Compat_15.png\" width=\"75\" \/><\/a> Joomla 1.5 and greater, does not use register globals, and in fact has smart code to defeat this setting even if it&#39;s turned on at the PHP level. Note that although this makes Joomla itself safer, any server with register globals turned on is potentially vulnerable. Any shared server with register globals turned on is more than likely a sitting duck. Any hosting provider that insists register globals should be turned on is ignorant, incompetent, or worse. Was that blunt enough?<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tFor more information on register_globals, please see <a href=\"http:\/\/docs.joomla.org\/Security_Checklist_2_-_Hosting_and_Server_Setup#Don.27t_use_PHP_register_globals\" title=\"Security Checklist 2 - Hosting and Server Setup\">Security Checklist: PHP: register_globals<\/a>.<\/dd>\n<\/dl>\n<p> \t<a id=\"Installing_Joomla.21_Extensions\" name=\"Installing_Joomla.21_Extensions\"><\/a><\/p>\n<h2> \tInstalling Joomla! Extensions<\/h2>\n<p> \t<a id=\"Backup_before_installing\" name=\"Backup_before_installing\"><\/a><\/p>\n<h3> \tBackup before installing<\/h3>\n<dl>\n<dd> \t\tBefore installing extensions, always backup your site&#39;s files and database. This follows a very basic principle:<\/dd>\n<\/dl>\n<dl>\n<dd> \t\t<em><strong>Thou shalt at all times be able to return your site to a previous working state.<\/strong><\/em><\/dd>\n<\/dl>\n<dl>\n<dd> \t\tTherefore, it&#39;s smart to set up a simple and fast backup script to automate this task. If you don&#39;t set up an easy process in advance, you&#39;ll be sorely tempted to do a quick upgrade without backing up first. This very understandable tendency is however one of the chief causes of premature hair loss, sudden career changes, and even death.<\/dd>\n<\/dl>\n<p> \t<a id=\"Check_for_extension_vulnerabilities\" name=\"Check_for_extension_vulnerabilities\"><\/a><\/p>\n<h3> \tCheck for extension vulnerabilities<\/h3>\n<dl>\n<dd> \t\tMost security vulnerabilities are caused by third party extensions. Before installing extensions, check the Official List of Vulnerable 3rd Party\/Non Joomla! Extensions. There&#39;s an entire forum dedicated to vulnerable third part extensions. Subscribe to it.<\/dd>\n<\/dl>\n<p> \t<a id=\"Download_from_trusted_sites\" name=\"Download_from_trusted_sites\"><\/a><\/p>\n<h3> \tDownload from trusted sites<\/h3>\n<dl>\n<dd> \t\tThe fully qualified and official definition of a &quot;trusted site&quot; is one that <strong>YOU<\/strong> trust.<\/dd>\n<\/dl>\n<p> \t<a id=\"User_beware.21_Check_the_code_quality\" name=\"User_beware.21_Check_the_code_quality\"><\/a><\/p>\n<h3> \tUser beware! Check the code quality<\/h3>\n<dl>\n<dd> \t\tThird 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.<\/dd>\n<\/dl>\n<p> \t<a id=\"Test.2C_test.2C_test...\" name=\"Test.2C_test.2C_test...\"><\/a><\/p>\n<h3> \tTest, test, test&#8230;<\/h3>\n<dl>\n<dd> \t\tTest all extensions on a development site before installing on a production site. Then test on the production site. Don&#39;t forget to check the logs for runtime errors and warnings.<\/dd>\n<\/dl>\n<p> \t<a id=\"Remove_junk_files\" name=\"Remove_junk_files\"><\/a><\/p>\n<h3> \tRemove junk files<\/h3>\n<dl>\n<dd> \t\tRemove 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 <a href=\"http:\/\/yousite.com\/modules\/bad_module\" rel=\"nofollow\" title=\"http:\/\/yousite.com\/modules\/bad_module\">http:\/\/yousite.com\/modules\/bad_module<\/a>.<\/dd>\n<\/dl>\n<p> \t<a id=\"Avoid_encrypted_code\" name=\"Avoid_encrypted_code\"><\/a><\/p>\n<h3> \tAvoid encrypted code<\/h3>\n<dl>\n<dd> \t\tJoomla 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&#39;t determine this for yourself, and so you must trust the developers. Using others&#39; 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&#39;t find your site first before a fix is released.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tYou 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.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tOf 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.<\/dd>\n<\/dl>\n<p> \t<a id=\"Additional_Joomla.21_Hardening_Tips_and_Tricks\" name=\"Additional_Joomla.21_Hardening_Tips_and_Tricks\"><\/a><\/p>\n<h2> \tAdditional Joomla! Hardening Tips and Tricks<\/h2>\n<p> \t<a id=\"Avoid_shared_servers_if_possible\" name=\"Avoid_shared_servers_if_possible\"><\/a><\/p>\n<h3> \tAvoid shared servers if possible<\/h3>\n<dl>\n<dd> \t\tFor maximum security, avoid a shared server on which you don&#39;t know or can&#39;t trust all the other users or their code quality.<\/dd>\n<\/dl>\n<p> \t<a id=\"Use_an_SSL_server\" name=\"Use_an_SSL_server\"><\/a><\/p>\n<h3> \tUse an SSL server<\/h3>\n<p> \t<em>This more to do with secure payments and administration, and is not joomla core or server security, but have been included here for advice<\/em><\/p>\n<dl>\n<dd> \t\tSSL 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 cannot be read.<\/dd>\n<\/dl>\n<dl>\n<dd> \t\tJoomla! 1.0.x does not allow you to assign an SSL server to individual sub-directories. Search the forums for &quot;Tommy Hack&quot; for one way to deal with this. Joomla! 1.5 has greatly improved SSL options.<\/dd>\n<\/dl>\n<p> \t<a id=\"Use_Apache.27s_.htaccess\" name=\"Use_Apache.27s_.htaccess\"><\/a><\/p>\n<h3> \tUse Apache&#39;s .htaccess<\/h3>\n<dl>\n<dd> \t\tFor 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.<\/dd>\n<\/dl>\n<p> \t<a id=\"Switch_to_Joomla.21_1.5\" name=\"Switch_to_Joomla.21_1.5\"><\/a><\/p>\n<h3> \tSwitch to Joomla! 1.5<\/h3>\n<dl>\n<dd> \t\t<a href=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Image%3ACompat_10.png\" title=\"Image:Compat_10.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-701\" alt=\"Image:Compat_10.png\" border=\"0\" height=\"16\" src=\"https:\/\/noi3.org\/site\/wp-content\/uploads\/2012\/01\/Compat_10.png\" width=\"75\" \/><\/a> The most significant upgrade in Joomla!&#39;s history includes powerful security and performance enhancements.<\/dd>\n<\/dl>\n<ul>\n<li> \t\t<a href=\"http:\/\/www.joomla.org\/content\/view\/4483\/118\/\" rel=\"nofollow\" title=\"http:\/\/www.joomla.org\/content\/view\/4483\/118\/\">Joomla 1.5 Overview<\/a><\/li>\n<li> \t\t<a href=\"http:\/\/joomlacode.org\/gf\/project\/joomla\/frs\/?action=FrsReleaseBrowse&amp;frs_package_id=3587\" rel=\"nofollow\" title=\"http:\/\/joomlacode.org\/gf\/project\/joomla\/frs\/?action=FrsReleaseBrowse&amp;frs_package_id=3587\">Joomla Downloads<\/a><\/li>\n<\/ul>\n<p> \t<a id=\"Add_Joomla.21_Security_Announcements_to_your_site\" name=\"Add_Joomla.21_Security_Announcements_to_your_site\"><\/a><\/p>\n<h3> \tAdd Joomla! Security Announcements to your site<\/h3>\n<dl>\n<dd> \t\tThe 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.<\/dd>\n<\/dl>\n<ul>\n<li> \t\t<a href=\"http:\/\/docs.joomla.org\/Security_and_Performance_FAQs#How_can_I_add_the_Joomla.21_Security_Announcements_Feed_to_the_Admin_Control_Panel.3F\" rel=\"nofollow\" title=\"http:\/\/docs.joomla.org\/Security_and_Performance_FAQs#How_can_I_add_the_Joomla.21_Security_Announcements_Feed_to_the_Admin_Control_Panel.3F\">How can I add the Joomla! Security Announcements Feed to the Admin Control Panel?<\/a><\/li>\n<\/ul>\n<p> \t&nbsp;<\/p>\n<p> <noscript><a href=\"http:\/\/myjoomlacastcom.disqus.com\/?url=ref\">View the discussion thread.<\/a><\/noscript> <\/p>\n<p> \t<a href=\"http:\/\/disqus.com\/\">blog comments powered by <span>Disqus<\/span><\/a><\/p>\n<p> \t&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Security matters &nbsp; Internet security is a fast moving challenge and ever present threat. There is no one right way to secure a website, and&hellip;<\/p>\n","protected":false},"author":1,"featured_media":698,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[346,347],"class_list":["post-702","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-informatica","tag-joomla","tag-securizare-site"],"_links":{"self":[{"href":"https:\/\/site.noi3.org\/index.php?rest_route=\/wp\/v2\/posts\/702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/site.noi3.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/site.noi3.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/site.noi3.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/site.noi3.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=702"}],"version-history":[{"count":0,"href":"https:\/\/site.noi3.org\/index.php?rest_route=\/wp\/v2\/posts\/702\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/site.noi3.org\/index.php?rest_route=\/wp\/v2\/media\/698"}],"wp:attachment":[{"href":"https:\/\/site.noi3.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/site.noi3.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/site.noi3.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}