Feature/issue 471 comprehensive audit trail#571
Merged
anonfedora merged 5 commits intoJun 27, 2026
Merged
Conversation
- Add audit.types.ts: AuditEvent, AuditStatus enum (SUCCESS/FAILED/CRITICAL), AuditActor, and IBlockchainAnchorProvider interface - Extend AuditContext with role and status fields; include both in SHA-256 chain - audit-anchor.service.ts: MockAnchorProvider now implements IBlockchainAnchorProvider (anchorHash method), decoupled from legacy AnchorProvider interface - audit.service.ts: eventId (record.id), actor role, and status are hashed and stored; verifyIntegrity() recomputes using _role/_status from details - audit.controller.ts: REST handlers for search, export, integrity, replay, compliance report, GDPR redact, and blockchain anchoring - admin.routes.ts: all audit endpoints wired under /admin/audit/* - Migration 20260623000001: adds correlationId, entryHash, previousHash, anchoredAt, anchorTxId, redactedAt columns and performance indexes - Tests: tamper-evidence chain, integrity verification, PII redaction, Merkle root, AuditStatus enum, role/status persistence
|
@Dami24-hub is attempting to deploy a commit to the paul joseph's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Dami24-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements Issue #471, completely overhauling the existing
audit.service.tsto transition it from a basic logger into a secure, tamper-evident, and compliant enterprise-grade audit trail system.The service now enforces cryptographic sequencing on all audit logs, introduces blockchain anchoring placeholders for high-risk financial events, and builds out the necessary infrastructure for GDPR/SOC2 compliance reporting.
Key Changes
Security & Cryptography
previousHash), rendering historical logs completely tamper-evident.IBlockchainAnchorProviderinterface to anchor high-priority financial operations (e.g., withdrawals) onto a decentralized ledger simulation.Schema & Compliance
actorroles, and structural state deltas.Performance & Operations
timestamp,action, andactorfields to keep searching limits under 1 second.How Has This Been Tested?
Checklist
Closes: #471