feat: security hardening — encryption at rest, admin audit log, webhook signatures, secrets scanning#831
Merged
Mystery-CLI merged 1 commit intoJun 28, 2026
Conversation
…ok signature verification, secrets scanning Closes Ethereal-Future#731, Ethereal-Future#732, Ethereal-Future#733, Ethereal-Future#734 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@ambermartin681 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.
Summary
backend/src/db/encryption.jswith AES-256-GCM encrypt/decrypt (12-byte random IV, auth tag). Server now fails fast at startup ifDATABASE_ENCRYPTION_KEYis missing or not 32 bytes.AdminAuditLogPrisma model. Createdbackend/src/db/adminAuditLog.jsutility (logAdminAction). All KYC approve/reject admin actions now write audit entries. Added paginatedGET /admin/audit-logendpoint with filters for date range, admin user, and action type. No code ever issues UPDATE/DELETE against this table.backend/src/webhooks/verifySignature.jswith HMAC-SHA256 verification usingcrypto.timingSafeEqual(prevents timing attacks). Fixed existingverifyWebhookSignatureinstore.jsto also usetimingSafeEqual. AddedPOST /api/v1/webhooks/incomingendpoint with signature middleware applied. Secret sourced fromWEBHOOK_SIGNING_SECRETenv variable..gitleaks.tomlwith custom Stellar secret key pattern (56-char keys starting withS),.gitleaksignorefor test fixture suppression, and wiredGITLEAKS_CONFIGinto the existingsecurity-pipeline.ymlgitleaks step.Test plan
DATABASE_ENCRYPTION_KEYstartup validation: unset the env var, confirm server exits with a clear error messageencrypt()→decrypt()round-trips correctly in a Node.js REPLAdminAuditLogtableGET /admin/audit-logwith date/actionType filters/api/v1/webhooks/incomingwith correct HMAC-SHA256 signature → 200; with wrong signature → 401; with no signature header → 401gitleaks detect --source . --config .gitleaks.toml --verboselocally, confirm Stellar key pattern fires and test fixtures are suppressedCloses #731
Closes #732
Closes #733
Closes #734