Third consumer of the generic export primitive. Adds a
GET /admin/system-audit/export endpoint, the reusable export dropdown
to the list titlebar, and wires initListExport() into the page JS.
- pages/audit/system-audit/export().php: guard + ABILITY_SYSTEM_AUDIT_VIEW,
reuses the existing filter-schema.php via gridParseFiltersFromSchemaFile
so exported rows match the grid under the same filters, caps the limit
at 5000, and declares 11 ExportColumns (ID, created, event, status,
channel, actor, actor email, target type/uuid, request id, error code)
with translated enum labels for outcome/channel.
- module.php: new admin/system-audit/export route.
- index(default).phtml: app-list-export-dropdown partial placed above the
existing purge action; exportUrl added to pageConfig via
lurl('admin/system-audit/export').
- admin-system-audit-index.js: imports initListExport and invokes it
whenever config.exportUrl is present.
- i18n de/en: new "Actor email" key (required by TranslationKeysTest).
Gates: PHPUnit 1880 OK, PHPStan 0 errors, module:sync ok.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
197 lines
7.8 KiB
PHP
197 lines
7.8 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Audit module manifest.
|
|
*
|
|
* Provides four audit streams: system audit, API audit, import audit,
|
|
* and user lifecycle audit. Includes frontend telemetry ingestion,
|
|
* PII redaction, encrypted snapshots, and retention-based cleanup.
|
|
*/
|
|
return [
|
|
'id' => 'audit',
|
|
'version' => '1.0.0',
|
|
'enabled_by_default' => true,
|
|
'load_order' => 5,
|
|
'requires' => [],
|
|
|
|
'routes' => [
|
|
// API audit pages
|
|
['path' => 'admin/api-audit', 'target' => 'audit/api-audit/index'],
|
|
['path' => 'admin/api-audit/view', 'target' => 'audit/api-audit/view'],
|
|
['path' => 'admin/api-audit/data', 'target' => 'audit/api-audit/data'],
|
|
['path' => 'admin/api-audit/purge', 'target' => 'audit/api-audit/purge'],
|
|
// System audit pages
|
|
['path' => 'admin/system-audit', 'target' => 'audit/system-audit/index'],
|
|
['path' => 'admin/system-audit/view', 'target' => 'audit/system-audit/view'],
|
|
['path' => 'admin/system-audit/data', 'target' => 'audit/system-audit/data'],
|
|
['path' => 'admin/system-audit/export', 'target' => 'audit/system-audit/export'],
|
|
['path' => 'admin/system-audit/purge', 'target' => 'audit/system-audit/purge'],
|
|
// Import audit pages
|
|
['path' => 'admin/import-audit', 'target' => 'audit/import-audit/index'],
|
|
['path' => 'admin/import-audit/view', 'target' => 'audit/import-audit/view'],
|
|
['path' => 'admin/import-audit/data', 'target' => 'audit/import-audit/data'],
|
|
['path' => 'admin/import-audit/purge', 'target' => 'audit/import-audit/purge'],
|
|
// User lifecycle audit pages
|
|
['path' => 'admin/user-lifecycle-audit', 'target' => 'audit/user-lifecycle-audit/index'],
|
|
['path' => 'admin/user-lifecycle-audit/view', 'target' => 'audit/user-lifecycle-audit/view'],
|
|
['path' => 'admin/user-lifecycle-audit/data', 'target' => 'audit/user-lifecycle-audit/data'],
|
|
['path' => 'admin/user-lifecycle-audit/purge', 'target' => 'audit/user-lifecycle-audit/purge'],
|
|
['path' => 'admin/user-lifecycle-audit/restore', 'target' => 'audit/user-lifecycle-audit/restore'],
|
|
// Frontend telemetry
|
|
['path' => 'admin/frontend-telemetry/ingest', 'target' => 'audit/frontend-telemetry/ingest'],
|
|
],
|
|
'public_paths' => [],
|
|
|
|
'container_registrars' => [
|
|
\MintyPHP\Module\Audit\AuditContainerRegistrar::class,
|
|
],
|
|
|
|
'ui_slots' => [
|
|
'sidebar.admin_nav_item' => [
|
|
[
|
|
'key' => 'audit-api-audit',
|
|
'group' => 'admin-logs',
|
|
'label' => 'nav.audit.api',
|
|
'path' => 'audit/api-audit',
|
|
'permission' => 'audit.api.view',
|
|
'order' => 200,
|
|
],
|
|
[
|
|
'key' => 'audit-system-audit',
|
|
'group' => 'admin-logs',
|
|
'label' => 'nav.audit.system',
|
|
'path' => 'audit/system-audit',
|
|
'permission' => 'audit.system.view',
|
|
'order' => 210,
|
|
],
|
|
[
|
|
'key' => 'audit-import-audit',
|
|
'group' => 'admin-logs',
|
|
'label' => 'nav.audit.imports',
|
|
'path' => 'audit/import-audit',
|
|
'permission' => 'audit.imports.view',
|
|
'order' => 220,
|
|
],
|
|
[
|
|
'key' => 'audit-user-lifecycle-audit',
|
|
'group' => 'admin-logs',
|
|
'label' => 'nav.audit.user_lifecycle',
|
|
'path' => 'audit/user-lifecycle-audit',
|
|
'permission' => 'audit.user_lifecycle.view',
|
|
'order' => 230,
|
|
],
|
|
],
|
|
],
|
|
|
|
'authorization_policies' => [
|
|
\MintyPHP\Module\Audit\AuditAuthorizationPolicy::class,
|
|
],
|
|
|
|
'permissions' => [
|
|
[
|
|
'key' => 'audit.api.view',
|
|
'description' => 'View API audit logs',
|
|
],
|
|
[
|
|
'key' => 'audit.system.view',
|
|
'description' => 'View system audit logs',
|
|
],
|
|
[
|
|
'key' => 'audit.system.purge',
|
|
'description' => 'Purge system audit logs',
|
|
],
|
|
[
|
|
'key' => 'audit.api.purge',
|
|
'description' => 'Purge API audit logs',
|
|
],
|
|
[
|
|
'key' => 'audit.imports.view',
|
|
'description' => 'View import audit logs',
|
|
],
|
|
[
|
|
'key' => 'audit.imports.purge',
|
|
'description' => 'Purge import audit logs',
|
|
],
|
|
[
|
|
'key' => 'audit.user_lifecycle.view',
|
|
'description' => 'View user lifecycle audit logs',
|
|
],
|
|
[
|
|
'key' => 'audit.user_lifecycle.restore',
|
|
'description' => 'Restore deleted users from lifecycle audit',
|
|
],
|
|
],
|
|
|
|
'scheduler_jobs' => [
|
|
[
|
|
'job_key' => 'system_audit_purge',
|
|
'handler' => \MintyPHP\Module\Audit\Handler\SystemAuditPurgeJobHandler::class,
|
|
'label' => 'System audit log cleanup',
|
|
'description' => 'Purges system audit log entries older than the configured retention period',
|
|
'default_enabled' => 1,
|
|
'default_timezone' => 'UTC',
|
|
'default_schedule_type' => 'daily',
|
|
'default_schedule_interval' => 1,
|
|
'default_schedule_time' => '03:00',
|
|
'default_schedule_weekdays_csv' => null,
|
|
'default_catchup_once' => 1,
|
|
'allowed_schedule_types' => ['daily', 'weekly'],
|
|
],
|
|
[
|
|
'job_key' => 'audit_api_purge',
|
|
'handler' => \MintyPHP\Module\Audit\Handler\ApiAuditPurgeJobHandler::class,
|
|
'label' => 'API audit log cleanup',
|
|
'description' => 'Purges API audit log entries older than 90 days',
|
|
'default_enabled' => 1,
|
|
'default_timezone' => 'UTC',
|
|
'default_schedule_type' => 'daily',
|
|
'default_schedule_interval' => 1,
|
|
'default_schedule_time' => '03:15',
|
|
'default_schedule_weekdays_csv' => null,
|
|
'default_catchup_once' => 1,
|
|
'allowed_schedule_types' => ['daily', 'weekly'],
|
|
],
|
|
[
|
|
'job_key' => 'audit_import_purge',
|
|
'handler' => \MintyPHP\Module\Audit\Handler\ImportAuditPurgeJobHandler::class,
|
|
'label' => 'Import audit log cleanup',
|
|
'description' => 'Purges import audit run records older than 90 days',
|
|
'default_enabled' => 1,
|
|
'default_timezone' => 'UTC',
|
|
'default_schedule_type' => 'daily',
|
|
'default_schedule_interval' => 1,
|
|
'default_schedule_time' => '03:30',
|
|
'default_schedule_weekdays_csv' => null,
|
|
'default_catchup_once' => 1,
|
|
'allowed_schedule_types' => ['daily', 'weekly'],
|
|
],
|
|
[
|
|
'job_key' => 'audit_user_lifecycle_purge',
|
|
'handler' => \MintyPHP\Module\Audit\Handler\UserLifecycleAuditPurgeJobHandler::class,
|
|
'label' => 'User lifecycle audit log cleanup',
|
|
'description' => 'Purges user lifecycle audit entries older than 365 days',
|
|
'default_enabled' => 1,
|
|
'default_timezone' => 'UTC',
|
|
'default_schedule_type' => 'daily',
|
|
'default_schedule_interval' => 1,
|
|
'default_schedule_time' => '03:45',
|
|
'default_schedule_weekdays_csv' => null,
|
|
'default_catchup_once' => 1,
|
|
'allowed_schedule_types' => ['daily', 'weekly'],
|
|
],
|
|
],
|
|
|
|
'layout_context_providers' => [
|
|
\MintyPHP\Module\Audit\Providers\AuditLayoutProvider::class,
|
|
],
|
|
'session_providers' => [],
|
|
|
|
'event_listeners' => [],
|
|
'search_resources' => [
|
|
\MintyPHP\Module\Audit\Providers\AuditSearchResourceProvider::class,
|
|
],
|
|
'asset_groups' => [],
|
|
'migrations_path' => 'db/updates',
|
|
'i18n_path' => 'i18n',
|
|
];
|