fix(security): add HMAC signature to Process Engine outbound webhooks (#266) - #287
Merged
Conversation
…ebhooks (#266) Outbound webhook calls now include X-Trinity-Signature (v1=HMAC-SHA256) and X-Trinity-Timestamp headers so receivers can verify Trinity as the origin. Signing key derived from SECRET_KEY via HMAC("webhook-signing"). Payload serialized with sorted keys for deterministic signatures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
X-Trinity-Signature(HMAC-SHA256) andX-Trinity-Timestampheaders to all outbound webhook calls from the Process EngineSECRET_KEYviaHMAC(SECRET_KEY, "webhook-signing")— no extra config neededsort_keys=Trueand compact separators for deterministic signaturesChanges
src/backend/services/process_engine/events/webhook_publisher.py— HMAC signing in_send_webhook(), new_compute_signature()static methodtests/unit/test_webhook_signature.py— 10 unit tests (determinism, sensitivity, header verification, receiver verification, serialization)Receiver Verification
Receivers should verify signatures like this:
Test Plan
pytest tests/unit/test_webhook_signature.py -vCloses #266
🤖 Generated with Claude Code