Remove webhook log path (which contains sig signing secret) from logs, unless in debug mode - #844
Open
patrickpaul-tereina wants to merge 1 commit into
Conversation
…, unless in debug mode
pull Bot
pushed a commit
to urkonn/keel
that referenced
this pull request
Aug 19, 2026
Webhook/notification log paths could leak secrets: - pkg/http auth middleware logged the Basic auth password at error level and the bearer token at warn level whenever a webhook request failed authentication. - The teams, discord, webhook and mattermost notification senders logged the full configured endpoint URL at info level; these URLs embed the webhook signing secret in the path or query string. - mattermost additionally logged the raw endpoint on the invalid- endpoint error path, and all four senders returned url.ParseRequestURI errors, which echo the input, back to the notification manager which logs them. Changes: - Add notification.SafeURL (safe at any level: scheme+host only) and notification.DebugURL (debug level only: path structure preserved, userinfo / token-like segments / query values redacted). - Senders now log only the redacted endpoint at info level; the more detailed endpoint is logged only when debug logging is enabled, and is redacted there too. - Auth middleware no longer logs passwords or tokens. - Parse-error messages no longer echo the raw endpoint. Audit of all log statements in the webhook trigger and notification HTTP handler paths confirms no other statement logs request paths, query strings, headers or payloads that can carry secrets: remaining payload logs (jfrog, harbor, registry notifications) are debug-level only. Supersedes community PR keel-hq#844 (which redacted only the teams sender and still logged the full URL in debug mode); keel-hq#844 is intentionally left unmerged. Tests: log-capture unit tests prove the secret does not appear in captured log output when a webhook request is processed (both inbound authenticated webhook endpoints and outbound sender configuration), at info and debug levels. Spec-Ref: helix-specs@dd566737:000395_security-fix-keep-the
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.
This seemed to be the easiest way to keep the full webhook string out of the logs but also provide something helpful.