Audit hash-chain verification endpoint and ops card#70
Conversation
|
@BigMick03 is attempting to deploy a commit to the karagoz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@BigMick03 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! 🚀 |
|
Thanks for the audit integrity PR. I ran the relevant checks and they pass locally:
However, GitHub reports merge conflicts against current |
|
Rechecked after the branch update. The focused API test passes:
I still cannot merge because targeted eslint fails in the Ops dashboard UI:
Also, |
|
Thanks for the PR! The build passes locally ✅, but after other PRs landed on |
98e980d to
942d7ae
Compare
|
Rechecked: thanks for the updates. However this PR now has merge conflicts with |
…sbuildinfo - import ShieldCheck and ShieldAlert from lucide-react - convert unused `catch (loadError)` in loadIntegrity to bare catch - untrack tsconfig.tsbuildinfo via .gitignore and git rm --cached
0802a41 to
1efe3d7
Compare
Closes #58
Title
feat: add read-only audit integrity verification API and Ops dashboard status
Summary
This PR adds a read-only audit integrity verification surface that allows authorized operators to verify the integrity of tamper-evident audit chains directly from the application, without exporting audit logs or manually running
verifyHashChain(entries).The implementation leverages the existing hash-chain verification logic in
src/lib/audit/hash-chain.tsand introduces an authenticated API endpoint along with an Ops dashboard status card.Motivation
Fortexa already records tamper-evident audit entries using
entryHashandpreviousHashand providesverifyHashChain(entries)for offline validation.This feature exposes that capability through authenticated application interfaces, enabling operators to:
Scope
API
Added an authenticated read-only endpoint:
The endpoint:
Response
Returns a compact response similar to:
{ "valid": true, "checkedEntries": 1427, "firstBrokenEntryId": null, "reason": null, "timestamp": "2026-06-28T12:00:00Z" }If verification fails:
{ "valid": false, "checkedEntries": 931, "firstBrokenEntryId": "audit_931", "reason": "Hash chain mismatch", "timestamp": "2026-06-28T12:00:00Z" }Ops Dashboard
Added an Audit Integrity card displaying:
The dashboard is read-only and intended for operational monitoring.
Security
The implementation preserves existing security boundaries:
Compatibility
This feature reuses the existing:
verifyHashChain(entries)implementation without changing audit generation or export behavior.
Existing audit export functionality remains unchanged.
Tests
Executed:
npm run testAdded test coverage for:
Acceptance Criteria
npm run testpasses.Notes
This is a read-only operational feature. It does not alter audit records, recompute hashes, migrate legacy data, or change the existing audit logging pipeline. Its purpose is to expose existing integrity verification capabilities through secure API and UI surfaces for easier operational monitoring.