Skip to content

dereuromark/cakephp-audit-stash

Repository files navigation

AuditStash Plugin For CakePHP

Build Status Coverage Status PHPStan Latest Stable Version Minimum PHP Version License Total Downloads Coding Standards

This branch is for CakePHP 5.3+. See version map for details.

Audit-trail plugin: records every create / update / delete on your Table classes, together with who made the change and from which request.

Features

  • Entity audit trail β€” single behavior captures changed fields, before/after values, user, and request context.
  • Tamper-evidence β€” optional SHA-256 hash chain for GoBD / SOX / HIPAA-grade integrity, verifiable via CLI.
  • Admin viewer β€” built-in dashboard, coverage report, search, diffs, timeline, and CSV/JSON export under /admin/audit-stash.
  • Monitoring & alerting β€” rules for mass-deletion and off-hours activity, notifications via email, webhook, or log channel.
  • Retention & cleanup β€” per-table retention policies and a dry-run-friendly cleanup CLI.
  • GDPR helpers β€” redaction and subject-access-export tooling.
  • Custom event types β€” log arbitrary actions (logins, exports, permission grants) through the same persister and viewer.
  • Flexible storage β€” database persister out of the box, optional Elasticsearch driver, or plug in your own.

Installation

composer require dereuromark/cakephp-audit-stash
bin/cake plugin load AuditStash
bin/cake migrations migrate -p AuditStash

Then enable the behavior on any Table you want tracked β€” see the Getting Started guide for the full walkthrough.

Documentation

Full docs: https://dereuromark.github.io/cakephp-audit-stash/

  • Getting Started β€” installation, behavior setup, request metadata
  • Configuration β€” persisters, table list, route prefix
  • Usage β€” behavior options, custom events, custom persisters
  • Testing β€” AuditAssertionsTrait for your own test suite
  • Features overview β€” viewer, monitoring, retention, tamper-evidence, GDPR

Demo

https://sandbox.dereuromark.de/sandbox/audit-stash

Related Plugins

If you need to moderate or approve changes before they happen (rather than auditing them after), check out the Bouncer plugin. AuditStash records what already changed; Bouncer gates changes before they're persisted.

About

Flexible and rock solid audit log tracking for CakePHP

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages