Repository navigation
app/log: redact credentials and API keys in URLs - #4813
Merged
Merged
Conversation
Redact passwords, query values and API-key-like path segments of URLs in all log messages and fields, and the full path of endpoint and URL flags in the startup config log. Keep integer and 0x hex query values, such as slots and roots. Drop the user info from the app_builder_config_url label.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4813 +/- ##
==========================================
+ Coverage 67.61% 67.64% +0.03%
==========================================
Files 254 255 +1
Lines 33609 33659 +50
==========================================
+ Hits 22725 22770 +45
- Misses 10883 10888 +5
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Checking every field of every log line costs about 1.8us per line, mostly from formatting errors. Remove that from the logger and redact only where raw endpoint URLs reach logs or metrics: the SSE listener's logs and metric labels, the fetcher and scheduler bn_addr fields, eth2wrap's url.Error decomposition, eth1wrap errors and the exit commands. go-eth2-client already masks its own Address().
|
KaloyanTanev
approved these changes
Oct 28, 2026
This was referenced Oct 28, 2026
obol-bulldozer Bot
pushed a commit
that referenced
this pull request
Oct 28, 2026
Based on the `v1.11.2` tag. - app/log: redact credentials and API keys in URLs (#4813). The builder config metric change is dropped, as v1.11 has no builder config. Conflicts in the SSE listener and the fetcher only touched v2-only code. - app, cmd: redact beacon node URLs in the version checks and `exit fetch`, which #4813 missed (main: `oisin/redact-url-followup`). category: bug ticket: none
obol-bulldozer Bot
pushed a commit
that referenced
this pull request
Oct 28, 2026
Missed by #4813: the beacon node version checks log the configured addresses, and exit fetch logs the endpoints when the client fails. category: bug ticket: none
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.



Beacon node, fallback beacon node, execution client and builder URLs can carry credentials: basic auth (
https://user:pass@host), and the API keys that hosted providers put in the path (/v2/<key>) or the query (?apikey=<key>). Several places logged them raw, and the logs may be shipped to Loki. The SSE metrics also used the raw beacon node URLs as labels, and charon's metrics are remote-written to Obol.Redaction happens only where a raw URL reaches a log or a metric, so the logger itself is unchanged.
log.RedactURLmasks the password and query values. Integer and0xhex query values (slots, indices, roots) are kept. It also masks either the whole path, or only path segments that look like API keys (20+ characters mixing letters and digits).Parsed configlog: flags named*endpoint*or*url*are masked fully, as go-eth2-client does for its own logs.*address*flags keep their path.app_beacon_node_sse_*metric labels. The raw address is still passed on, as the fetcher uses it to pick the client.bn_addrfields are redacted.urlfield from the decomposedurl.Erroris redacted.url.Errorin returned errors is redacted before wrapping. Go's HTTP client already strips passwords from it, but not keys in the path or query.beacon_nodes_endpointsis redacted.app_builder_config_url: the label drops the URL's user info. For relays that is the public relay key, which only lengthens the label.go-eth2-client already masks its own
Address(), so the validator API proxy logs were safe.category: feature
ticket: none