Install

Works with Drupal: ^10.6 || ^11.3 || ^12

Using dev releases is not recommended, except for testing.

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 254.36 KB
MD5: d5df96000ab2fb73735886f7e7bc992a
SHA-1: a2177af47693fce72645e502600a8bbd21d0269e
SHA-256: f2428da06c75a60092577f8dc8b7a44966ed9952506caedec8f7c25328e035b4
Download zip 336.32 KB
MD5: a8a7dee5044a6db67103e377642f14b3
SHA-1: 11dd2fb50bb47c25ef03a14ca4945c96002182a9
SHA-256: c93479398b349ef6c51674b5089016f768e28fdf515e5202936a478783f90d0e

Release notes

First published snapshot of Audit Chain. This is a development release, not a stable one — see the caveats below before using it on a site you care about.

Tamper-evident, hash-chained audit logging that any module can write to. Each entry's hash covers its own content and the previous entry's hash, so a later insertion, deletion or edit breaks the chain and is detectable by an independent verification pass. With an HMAC key configured, forging a repair also requires the key.

What is in this release

  • AuditChainLoggerInterface and its implementation, writing to the audit_chain_log table. Consumers are identified by a channel, which is bound into the row hash so an entry cannot be re-attributed after the fact.
  • Optional HMAC signing via a Key entity, and optional at-rest encryption of entry metadata via an Encryption Profile. Encryption is applied after hashing, so enabling it later does not invalidate earlier entries.
  • drush audit-chain:verify — walks every entry and verifies the chain. The exit code is the contract: non-zero means the chain does not verify, so it can be wired into monitoring or a deploy gate without parsing output.
  • A settings form at Configuration → System → Audit Chain for the signing key, the encryption profile, and streaming entries to the audit_chain logger channel for a SIEM.

Verified

The kernel suite runs on Drupal 10.6, 11.3 and 11 (PHPUnit 9.6 and 11.5), and covers chain verification, detection of an edited entry, a deleted entry and a re-attributed channel, keyed versus unkeyed chains, channel-scoped pruning, and compatibility with entries migrated from a consumer's own table.

Caveats

  • The API may change before 1.0.0. The interface has exactly one consumer so far, and that integration is not finished. The first real consumer is what shakes out an API.
  • The migration path has not been exercised on a production site. Entries migrated from a consumer's own table keep their original hashes and an empty channel, and that is covered by a kernel test — not yet by a real audit table with a live signing key.
  • This project is not covered by Drupal's security advisory policy.

Two constraints for consumers

Do not log per access check. A hook such as hook_entity_field_access() fires per field, per entity, per render; an entry each time produces a chain nobody can read. Dedupe per request and flush once at kernel.terminate.

Rotating the encryption profile orphans existing entries. The chain is computed over the plaintext, so entries encrypted under the previous profile stop verifying — and the failure looks exactly like tampering. Export or re-encrypt first.

Installing

composer require drupal/audit_chain:1.x-dev — your project needs minimum-stability: dev (with prefer-stable: true) or an explicit @dev suffix.

Requires Drupal 10.6+ or 11.3+, Key, and Encrypt.

Created by: jmcerda
Created on: 29 Jul 2026 at 19:02 UTC
Last updated: 23 Oct 2026 at 22:41 UTC
New features

Other releases