Repository navigation
fix: escape the word boundary in the IPv4 redaction example - #1110
Merged
Merged
Conversation
Inside a double-quoted YAML scalar \b is the backspace escape, so the pattern ended up requiring a literal 0x08 and matched no address at all. The neighbouring escapes in the same list are already doubled.
knQzx
force-pushed
the
fix/redaction-ipv4-pattern
branch
from
July 30, 2026 21:05
ca4fd4f to
3ec47d5
Compare
odubajDT
approved these changes
Jul 31, 2026
Contributor
|
Thank you for your contribution @knQzx ! |
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.
in
config_examples/redaction.yamlthe IPv4 entry uses a single-backslash\b:inside a double-quoted YAML scalar
\bis the backspace escape, so the pattern that reaches the redaction processor ends with a literal0x08byte instead of a word boundary. it can never match an address. every other escape in the same list is already doubled, so this one looks like a slip rather than intentparsing the file with yaml.v3 and compiling the result, the pattern matches none of
192.168.1.100,10.0.0.1,8.8.8.8,255.255.255.255,1.2.3.4, while the three neighbouring patterns work. with the fix it matches all fivethe same IPv4 regex lives in
internal/testcommon/oteltest/sinks.go:37without the\band behaves correctly theresomeone copying this example to strip IPs before shipping telemetry gets a config that looks right and redacts nothing. the shipped
allow_all_keys: falselimits how much that bites in practice, but the example is still wrongchanges
double the backslash so the word boundary survives YAML parsing, plus a changelog entry