3.2. Know Your Attack Surface

The attack surface of a web application is like a guide map for an attacker. It comprises all of the features on your site. Every additional feature, module, permission granted, and configuration you make can add more area to the attack surface, increasing the chances for a vulnerability. In particular, if you change a configuration or add a module without knowing precisely what is happening, it is easy to introduce security weaknesses into your site.

Drupal's core gets reviewed constantly by a range of experts and is one of the major focuses of the Drupal security team. This isn't to say that it's flawless, but at least you can be sure that any weaknesses in core will be fixed quickly. It also has a small total code footprint, and while it handles the most important aspects of functionality, it is less likely to contain problems than contributed modules. Therefore it is important to carefully monitor the contributed modules on your site.

3.2.1. Best Practices for Contributed Modules

Given that you must know your attack surface and that the larger the attack surface, the more area an attacker has to break, it is a best practice to install only contributed modules that you believe to be safe. There are several indicators you can use to determine quickly whether a module is safe:

Is the Module Popular?

The more people using a module, the more certain you can be that one of them has reviewed the code and reported any vulnerabilities to the security ...

Get Cracking Drupal®: A Drop in the Bucket now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.