{"id":32717557,"url":"https://github.com/dereuromark/cakephp-audit-stash","last_synced_at":"2026-03-15T10:37:55.953Z","repository":{"id":318974065,"uuid":"1077141053","full_name":"dereuromark/cakephp-audit-stash","owner":"dereuromark","description":"Flexible and rock solid audit log tracking for CakePHP","archived":false,"fork":false,"pushed_at":"2026-01-31T06:59:16.000Z","size":414,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-31T19:10:31.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dereuromark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-15T20:48:45.000Z","updated_at":"2026-01-31T06:58:44.000Z","dependencies_parsed_at":"2025-12-05T12:07:59.947Z","dependency_job_id":null,"html_url":"https://github.com/dereuromark/cakephp-audit-stash","commit_stats":null,"previous_names":["dereuromark/cakephp-audit-stash"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dereuromark/cakephp-audit-stash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-audit-stash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-audit-stash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-audit-stash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-audit-stash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dereuromark","download_url":"https://codeload.github.com/dereuromark/cakephp-audit-stash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-audit-stash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30221193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T14:02:48.375Z","status":"ssl_error","status_checked_at":"2026-03-07T14:02:43.192Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-02T16:00:55.588Z","updated_at":"2026-03-15T10:37:55.939Z","avatar_url":"https://github.com/dereuromark.png","language":"PHP","funding_links":[],"categories":["Auditing / Logging","Plugins"],"sub_categories":["Auditing / Logging"],"readme":"# AuditStash Plugin For CakePHP\n\n[![Build Status](https://github.com/dereuromark/cakephp-audit-stash/actions/workflows/ci.yml/badge.svg)](https://github.com/dereuromark/cakephp-audit-stash/actions/workflows/ci.yml)\n[![Coverage Status](https://img.shields.io/codecov/c/github/dereuromark/cakephp-audit-stash/master.svg?style=flat-square)](https://codecov.io/github/dereuromark/cakephp-audit-stash)\n[![PHPStan](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg?style=flat)](https://phpstan.org/)\n[![Latest Stable Version](https://poser.pugx.org/dereuromark/cakephp-audit-stash/v/stable.svg)](https://packagist.org/packages/dereuromark/cakephp-audit-stash)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.2-8892BF.svg)](https://php.net/)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)\n[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-audit-stash/d/total.svg)](https://packagist.org/packages/dereuromark/cakephp-audit-stash)\n\nThis plugin implements an \"audit trail\" for any of your Table classes in your application, that is,\nthe ability of recording any creation, modification or delete of the entities of any particular table.\n\nBy default, this plugin stores audit logs in a database table using the CakePHP ORM. The plugin also includes:\n- Built-in UI for browsing and searching audit logs\n- Real-time monitoring and alerting system\n- Configurable retention policies with automated cleanup\n- Optional Elasticsearch support for high-volume applications\n\n## Installation\n\nInstall via [composer](https://getcomposer.org):\n\n```bash\ncomposer require dereuromark/cakephp-audit-stash\nbin/cake plugin load AuditStash\n```\n\nRun the migrations to create the `audit_logs` table:\n\n```bash\nbin/cake migrations migrate -p AuditStash\n```\n\n## Quick Start\n\nEnable audit logging in any Table class by adding the behavior:\n\n```php\nclass ArticlesTable extends Table\n{\n    public function initialize(array $config): void\n    {\n        parent::initialize($config);\n        $this-\u003eaddBehavior('AuditStash.AuditLog');\n    }\n}\n```\n\nOptionally, track the current user and request info in `AppController`:\n\n```php\nuse AuditStash\\Meta\\RequestMetadata;\nuse Cake\\Event\\EventManager;\n\npublic function beforeFilter(EventInterface $event)\n{\n    parent::beforeFilter($event);\n\n    EventManager::instance()-\u003eon(\n        new RequestMetadata(\n            request: $this-\u003egetRequest(),\n            user: $this-\u003egetRequest()-\u003egetAttribute('identity')?-\u003egetIdentifier(),\n        ),\n    );\n}\n```\n\nThat's it! Your application is now tracking all creates, updates, and deletes.\n\n## Features\n\n### Audit Log Viewer\nBrowse and search audit logs through a built-in web interface at `/admin/audit-logs`:\n- Filter by table, user, event type, date range, transaction ID\n- View detailed before/after comparisons with inline or side-by-side diff\n- Timeline view showing complete history for specific records\n- Export to CSV or JSON\n\nSee [Viewer Documentation](docs/viewer.md) for details.\n\n### Monitoring \u0026 Alerting\nReal-time monitoring system that detects suspicious activities:\n- Mass deletion detection\n- Off-hours activity monitoring\n- Customizable rules and notification channels (email, webhook, logs)\n- Extensible architecture for custom rules\n\nSee [Monitoring Documentation](docs/monitoring.md) for setup.\n\n### Log Retention \u0026 Cleanup\nAutomated cleanup with configurable retention policies:\n- Table-specific retention periods\n- Command-line tool for manual or automated cleanup\n- Cron-friendly with dry-run support\n\nSee [Retention Documentation](docs/retention.md) for configuration.\n\n### Flexible Storage\n- **Database (default)**: Simple, fast, works out-of-the-box\n- **Elasticsearch**: Optional for high-volume applications\n- **Custom**: Implement your own persister\n\nSee [Configuration Documentation](docs/configuration.md) for storage options.\n\n## Documentation\n\n- **[Configuration](docs/configuration.md)** - Database and Elasticsearch setup, persister options\n- **[Usage](docs/usage.md)** - Behavior configuration, metadata tracking, custom persisters\n- **[Viewer](docs/viewer.md)** - Web UI for browsing and searching audit logs\n- **[Retention](docs/retention.md)** - Automated log cleanup and retention policies\n- **[Monitoring](docs/monitoring.md)** - Real-time alerting for suspicious activities\n\n## Demo\n\nhttps://sandbox.dereuromark.de/sandbox/audit-stash\n\n## Related Plugins\n\nIf you need to moderate or approve changes **before** they happen (rather than auditing them after), check out the [Bouncer plugin](https://github.com/dereuromark/cakephp-bouncer). While AuditStash tracks what has already been changed, Bouncer provides approval workflows and change moderation before changes are persisted.\n\n## Testing\n\nRun the test suite:\n\n```bash\nvendor/bin/phpunit\n```\n\nFor Elasticsearch tests, set the environment variable:\n\n```bash\nelastic_dsn=\"Cake\\ElasticSearch\\Datasource\\Connection://127.0.0.1:9200?driver=Cake\\ElasticSearch\\Datasource\\Connection\" vendor/bin/phpunit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdereuromark%2Fcakephp-audit-stash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdereuromark%2Fcakephp-audit-stash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdereuromark%2Fcakephp-audit-stash/lists"}