Key Audit finds potentially unsafe storage of API keys and other secrets in Drupal configuration and local files. Audit any site, including sites without the Key module, and get remediation guidance.

Features

Useful for security reviews, deployment checks, and preparing configuration for version control. Ordinary scans are read-only; findings require human review.

Post-Installation

Enable Key Audit, then run this command from your project root:

vendor/bin/drush key-audit:config --project-root="$PWD"

Review the findings and follow the suggested actions. There is currently no audit administration page. If Key is not enabled, the status report recommends it; audit reports also recommend it when possible stored secrets are found.

Additional Requirements

Requires Drupal 10.3 or later in the 10.x series, Drupal 11, or Drupal 12. Drupal 12 requires PHP 8.5 and Drush 14.x; Drupal 10/11 use a compatible Drush 12.5–12.x or 13.x release. The standalone scanner does not require Drush.

Key is not required for auditing. The optional Key Audit Fix submodule requires Key 1.22 or later in the 1.x series (1.23 or later on Drupal 12), PHP's POSIX extension, and suitable persistent private storage.

Key manages secrets through storage providers, compatible integrations, and configuration overrides. Installing it does not automatically migrate existing values: https://www.drupal.org/project/key.

Key Status tracks exposure assessments and remediation history for Key entities: https://www.drupal.org/project/key_status.

Similar projects

Security Review checks broader Drupal security settings. Key Audit focuses on secret storage and Key-provider configuration: https://www.drupal.org/project/security_review.

Supporting this Module

Contribute testing, documentation, bug reports, or provider integrations. Use invented credentials in examples; never post real secrets.

Community Documentation

The included README and documentation cover commands, reporting, integrations, and remediation. Key Audit Fix includes a separate migration and recovery guide.