This project is not covered by Drupal’s security advisory policy.

Check Contrib compares every file of Drupal core and of your contributed modules and themes with the exact release or commit on drupal.org, and lists every file that was changed, added or removed. A changed file can be a local fix nobody recorded, a patch, or a sign that the site was compromised.

It downloads nothing. drupal.org publishes the list of files of every release and commit with their git hashes; Check Contrib computes the same hash for each file on disk and compares the two. Report only: nothing is ever changed.

Built for government and regulated sites

  • Integrity evidence: a dated report, per project, of which files match drupal.org, for change control and audits (NIST SP 800-53 SI-7 Software, Firmware, and Information Integrity; SI-7(1) Integrity Checks; CM-3 Configuration Change Control).
  • Safe on production: it only reads files and stores a small result. It contacts only git.drupalcode.org, api.github.com (core) and updates.drupal.org, over HTTPS, without following redirects.
  • Logged: every modified project is logged as a warning and every project that could not be checked as an error, with the reason (log type check_contrib, so it can reach syslog and central log collection).
  • CI ready: drush check-contrib exits with an error code when something differs, so a hand-edited module can fail the build.

What it checks

  • Drupal core, against drupal.org's core at the installed tag or commit (github.com/drupal/core, the package Composer installs).
  • Every contributed module, theme and profile, installed or not, against its release tag, or for a dev version the exact commit Composer installed.
  • Projects copied in by hand, against the version in their .info.yml, and git checkouts against their current commit.
  • Composer patches (cweagans/composer-patches): differences a patch file explains are shown as Patched, not as hacks; anything else is still reported.

drupal.org's own packaging is not reported as a change: the version/project/datestamp lines in .info.yml files, a core_version_requirement drupal.org rewrote because the maintainer changed the supported cores (checked against the release history), the GPL LICENSE.txt added to releases, and files a project leaves out of its releases (export-ignore).

Use

  • Reports » Contrib changes (/admin/reports/check-contrib): the last results, with the changed, added and missing files of each project, and Check now for one project or all of them.
  • Status report: a warning while a project differs from drupal.org.
  • Drush: drush check-contrib, drush check-contrib --project=drupal,token --files.
  • Cron: off by default; daily or weekly under Configuration » Development » Check Contrib, where you can also add files to ignore.

Compared with Hacked!

Hacked! has done this job for years by downloading every release and comparing the files. Check Contrib takes a different route:

Check Contrib Hacked!
How it compares git hashes from drupal.org's file lists; nothing downloaded downloads and unpacks every release
Dev versions the exact commit installed not documented
Composer patches shown as patched, separately from other changes not documented
drupal.org packaging lines in .info.yml not reported can show as changed
Production sites safe: reads files, stores a small result meant for development only
Drupal versions 8.8 to 12 9 to 11 (2.0.0-beta8)

If you already rely on Hacked! and its diff view, keep it; Check Contrib answers "what differs from drupal.org" quickly enough to run on every site, every day.

Getting started

  1. composer require drupal/check_contrib:1.0.x-dev@dev and enable the module.
  2. Give View contrib changes to the people who review the report, and Run contrib checks and change their settings to those who run it.
  3. Open Reports » Contrib changes and press Check now, or run drush check-contrib.

Requirements

Drupal ^8.8 || ^9 || ^10 || ^11 || ^12, PHP 7.3 or later. No other modules or libraries. The site must be able to reach git.drupalcode.org and api.github.com over HTTPS. Drush 9 or later for the command (optional).

Project information

Releases