Commit 17facc5
committed
fix(security): AuditTrailController — admin-only on clearAll + export
`clearAll()` and `export()` carried `@NoAdminRequired`. Two paths:
- `clearAll`: any authenticated caller could wipe every row in
`oc_openregister_audit_trails`, breaking the AVG/GDPR Art 30 audit
chain that operators rely on for supervisor review.
- `export`: any authenticated caller could dump every audit row in
bulk (CSV/etc) without an organisation filter — cross-tenant recon
with one request.
Add a `requireAdmin()` body-level gate (returns 401/403 JSONResponse
or null). Keep `@NoAdminRequired` at the framework level so existing
non-admin UI flows that touch other endpoints (`index`, `show`,
`objects`, hash-chain verification) still load — those don't trip
this gate.
`index` cross-tenant scoping is a deeper RBAC question (audit rows
have an `organisation` column but the existing LogService doesn't
filter by it); left for follow-up.
Refs: #1419 review (off-diff blocker — top-level comment 4378205122)1 parent ec84a5d commit 17facc5
1 file changed
Lines changed: 43 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
72 | 106 | | |
73 | 107 | | |
74 | 108 | | |
| |||
345 | 379 | | |
346 | 380 | | |
347 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
348 | 386 | | |
349 | 387 | | |
350 | 388 | | |
| |||
453 | 491 | | |
454 | 492 | | |
455 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
456 | 498 | | |
457 | 499 | | |
458 | 500 | | |
| |||
0 commit comments