dereuromark / cakephp-audit-stash
Flexible and rock solid audit log tracking plugin for cakephp
Package info
github.com/dereuromark/cakephp-audit-stash
Type:cakephp-plugin
pkg:composer/dereuromark/cakephp-audit-stash
Requires
- php: >=8.2
- ext-json: *
- cakephp/orm: ^5.3.0
- sebastian/diff: ^6.0 || ^7.0 || ^8.0 || ^9.0
Requires (Dev)
- cakephp/cakephp: ^5.3.0
- cakephp/elastic-search: ^4.0.0 || ^5.0.0
- cakephp/migrations: ^5.0.0
- dereuromark/cakephp-i18n-lint: ^0.1.1
- dereuromark/cakephp-templating: ^0.2.7
- php-collective/code-sniffer: dev-master
- phpunit/phpunit: ^11.5 || ^12.1 || ^13.0
Suggests
- cakephp/elastic-search: Optional Elasticsearch persister for high-volume audit log storage
- jfcherng/php-diff: For enhanced word-level diff rendering in AuditHelper (falls back to sebastian/diff if not installed)
Provides
None
Conflicts
None
Replaces
None
README
This branch is for CakePHP 5. See version map for details.
Audit-trail plugin: records entity saves and deletes on tables with its behavior enabled. Optional metadata records the user and request.
Features
- Entity audit trail: single behavior captures changed fields, before/after values, user, and request context.
- Tamper-evidence: optional SHA-256 hash chain, verifiable via CLI. See the documentation for its limits.
- 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.
Documentation
Full docs: https://dereuromark.github.io/cakephp-audit-stash/
- Installation
- Getting Started: behavior setup, verifying a saved change, request metadata
- Configuration: persisters, table list, route prefix
- Usage: behavior options, custom events, custom persisters
- Testing:
AuditAssertionsTraitfor 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.