Implements Spec 118 baseline drift engine improvements: - Resumable, budget-aware evidence capture for baseline capture/compare runs (resume token + UI action) - “Why no findings?” reason-code driven explanations and richer run context panels - Baseline Snapshot resource (list/detail) with fidelity visibility - Retention command + schedule for pruning baseline-purpose PolicyVersions - i18n strings for Baseline Compare landing Verification: - `vendor/bin/sail bin pint --dirty --format agent` - `vendor/bin/sail artisan test --compact --filter=Baseline` (159 passed) Note: - `docs/audits/redaction-audit-2026-03-04.md` left untracked (not part of PR). Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #143
68 lines
2.0 KiB
PHP
68 lines
2.0 KiB
PHP
<?php
|
|
|
|
use App\Jobs\PruneOldOperationRunsJob;
|
|
use App\Jobs\ReconcileAdapterRunsJob;
|
|
use App\Jobs\ScanEntraAdminRolesJob;
|
|
use App\Models\Tenant;
|
|
use Illuminate\Foundation\Inspiring;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
use Illuminate\Support\Facades\Schedule;
|
|
|
|
Artisan::command('inspire', function () {
|
|
$this->comment(Inspiring::quote());
|
|
})->purpose('Display an inspiring quote');
|
|
|
|
Schedule::command('tenantpilot:schedules:dispatch')->everyMinute();
|
|
Schedule::command('tenantpilot:directory-groups:dispatch')->everyMinute();
|
|
Schedule::command('tenantpilot:alerts:dispatch')
|
|
->everyMinute()
|
|
->name('tenantpilot:alerts:dispatch')
|
|
->withoutOverlapping();
|
|
|
|
Schedule::job(new PruneOldOperationRunsJob)
|
|
->daily()
|
|
->name(PruneOldOperationRunsJob::class)
|
|
->withoutOverlapping();
|
|
|
|
Schedule::job(new ReconcileAdapterRunsJob)
|
|
->everyThirtyMinutes()
|
|
->name(ReconcileAdapterRunsJob::class)
|
|
->withoutOverlapping();
|
|
|
|
Schedule::command('stored-reports:prune')
|
|
->daily()
|
|
->name('stored-reports:prune')
|
|
->withoutOverlapping();
|
|
|
|
Schedule::command('tenantpilot:review-pack:prune')
|
|
->daily()
|
|
->name('tenantpilot:review-pack:prune')
|
|
->withoutOverlapping();
|
|
|
|
Schedule::command('tenantpilot:baseline-evidence:prune')
|
|
->daily()
|
|
->name('tenantpilot:baseline-evidence:prune')
|
|
->withoutOverlapping();
|
|
|
|
Schedule::call(function (): void {
|
|
$tenants = Tenant::query()
|
|
->whereHas('providerConnections', function ($q): void {
|
|
$q->where('status', 'connected');
|
|
})
|
|
->whereNotNull('workspace_id')
|
|
->get();
|
|
|
|
foreach ($tenants as $tenant) {
|
|
ScanEntraAdminRolesJob::dispatch(
|
|
tenantId: (int) $tenant->getKey(),
|
|
workspaceId: (int) $tenant->workspace_id,
|
|
);
|
|
}
|
|
})
|
|
->daily()
|
|
->name('entra-admin-roles:scan')
|
|
->withoutOverlapping();
|
|
|
|
// TODO: Add tenantpilot:posture:dispatch schedule entry once the command
|
|
// infrastructure exists (FR-015 deferred — see specs/109 research.md §7).
|