Repository navigation
feat(convex): alert admins out-of-band on audit-log integrity failure (#1505) - #1820
Conversation
…#1505) The nightly integrity check already wrote a console.error + an in-band security audit row, but neither is seen unless someone watches the logs. SOC 2 CC7.2/CC7.3 expect a *monitored* control. Add an out-of-band alert: when a chain fails to verify, raise a critical `security` notification to the org's admins (notification bell + Slack fan-out via writeNotificationForOrgs), isolated so one org's alert failing never aborts the sweep. - notifyIntegrityFailure internal mutation; called from the cron's failure branch right after the in-band audit row. - auditIntegrityFailed / auditIntegrityFailedDetails notification strings in messages en/de/fr + the mirrored NOTIFICATIONS_I18N catalog; allowlisted in keys-dynamic.txt (referenced via dynamic titleKey/bodyKey). - integrity_check.test.ts: tampered chain raises the critical notification; clean chain raises none. - Hardening doc (en/de/fr): nightly verification + alert, append-only test reference.
|
Warning Review limit reached
More reviews will be available in 50 minutes and 3 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
The scheduled nightly audit-log integrity check (#1805) detects tampering but only signalled it via
console.error+ an in-bandsecurityaudit row — neither of which is seen unless someone is actively watching the logs. SOC 2 CC7.2/CC7.3 expect a monitored control. This adds the out-of-band alert.Changes
notifyIntegrityFailureinternal mutation raises a criticalsecuritynotification to the org's admins viawriteNotificationForOrgs— the in-app notification bell and Slack fan-out (already wired for thesecuritycategory). Called from the cron's failure branch right after the in-band audit row, wrapped in its own try/catch so one org's alert failing never aborts the sweep.auditIntegrityFailed/auditIntegrityFailedDetailsstrings inmessages/{en,de,fr}.json+ the mirroredNOTIFICATIONS_I18Ncatalog (kept honest bynotification_messages.test.ts), allowlisted inkeys-dynamic.txt(referenced via dynamictitleKey/bodyKey).append_only.test.tsas the append-only evidence an auditor can re-run.Tests
integrity_check.test.ts(convex-test): a tampered chain raises exactly one critical security notification carrying the i18n keys; a clean chain raises none.bun run check: full suite green (37/37 tasks, 71493 tests); docs suite 139/139.Notes
Retention, the hash chain, manual verification, and signed checkpoints already exist; this PR closes the remaining #1505 gap (alerting + runbook doc). Part of the #1803 security/compliance epic.