Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2190 +/- ##
==========================================
+ Coverage 80.08% 80.25% +0.17%
==========================================
Files 96 96
Lines 4645 4680 +35
==========================================
+ Hits 3720 3756 +36
+ Misses 667 666 -1
Partials 258 258
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/kind feature |
The Slack interceptor accepted any non-empty X-Slack-Signature header, so any caller could forge a request. Verify it with Slack's v0 HMAC-SHA256 scheme and reject timestamps outside a five minute window. secretRef is now required: existing Slack interceptors without one will reject all requests. Slack signs the raw url-encoded bytes, so add RawBody to InterceptorRequest because the sink rewrites Body to JSON and it would never match. Assisted by: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Ankur Sinha <anksinha@redhat.com>
9140154 to
bc89ec6
Compare
Fixes #2029
Changes
The Slack interceptor only checked that
X-Slack-Signaturewas non-empty - itnever verified it. Any request carrying that header was treated as authentic, so
anyone able to reach the EventListener could forge a Slack slash command and
trigger pipelines.
This verifies the signature using Slack's v0 HMAC-SHA256 scheme
against a signing secret supplied via
secretRef, rejects timestamps outside afive minute window to block replays, and fails closed when
secretRefismissing - matching the GitHub, GitLab, and Bitbucket interceptors.
Slack signs the original URL-encoded request body, while the sink converts
Bodyto JSON. This addsRawBodyto preserve the original bytes forsignature verification.
Configure the Slack interceptor with:
Documentation and the Slack example have been updated. Tests cover valid,
invalid, stale, and malformed requests.
Validation
assertions failed
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes