DEV Community

Aglowid It Solutions
Aglowid It Solutions

Posted on • Originally published at aglowiditsolutions.com on

Drupal Security Best Practices – Checklist to Secure your Website

Drupal Security Best Practices

Drupal is an open-source CMS which is used by many websites today. Today a large number of businesses are making use of Drupal as their CMS solution. Just like any other major CMS platforms out there, Drupal also has security concerns. Today, more vulnerabilities are regularly discovered, and there is an increased risk of attack on your website.

Based on the XXS report taken in 2017, it has been said that 46% of vulnerabilities in Drupal come from cross-site scripting.

This means that you need to secure and protect your Drupal site if you wish to stay ahead in offering the best customer experience and running the business process as expected.

Drupal Security Best Practices

Why do you Need to Secure your Drupal Website?

Drupal is a popular CMS in the market and used across different business websites. This means that crucial business information and critical user data will be stored in there. In case the website is not secure enough, chances are more that it will get hacked and stolen. This can affect your reputation in the market and spoil your online presence completely. So for all good reasons, you need to secure your Drupal website.

Best Tools To Check the Website Vulnerabilities

  • PenTest Tool: You can use this tool to get a complete report of different security tests which include PHP Code Injection, Cross-Site Scripting, SQL Injection, HTTP Header Injection, Source Disclosure, Blind SQL Injection, and others. The report summary based on the vulnerabilities will be sent on email.
Pen test Tool
  • SUCURI: This is a free website security and malware scanner popular in the market. You can use this tool to get a quick check on Injected SPAM, Website blacklisting Defacements and Malware. This tool also protects your website from online threats and can be used across different website platforms like Drupal, Joomla, WordPress, Magento, etc.
Sucuri
  • Qualys SSL Labs, QualysFreeScan: SSL Labs is one of the most popular tools used in the market for the purpose of scanning the SSL web server. You can use this tool to get an in-depth analysis of your HTTP URL which includes Cipher, expiry day, Handshake simulation, BEAST, SSL/TLS version, overall rating, Protocol details, and others. In case you have an HTTPS website, then you should definitely use this tool to run a quick test.
qualys-ssl-labs

FreeScan can be used to check the website against malware and different OWASP Top risks against the SCP security benchmark. In order to carry out this scan, you need to register a free account.

  • Quttera: This tool is used by the website owners to check for vulnerabilities and malware. It scans the website for suspicious files, malicious files, Safe Browsing, phishTank, potentially suspicious files, and Malware domain list.

  • Detectify: This tool is a website security scanner which is SaaS-based. This tool offers more than 100 security tests that include malware, OWASP Top 10 and others. It comes with a 21-day free trial and to continue with the security scan you need to register on the tool.

Best Security Practices to Keep your Drupal Website Secure

Securing your Hosting Server

Before you get into the general security tips and tricks, it is essential to take care of your server-side hosting environment. Now there are some tips which you need to keep in mind before you start doing it.

  • Hide the server signature It is important to keep the server signature hidden as it contains some vital information regarding the operating system and the server. Such information can let the hacker know whether you are using Linux or Apache. Such information can be vulnerable to your site and can be used to hack into your site. So you should hide the server signature in order to keep your website safe from all kinds of vulnerabilities.
  • Protect the server You should limit the access to your server to a limited number of users. You must come up with a basic layer and add it to the login to restrict the access users can have to the server login details. Once you have set up the authentication, it will become easier to restrict the file access usage and monitor server access. This way, you will be able to find any of the unusual activities going on in there.
  • Enable port wise security As all the applications make use of port numbers, it would be wise that you keep them hidden from the general access provided to the users.
Securing Hosting Server

Keep Updated – Always Use Latest Version of Drupal

This is something you should always do! If you fail to understand its importance, you will end up affecting your website negatively. In case you are not into making regular updates to Drupal, then you need to know certain things like:

  • Hackers are more inclined towards targeting older versions of Drupal.
  • The new version releases are focused on improving the security and to make bug fixes which can make your site more vulnerable.

So instead of leaving your site in an outdated manner -more prone to attacks, why not take the step of keeping it updated regularly!

Take Routine Backup

Another much of neglected Drupal security best practices are not to take routine backup. So why you should wait till your website is attacked by some ransomware and realizes the importance of taking backup the hard way?

The better thing would be to make it a habit to take the backup of your website regularly. When you periodically conduct the backup for your site, you end up taking an effective measure towards making your Drupal site secure against any breaches. So now let’s see how you can secure your Drupal site by taking backups:

  • Go for “one-click backup” functionality from Pantheon.
  • Make use of XAMPP or MAMP to test your updates locally or else go for another software that is “kindred”.

  • Make use of the power of the Backup and Migrate module which is currently available for Drupal 7.

  • You can even manually export and backup your files on MySQL.

Automatic Backup Module

Such a step will assure you that in the case things go wrong, then you have the option to quickly get back where you were just by retrieving the backup files.

Use Strong Credentials

Your Drupal site will be accessed not only by the admin but also by the users. This means you must implement strong security measures on the user-side of your Drupal site. In such a scenario, it would be advisable that you come up with a strong password policy. Such a policy will come up with strong login credentials which will be hard to hack. For every good reason, such a step is the easiest way to keep your Drupal user side secure.

File Permissions

It comes without saying that we all want to keep all the important core files away from the easy access of people. This can be made possible when you block or limit access to them. You can easily make it happen by configuring your .htaccess file. Such a file contains much of the crucial data that is related to your website access; core files present on the site and credentials to get into specific parts.

You need to keep in mind that when you are limiting access, you need to be sure you are limiting the access to the core files and folders. You need to block or restrict access to the server login details and web server too. You should also work towards managing the access to some of the port numbers which your website might be using.

Use HTTPS

When it comes to the connection between the server and the user, an SSL certificate can help you add another layer of protection. By opting for this approach, you can ensure that the hackers are not able to get into the servers where vital information of the clients and customers and business are placed. Another best thing about using an SSL certificate in your Drupal site is that it will help you get a better position on the search engine as a part of the SEO process.

Moreover, Drupal websites enjoy an additional layer of security as they are protected using the HTTP security headers. The browser is guided by the browser about the site content and the way it is used.

Secure your Database

Secure your Drupal database with proper configurations. You should think about coming up with some security measures for your database. Keep in mind that it will just take up a few minutes for the job, but, the results will be massive. Some of the effective measures which you can take up for your Drupal website are:

  • Change the database name into something which is hard to guess and seems to be less obvious.
  • Use a different table prefix. This will keep the hackers going in rounds to guess it. Such a step will save from possible SQL injection attacks.

You can use the phpMyAdmin to change the prefix of the table in case you have the Drupal site installed or else you need to visit the setup screen.

Always Update Drupal Modules

Just like you update your Drupal core, you should also keep your Drupal modules updated. You should remove the modules that are unnecessary or not used anymore. This will keep your Drupal site clean and secure as there will be fewer loopholes open for attackers.

Firewall Settings

Another important thing you need to do for Drupal site security is setting a firewall. When you go ahead with a firewall setup for your website, you add in another layer of protection to the web server. It also makes sure that the connections are accepted from the known parties or the ones which are trusted. In the same manner, it also controls the outgoing of connections from the website.

Firewall

Use Drupal Security Modules

It is a fact that your website will stay more secure when you make use of a layered approach for protection. It is possible to add in an extra layer of security to your site when you make use of Drupal security modules. Some of the top Drupal security modules which you should include in your Drupal website are:

Two-factor Authentication

By using this Drupal security module, you get to add in an extra layer of authentication when the user will try to log in to the website by using user ID and password. This can be something like using a code at the site which has been sent to the registered mobile number.

Content Access

By using this module you will be able to get detailed access control to the content in your Drupal website. You can use custom view, delete or edit permissions to specify each content type. By using author and role, you can manage permissions for the content types.

Drupal Login Security

The site administrator can add in different restrictions onto the user login by using this module. By using the Drupal login security module, it is possible to block accounts after a said number of invalid login attempts are restricted. It is also possible to temporarily or permanently deny access for IP addresses.

Username Enumeration Prevention

It is possible to know whether the username you entered exists or not by default Drupal settings. So if the hacker plans to enter some random usernames so as to find the valid ones, then it is possible. When you use the Drupal security module, you can easily change the standard error message and save the site from such attacks.

Password policy:

This can be called as another extra layer of security which you can add to your login forms. Using this you can save the site from security breaches as well as prevent bots. This pushes users to go ahead and change the password regularly. It also brings in restrictions on adding user passwords like character type, length of the password, punctuation, case, etc.

Captcha

No doubt CAPTCHA is considered as one of the effective Drupal Security modules you can use for your website to filter unwanted spambots. The automated script submissions which happen from the side of spambots can be prevented using the Drupal module and then in any Drupal website you can use it in any web form.

Coder

In the case, there are loopholes in the code then attackers will easily get into it. The Coder module scans your Drupal code by visiting every nook and corner to find the areas where the best practices for coding have not been followed.

Security Kit

You will get a number of risk-handling features with your Drupal security module. When you make use of the Drupal 88 security module, you will be able to handle and mitigate vulnerabilities like Clickjacking, cross-site scripting, eavesdropping attacks, CSRF, and others.

Drupal Maintenance Services


Wrapping it up

So here we have seen a number of ways in which you can tighten the security of your Drupal site. Right from keeping your Drupal core and modules updated, using an SSL certificate, two-factor authentication, using security plugins, etc. will ensure that the site is safe from the hands of hackers and other attackers.

Top comments (2)

Collapse
 
rr9853462 profile image
Rima Sharma

This is an excellent article! As a Drupal developer, I can appreciate the importance of best security practices when it comes to website development. Your checklist is comprehensive and very helpful in ensuring that the security of a Drupal website is not overlooked. Great work!

Collapse
 
umairhussain profile image
Umair Hussain Siddiqui

It's always a treat to read interesting stuff about Drupal. Since, I've leverage the CMS platform best drupal hosting, things are pretty handle via customer support. But, then again one should know the consequences and tips for a productive security. Awesome read! Keep it updated. Thanks.