Skip to content

[Feature]: Centralized Cryptographic Audit Logging & Immutable Trails - #2076

Merged
Dev1822 merged 1 commit into
Dev1822:mainfrom
ErebAsh:feature/cryptographic-audit-logging
Aug 31, 2026
Merged

[Feature]: Centralized Cryptographic Audit Logging & Immutable Trails#2076
Dev1822 merged 1 commit into
Dev1822:mainfrom
ErebAsh:feature/cryptographic-audit-logging

Conversation

@ErebAsh

Copy link
Copy Markdown

Description

Implemented Cryptographic Audit Logging to ensure enterprise-grade data integrity and compliance (SOC2, GDPR). This update cryptographically chains every audit log entry to the previous one, making it mathematically impossible to alter historical financial or HR data without breaking the chain and leaving tamper-evident trails.

Changes Made

  • Cryptographic Utilities: Added cryptoAudit.js to handle deterministic SHA-256 payload hashing and HMAC signing using a system secret.
  • Audit Sequence Logic: Updated audit.service.js to fetch the previous log's hash, compute the new cryptographic sequence, and apply the HMAC signature securely with a retry mechanism to mitigate concurrent insertion conflicts.
  • Model Enhancements: Expanded the AuditLog Mongoose schema to track currentHash and signature for strict integrity tracking.
  • Verification Service: Introduced auditIntegrity.service.js to rebuild and verify a tenant's complete audit chain from the genesis block, detecting any signs of database tampering.
  • Compliance API: Exposed a new verifyAuditTrailIntegrity endpoint in the audit controller to generate integrity reports on demand.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my feature works

@ErebAsh
ErebAsh requested a review from Dev1822 as a code ownerAugust 31, 2026 09:06
@vercel

vercelBot commented Aug 31, 2026

Copy link
Copy Markdown

@ErebAsh is attempting to deploy a commit to the Dev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Dev1822Dev1822 added enhancement New feature or request ECSoC26 good-pr labels Aug 31, 2026
@Dev1822
Dev1822 merged commit eeafa63 into Dev1822:mainAug 31, 2026
6 of 21 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Centralized Cryptographic Audit Logging & Immutable Trails

2 participants

@ErebAsh@Dev1822