Skip to content

feat(convex): alert admins out-of-band on audit-log integrity failure (#1505) - #1820

Merged
yannickmonney merged 1 commit into
mainfrom
feat/audit-integrity-alert
Jun 2, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
feat/audit-integrity-alert

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What

The scheduled nightly audit-log integrity check (#1805) detects tampering but only signalled it via console.error + an in-band security audit 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

  • notifyIntegrityFailure internal mutation raises a critical security notification to the org's admins via writeNotificationForOrgs — the in-app notification bell and Slack fan-out (already wired for the security category). 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 / auditIntegrityFailedDetails strings in messages/{en,de,fr}.json + the mirrored NOTIFICATIONS_I18N catalog (kept honest by notification_messages.test.ts), allowlisted in keys-dynamic.txt (referenced via dynamic titleKey/bodyKey).
  • Hardening doc (en/de/fr): documents the nightly verification + alert and references append_only.test.ts as 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.

…#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.
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@yannickmonney, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e12fbd60-5b87-4c6d-ab9a-224233fa11c7

📥 Commits

Reviewing files that changed from the base of the PR and between c2eb19b and 33d31f4.

📒 Files selected for processing (10)
  • docs/de/self-hosted/operate/security/hardening.md
  • docs/en/self-hosted/operate/security/hardening.md
  • docs/fr/self-hosted/operate/security/hardening.md
  • services/platform/convex/audit_logs/integrity_check.test.ts
  • services/platform/convex/audit_logs/integrity_check.ts
  • services/platform/convex/notifications/notification_messages.ts
  • services/platform/lib/i18n/keys-dynamic.txt
  • services/platform/messages/de.json
  • services/platform/messages/en.json
  • services/platform/messages/fr.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/audit-integrity-alert

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant