[P2] fix(sinks): Log only the webhook host on WebhookAuditSink POST failures
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
Research direction
In src/doberman/storage/sinks.py, inspect WebhookAuditSink._post and its four failure log paths. Read the existing _stub_urlopen tests and add cases for the listed exception types, checking that the host appears and SYNTH-SECRET does not. Add a changelog.d fragment; the issue is done when all four paths log only the webhook host and the tests pass.
Written by the indexing model from the issue text.
Description
Operators who put a token in their audit webhook URL get that token written into the Doberman log every time a webhook POST fails.
Problem
WebhookAuditSink._post in src/doberman/storage/sinks.py logs the raw self._url on four failure paths: HTTPError, URLError, TimeoutError, and the general OSError fallback. The config loader (_load_webhook_config) checks only the scheme and the HTTPS-for-non-loopback rule. It never rejects userinfo or query strings, so a URL such as https://user:token@host/hook?token=... passes validation and goes into the log in full. The documented path (auth_env) is already protected, but nothing protects the URL itself. Tracked in #758.
Impact
This breaks the repo's never-expose-secrets directive, and that is a real problem for an authorization product. Exposure needs three things: a credential in the URL, a failed POST, and someone who can read the logs. PostHog telemetry has no event for webhook failures or log content, so I can't measure how often it happens.
Solution
Add a small helper that formats urlparse(url).hostname plus the port when one is set, with brackets for IPv6. Use it at all four log sites and keep the rest of each message as it is. Add unit tests that reuse the _stub_urlopen pattern. Each test sets up the sink with https://u:[email protected]:1/x?t=SYNTH-SECRET, raises each exception type, and asserts that SYNTH-SECRET is not in caplog.text and the host is. The change also needs a changelog.d fragment.
Expected impact
I have no usable baseline because these failures produce no telemetry. After the fix, the new tests should show zero credential leaks across all four failure paths. That is the only verifiable signal.
- Actionability:
immediately_actionable - Inbox status:
ready - Signals behind it: 1
Filed automatically from the PostHog Self-driving inbox. It mirrors the finding; the fix is a maintainer's call.
- Dominant language
- Python
- Stars
- 277
- Forks
- 42
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DobermanCore/Doberman-Core
-
posthog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DobermanCore/Doberman-Core#791 ·
Maintainers usually reply within 3 days
-
level-6
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
DobermanCore/Doberman-Core#782 · 1 comment ·
Maintainers usually reply within 3 days
-
good first issue help wanted level-2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DobermanCore/Doberman-Core#333 ·
Maintainers usually reply within 3 days
-
good first issue help wanted level-2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
DobermanCore/Doberman-Core#272 ·
Maintainers usually reply within 3 days
-
chore: add a pre-commit config (ruff + lint-imports)May be free again @jonah-boop claimed this 82 days ago, and no pull request is open. Openenhancement good first issue level-2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
DobermanCore/Doberman-Core#195 · 5 comments ·
Maintainers usually reply within 3 days
All issues in DobermanCore/Doberman-Core
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
vllm-project/vllm-omni#10051 · 1 comment ·
Maintainers usually reply within 1 day
-
Bug Testing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SCIInstitute/SCIRun#2931 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 5 days
-
author-page correction
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
acl-org/acl-anthology#10827 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
marimo-team/marimo#11768 ·
Maintainers usually reply within 1 day