Repository navigation
spored: never log a webhook URL (#1592) - #1629
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
scttfrdmn
force-pushed
the
hardening/1592-webhook-url-logs
branch
from
November 14, 2026 20:17
1c2ef4b to
2a71a4c
Compare
A Slack/Teams/queue incoming-webhook URL is itself the credential, and postWebhook logged it on every POST, success included, and inside the *url.Error a failed POST returns. It now logs only scheme://host, and redacts the URL in any *url.Error it logs. The lagotto poller's equivalent is spore-host/lagotto#316.
scttfrdmn
marked this pull request as ready for review
November 14, 2026 21:59
scttfrdmn
force-pushed
the
hardening/1592-webhook-url-logs
branch
from
November 14, 2026 21:59
2a71a4c to
709d1cc
Compare
Merged
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.
Fixes #1592
What changes
pkg/agent.postWebhook, which serves the spot-interruption and completion webhooks, logged the full URL on every POST, success included. It also logged the*url.Errorfrom a failedhttp.Client.Do, which quotes the URL. Slack, Teams and most queue webhooks authorise a POST by the token in the URL's path or query, so the URL is the credential. spored now logs onlyscheme://host(webhookEndpoint) and rewrites the URL in any*url.Errorit logs to the same form (redactURLError).The lagotto poller half of the finding is in another repository, so I filed spore-host/lagotto#316 for it (four
post to webhook: %wsites inpkg/watcher/notifier.go).The verifier noted these URLs were also EC2 tags. That is no longer true: since #1359 they live in the per-launch config object (
pkg/launchconfig), not in tags.Tests
webhook_redact_test.godrives a real POST for each outcome: success, a 403, a transport error against a closed server, and a URL that fails to build a request. It asserts the log names the endpoint and contains none of the path token, the query token or/services/. Against main it reports 12 leaks.make checkis clean apart from the known space-in-path failures. Semgrep is clean.Deploy steps
Live check for the owner
After the release, launch a throwaway spore with
--completion-webhook-url https://<a webhook.site URL>/<token>?k=<token>and a short--ttl, and touch the completion file. Thengrep -c '<token>' /var/log/spored.logon the instance (orjournalctl -u spored) should return 0, and the log should shownotice POSTed to https://webhook.site. Reap it and confirm it is gone.