Debug logging writes the Slack, Mattermost and ntfy webhook URLs to the log on every delivery #288

Closed
opened 2026-10-13 22:55:41 +02:00 by clawbot · 2 comments
Collaborator

What is wrong. With DNSWATCHER_DEBUG=true, every delivery logs the full endpoint URL. A Slack or Mattermost incoming webhook URL is the credential that lets anyone who has it post to the channel, and an ntfy topic URL lets anyone read and post the topic. The log goes to stdout, so to the Docker log and to whatever collects it.

Where (at v1.0.0-rc1): internal/notify/notify.go lines 310-314 (sending ntfy notification, key topic) and lines 389-393 (sending webhook notification, key url).

Scenario. An operator sets DNSWATCHER_DEBUG=true to look into a DNS problem. From then on each notification writes the Slack webhook URL, the Mattermost webhook URL and the ntfy topic URL to the log, once per endpoint; the log is shipped to a central store, kept by Docker, or pasted into an issue. Confirmed by reading.

Correct. README, Web Dashboard: "The dashboard intentionally does not expose any configuration details such as webhook URLs, notification endpoints, or API tokens"; CODE_STYLEGUIDE.md: secrets live in environment variables and are never written anywhere else. The log names the endpoint (slack, mattermost, ntfy), as the retry and failure lines already do, and never the path or query of its URL.

Done when: no log line at any level carries a webhook URL's path or query; the two debug lines name the endpoint and the title only; a notify test asserts the webhook path is absent from the debug log output.

Severity: minor

Model: fable-5-1

**What is wrong.** With `DNSWATCHER_DEBUG=true`, every delivery logs the full endpoint URL. A Slack or Mattermost incoming webhook URL is the credential that lets anyone who has it post to the channel, and an ntfy topic URL lets anyone read and post the topic. The log goes to stdout, so to the Docker log and to whatever collects it. **Where** (at `v1.0.0-rc1`): `internal/notify/notify.go` lines 310-314 (`sending ntfy notification`, key `topic`) and lines 389-393 (`sending webhook notification`, key `url`). **Scenario.** An operator sets `DNSWATCHER_DEBUG=true` to look into a DNS problem. From then on each notification writes the Slack webhook URL, the Mattermost webhook URL and the ntfy topic URL to the log, once per endpoint; the log is shipped to a central store, kept by Docker, or pasted into an issue. Confirmed by reading. **Correct.** README, Web Dashboard: "The dashboard intentionally does not expose any configuration details such as webhook URLs, notification endpoints, or API tokens"; CODE_STYLEGUIDE.md: secrets live in environment variables and are never written anywhere else. The log names the endpoint (`slack`, `mattermost`, `ntfy`), as the retry and failure lines already do, and never the path or query of its URL. **Done when:** no log line at any level carries a webhook URL's path or query; the two debug lines name the endpoint and the title only; a notify test asserts the webhook path is absent from the debug log output. Severity: minor Model: fable-5-1
clawbot self-assigned this 2026-10-13 22:55:41 +02:00
Author
Collaborator

Plan. Package internal/notify; no new package. The two debug lines name the endpoint (slack, mattermost, ntfy) and the title, never the URL; sendSlack is told which of Slack or Mattermost it is sending to. Every other log line and every error that reaches the log in this package is checked for the URL, its path or its query, and fixed where one carries it. Notify test: with debug logging on, a delivery to each endpoint writes no part of its URL's path or query to the log. TODO.md Completed Steps entry in the same commit.

Model: opus-5-5

Plan. Package `internal/notify`; no new package. The two debug lines name the endpoint (`slack`, `mattermost`, `ntfy`) and the title, never the URL; `sendSlack` is told which of Slack or Mattermost it is sending to. Every other log line and every error that reaches the log in this package is checked for the URL, its path or its query, and fixed where one carries it. Notify test: with debug logging on, a delivery to each endpoint writes no part of its URL's path or query to the log. `TODO.md` Completed Steps entry in the same commit. Model: opus-5-5
Author
Collaborator

Built in #294. The debug lines give the endpoint (ntfy, slack or mattermost) and the title instead of the URL. A webhook URL that does not parse no longer gets quoted whole in the startup error.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/dnswatcher/pulls/294. The debug lines give the endpoint (`ntfy`, `slack` or `mattermost`) and the title instead of the URL. A webhook URL that does not parse no longer gets quoted whole in the startup error. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dnswatcher#288