Skip to content

spored: never log a webhook URL (#1592) - #1629

Merged
scttfrdmn merged 1 commit into
mainfrom
hardening/1592-webhook-url-logs
Nov 14, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
hardening/1592-webhook-url-logs

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

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.Error from a failed http.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 only scheme://host (webhookEndpoint) and rewrites the URL in any *url.Error it 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: %w sites in pkg/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.go drives 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 check is clean apart from the known space-in-path failures. Semgrep is clean.

Deploy steps

  • spored only, so no Lambda or IAM change. It reaches instances with the next release's spored publish.

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. Then grep -c '<token>' /var/log/spored.log on the instance (or journalctl -u spored) should return 0, and the log should show notice POSTed to https://webhook.site. Reap it and confirm it is gone.

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn force-pushed the hardening/1592-webhook-url-logs branch from 1c2ef4b to 2a71a4c Compare November 14, 2026 20:17
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
scttfrdmn marked this pull request as ready for review November 14, 2026 21:59
@scttfrdmn
scttfrdmn force-pushed the hardening/1592-webhook-url-logs branch from 2a71a4c to 709d1cc Compare November 14, 2026 21:59
@scttfrdmn
scttfrdmn merged commit e70e404 into main Nov 14, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the hardening/1592-webhook-url-logs branch November 14, 2026 22:16
@scttfrdmn scttfrdmn mentioned this pull request Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: Credential-bearing webhook URLs are logged in full by spored and by the lagotto poller

1 participant