Context
Compliance requires that logs are protected against tampering and unauthorized access, that admins cannot delete or falsify their own activity logs, and usually a defined retention.
We already have a strong base:
Gaps:
- No explicit guarantee that there is no mutation/delete endpoint on the
auditLogs table. Hash chain detects tampering but doesn't prevent row deletion.
- No scheduled chain verification — breaks would only be seen if an admin manually runs the verify query.
- No retention policy.
Proposed change
- Audit existing codebase — confirm no
patch/delete/replace on auditLogs. Remove any that exist. Add a unit test asserting the table is append-only.
- Add a scheduled Convex cron that runs
verify_integrity nightly and emits a security audit entry + email to admins on failure.
- Add configurable retention (default: keep forever, optional archive-then-delete after N days). Archived exports must also be signed/hashed.
- Review read-side access: only org admins should be able to read audit logs. Confirm RLS in services/platform/convex/lib/rls/ enforces this.
Acceptance criteria
Part of the security compliance baseline.
Context
Compliance requires that logs are protected against tampering and unauthorized access, that admins cannot delete or falsify their own activity logs, and usually a defined retention.
We already have a strong base:
Gaps:
auditLogstable. Hash chain detects tampering but doesn't prevent row deletion.Proposed change
patch/delete/replaceonauditLogs. Remove any that exist. Add a unit test asserting the table is append-only.verify_integritynightly and emits asecurityaudit entry + email to admins on failure.Acceptance criteria
auditLogsrows.Part of the security compliance baseline.