Information Security Guideline
- Drupal is a popular open source content management system and is frequently targeted for attacks; this hardening guide is meant to further enhance the level of security for Drupal by reducing the exposed attack surface by providing configuration guidance.
- This guideline has been issued by the Chief Information Officer to supplement the Vulnerability Management standard. Compliance with this guideline is recommended, but not mandatory. Questions about this guideline may be referred to email@example.com.
Best Practices for Protecting the Application Platform
- Once installed, ensure that Drupal’s “Update” module is installed and notification for security updates is enabled. Subscribe to Drupal’s Security Advisory email list, or Twitter account.
- Input filters & WSIWYG
- configure input filters for different user-levels;
- turn on WSIWYG Filter and configure to allow specific tags/classes/etc. only; and
- disallow “Full HTML” (potential for privilege-escalation attacks).
- Logging & errors
- log (but don’t show) errors; and
- set login logging (“Login Security” module, even in D7, to log incorrect logins and set better flood protection).
- If you have comments enabled, consider installing comment moderation software like Mollom and a captcha solution like ReCaptcha.
- Only enable modules you intend to use, leave unused modules deactivated—or uninstall and remove from your server.
- for each module, look at its issue queue on Drupal.org: consider the number of active installs versus the number of open and closed issues;
- make sure the module page says “Actively maintained”; and
- never enable FTP module updating; always update modules through the command line (FTP updating requires giving the webserver write access to PHP files, which is a dangerously insecure site configuration).
- To enhance overall security it is also important to harden the operating system that will be hosting the Drupal installation:
- look at file permissions, make sure that the webserver can never write into a directory with executable PHP; and
- ensure .htaccess files exist in all Drupal files directories (sites/*/files)
- Permissions & Roles:
- create roles to add privileges to users, either by group (e.g., a “faculty” role) or function (a “webform results” role) – permissions granted by roles are additive, so a mix of both is most useful;
- set permissions to add/delete/update content as granularly as possible; and
- audit roles and permissions annually
- If you have control over the server, and it is solely for a Drupal site, consider custom rewrites in the Apache configuration (at the <VirtualHost> or <Directory> level).
- The following sites provide additional information on securing/hardening Drupal:
Topic Area Site
Securing your site
Drupal Security Best Practices
Hardening Drupal 7 Websites
Securing Drupal 7
Related Documents and Resources
- Policy SC14, Acceptable Use and Security of UBC Electronic Information and Systems
- Vulnerability Management standard
- UBC Systems and Application Hardening Guides
Last Revised: 2021-02