Repository navigation
Conversation
…related-issues-1505-1510-1550-1551
boluxx123
force-pushed
the
security/issue-824-backend-no-structured-audit-logging-for
branch
from
October 1, 2026 11:43
2239f4c to
f4a8698
Compare
boluxx123
force-pushed
the
security/issue-824-backend-no-structured-audit-logging-for
branch
from
October 21, 2026 21:01
f4a8698 to
1539caa
Compare
This branch has not been deployed
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.
Overview
This PR adds structured audit logging for destructive admin actions and authentication outcomes. Successful admin reset/replay operations now emit an audit entry capturing the actor's publicKey, action, params, and requestId, and
verifyChallenge/requireAdminlog auth success and admin grant/deny with the publicKey — without leaking secrets or tokens.Related Issue
Changes
🔐 Audit Logging Helper
backend/src/logger.ts🛡️ Admin Route Audit Entries
backend/src/routes/v1/admin.routes.ts🔑 Auth & Admin Grant/Deny Logging
backend/src/middleware/auth.tsverifyChallengelogs auth success with the publicKey (error path already logged).requireAdminlogs admin grant/deny with the publicKey.🧪 Tests
backend/tests/auth.test.tsbackend/tests/integration/reset-replay-race.test.tsVerification Results
admin.routes.tsverifyChallengelogs auth success, andrequireAdminlogs grant/deny with the publicKeyauth.tsCloses #824