Skip to content

Redact network identifiers from debug output - #10257

Open
wbnns wants to merge 4 commits into
omacom:quattrofrom
wbnns:redact-network-identifiers-from-debug-output
Open

wbnns wants to merge 4 commits into
omacom:quattrofrom
wbnns:redact-network-identifiers-from-debug-output

Conversation

@wbnns

@wbnns wbnns commented Sep 4, 2026 •

Copy link
Copy Markdown

Addresses the MAC, BSSID and LAN-address half of #10255. The hostname half is deliberately not
in scope — see the end.

The bug template asks reporters to attach omarchy-debug output. On a stock install that output
identifies the reporter's network, and nothing warns them before they paste it into a public
issue.

install/config/firewall.sh enables ufw, and ufw ships LOGLEVEL=low, so every blocked packet
lands in the kernel log with the addresses of devices on the LAN. Two sharper cases sit outside
those lines: the kernel's wifi association lines carry the access point BSSID, which resolves to
a street address through public wardriving databases, and bluetoothd logs the address of every
paired device — in colon form and in the underscore form its D-Bus object paths use.

What this does

Drops [UFW BLOCK] lines, then substitutes MAC addresses in all three renderings
(aa:bb:…, dev_AA_BB_…, wlxaabbccddeeff), IPv4 and IPv6 — applied to both the dmesg
and journalctl -b -p 4..1 sections, since ufw logs at kernel warning level and the journal
carries the same packet log. One shared function so the two cannot drift.

Details that took a few passes to get right:

  • Hex is matched case-insensitively. The kernel prints MACs lowercase; BlueZ prints them
    uppercase.
  • IPv6 is substituted before MAC, and neither may start after a colon, so the MAC rule cannot
    consume six groups out of the middle of an address and leave the prefix, and colon-hex
    fingerprints (MD5:aa:bb:…) are left whole.
  • A trailing colon or dot ends a match only when what follows is not more of the same. That
    catches connect to <mac>: Host is down and a sentence-final address while leaving
    fingerprints and 1.2.3.4.5 intact.
  • Boundaries are captured and restored rather than using \b, and each rule runs twice so two
    addresses separated by one character are both caught.
  • Loopback, link-local and the unspecified address are stood aside first. They identify nobody
    and losing them destroys the diagnosis: 169.254.x.x is a failed DHCP lease, 127.0.0.53 a
    query to the resolved stub, 0.0.0.0 a wildcard bind.
  • An octet range check spares firmware versions such as 10.1.467.2, where 467 is not an
    octet.

Why the scrub is scoped to two sections

Only dmesg and the journal are touched — never the inxi report or the package list. inxi
is already invoked as inxi -Farz, and -z is its own privacy filter; this brings the two
larger sections in line with the intent already applied to the smallest.

Verified

Over the 709 lines of dmesg and journal the scrub touches:

result
MACs, all three renderings 0
routable IPv4 0
IPv6 0
[UFW BLOCK] lines 0
substitutions made 45 <mac>, 8 <ip>, 8 <ipv6>

237 kernel lines, the package list and the inxi report are unchanged. ./test/cli passes.

Not in scope, on purpose

  • The hostname. Still present, both from Hostname: $(hostname) and the journal's default
    short prefix. Whether Omarchy's debug reports carry a hostname is a product decision for
    @dhh, and it is a visible change to every future report, so it belongs in its own change.
    omarchy-debug output includes unredacted LAN IPs and MAC addresses, and the bug template asks users to attach it #10255 should not be closed on this PR alone.
  • Version strings whose parts are all valid octets, such as Firmware version 0.29.29.5.
    Not separable from an address by shape.
  • Substituting ufw lines rather than dropping them. The substituted form is demonstrably
    clean and "the firewall is dropping this" is sometimes the answer, but that is a
    volume-versus-diagnosis judgement.

Review history

@chessing234 found that the first version was lowercase-only on hex and dropped ufw lines
without substituting anything else; both were real leaks here. @omarchybot then found the
underscore and wlx MAC renderings, the MAC rule eating an IPv6 middle, the hex:: over-match
corrupting caf::actor_system, and the unranged IPv4 rule destroying firmware versions and
special-purpose addresses. All fixed.

Worth recording, since it recurred: my first verification used the same lowercase pattern the
code used, so it reported "11 → 0" when the truth was 11 → 1; and a later check looked for
survivors rather than corruption, so it could not have caught the hex:: false positives. The
numbers above are measured with deliberately wider patterns than the code uses.

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the mac sed only matches lowercase hex — kernel/wifi lines often print uppercase bssids, so those still leak. also only whole ufw-block lines are dropped; ipv4/ipv6 outside those lines (association helpers, dhcp, etc.) still show up in the pasted debug log.

The bug template asks reporters to attach omarchy-debug output, and on a
stock install that output identifies their network. ufw is enabled by
install/config/firewall.sh and ships LOGLEVEL=low, so every blocked packet
is logged with the source and destination addresses of devices on the LAN.
The kernel's wifi association lines additionally carry the access point
BSSID, which is geolocatable through public wardriving databases.

ufw logs at kernel warning level, so both the dmesg and the
journalctl -b -p 4..1 sections carry this; scrub through one function so
the two cannot drift apart.

inxi was already invoked as -Farz, whose -z filters its own output, so this
brings the two larger sections in line with the intent already applied to
the smaller one.

Measured on one machine: 2,965 lines to 908, with 11 MAC addresses and 20
addresses reduced to none. The kernel log, journal, package list and inxi
report are otherwise untouched. Hostname is still reported deliberately at
the top of the file.
@wbnns
wbnns force-pushed the redact-network-identifiers-from-debug-output branch from 95d010e to cb823ba Compare September 5, 2026 09:06
Two gaps in the first pass, both found in review.

The MAC pattern only matched lowercase hex. The kernel prints MACs
lowercase, but BlueZ prints them uppercase, so every paired Bluetooth
device address survived the scrub:

  bluetoothd: avdtp_connect_cb() connect to 88:C9:E8:C6:49:42: Host is down

Dropping whole [UFW BLOCK] lines also left addresses that appear anywhere
else in the two sections. On this machine that included a real IPv6 address
in a systemd-resolved warning.

Add IPv4 and IPv6 rules alongside the MAC one. This is safe because the
scrub is applied only to dmesg and journalctl, never to the inxi report or
the package list, which is where dotted version strings such as
"inxi 3.3.41.1" and "socat 1.8.1.3-1" live; those are left untouched.

MACs are substituted before the IPv6 rules so a MAC is never mistaken for
an address, and the compressed-IPv6 rule requires a leading hex group so a
bare "::" is not rewritten.
@wbnns

wbnns commented Sep 5, 2026

Copy link
Copy Markdown
Author

Both correct, and both were real on my own machine. Thank you — pushed in 92ba019.

Uppercase hex. Confirmed, and worse than a theoretical gap: the survivor was a paired
Bluetooth device, because BlueZ prints MACs uppercase while the kernel prints them lowercase.

bluetoothd[824]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to 88:C9:E8:C6:49:42: Host is down (112)

My verification in the PR description missed it for exactly the same reason the code did — I
checked with the same lowercase-only pattern, so it reported zero MACs remaining. The "11 → 0"
figure I quoted was wrong; case-insensitively it was 11 → 1.

Addresses outside the ufw lines. Also confirmed. A real IPv6 address was sitting in a
systemd-resolved warning in the journal section, untouched by the line-drop:

systemd-resolved[628]: Using degraded feature set UDP instead of UDP+EDNS0 for DNS server fd7a:...

I have added IPv4 and IPv6 rules next to the MAC one, and made all hex matching
case-insensitive.

I should also correct something I argued in the PR description. I said masking IPs wholesale
would corrupt version strings like inxi 3.3.41.1 and fd 10.4.2-2. That reasoning was
wrong: the scrub only ever touches the dmesg and journalctl output, and those version
strings live in the inxi report and the package list, which it never sees. After the ufw lines
are dropped, dmesg contains no dotted-quad strings at all on this machine, and the journal
contained only real addresses. Verified after the change — the five remaining IPv4-shaped
strings are all in untouched sections:

SYSTEM INFORMATION:  X.org 1.21.1.24
INSTALLED PACKAGES:  imagemagick 7.1.2.30-1, inotify-tools 4.25.9.0-1,
                     inxi 3.3.41.1-1, socat 1.8.1.3-1

Ordering detail, since it is easy to get wrong: the MAC rule runs before the IPv6 rules, so a
MAC is never rewritten as an address, and the compressed-IPv6 rule requires a leading hex group
so a bare :: is left alone.

Current counts on a full run — MACs, IPv6 and [UFW BLOCK] all zero case-insensitively, with
203 kernel lines and 164 packages still present.

On IPv6 I want to be straight about the limits: I only had one machine to test on, and the only
real address it produced was a Tailscale one. A dual-stack host on native IPv6 would exercise
these rules far harder than anything I can check here.

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mac scrubbing works and ufw lines are dropped, but the ipv4/ipv6 sed rules use \b which gnu sed -E doesn't treat as a word boundary, so most addresses still leak from dmesg/journal. drop \b or use patterns that match without it.

@wbnns

wbnns commented Sep 5, 2026

Copy link
Copy Markdown
Author

You were right on both earlier points, so I tested this one carefully rather than assuming
either way — but I think this one does not hold, and dropping \b would introduce a bug.

GNU sed does support \b. It is a GNU extension, available in both BRE and ERE:

$ sed --version | head -1
sed (GNU sed) 4.10

$ printf 'addr 192.168.1.50 here\n' | sed -E 's/\b([0-9]{1,3}\.){3}[0-9]{1,3}\b/<ip>/g'
addr <ip> here

$ printf 'server fd7a:115c:a1e0::53\n' | sed -E 's/\b[0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){0,6}::([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){0,6})?/<ipv6>/g'
server <ipv6>

Measured on a full run, counting only the two sections the scrub touches (658 lines of dmesg +
journal), with case-insensitive patterns:

real IPv4 remaining:  0      <ip>   substitutions: 8
real IPv6 remaining:  0      <ipv6> substitutions: 7
MACs remaining:       0      <mac>  substitutions: 37

And \b is doing protective work here, not just boundary-tightening. Without it the IPv6
rule eats C++ scope-resolution operators in log lines, because e:: matches
[0-9a-fA-F]{1,4}:::

$ LINE='python[1142]: QSqlDatabasePrivate::removeDatabase: connection is still in use'

$ echo "$LINE" | sed -E 's/\b[0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){0,6}::(...)?/<ipv6>/g'
python[1142]: QSqlDatabasePrivate::removeDatabase: connection is still in use

$ echo "$LINE" | sed -E 's/[0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){0,6}::(...)?/<ipv6>/g'
python[1142]: QSqlDatabasePrivat<ipv6>removeDatabase: connection is still in use

Two journal lines on this machine would be mangled that way. The real address is still caught
with \b present, so the boundary costs nothing.

If the underlying concern is portability rather than GNU behaviour, I am happy to change it —
but the \b-free equivalent needs explicit boundary classes and capture-group restoration,
something like (^|[^0-9A-Za-z.:])...($|[^0-9A-Za-z.:]), which is harder to read and has
adjacent-match pitfalls. Given bin/omarchy-debug is #!/bin/bash on Arch, GNU sed seems a
safe assumption. Say the word if you would rather have it anyway.

One caveat on my own numbers, since I got this wrong earlier in this PR: my first check for a
surviving IPv6 reported 1, which turned out to be my grep matching e:: inside
QSqlDatabasePrivate:: — a false positive in the verification, not a leak. The counts above are
after correcting that.

@wbnns
wbnns requested a review from chessing234 September 5, 2026 09:57
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5 in Claude Code, with an independent second opinion from Codex (gpt-5.6-sol) at xhigh reasoning. Everything below was executed on a disposable Omarchy VM: ./test/cli passes on this branch, and I ran bin/omarchy-debug --no-sudo --print there plus scrub_network_identifiers directly against synthetic log lines. Every example in this comment is a string I constructed; no real log output from any machine appears here.

The scrub does what it aims at. All six strings from #10255 and its follow-up come back redacted, including the uppercase BlueZ address and the compressed IPv6 in the resolved warning. The function is defined before both call sites, grep -v returning 1 on an all-filtered stream does not propagate because sed exits 0, and every consumer of the file (--print, View, Save, Upload) reads it after the scrub has run. Those are all fine.

The problem is what it says about itself. As a privacy fix the bar is completeness, because a reporter who reads the table in the description will paste the output believing it is clean.

The hostname #10255 named is still in the output, 41 times

journalctl -b -p 4..1 at line 73 uses journalctl's default short format, which prefixes every entry with _HOSTNAME. The four sed rules only match address-shaped text, so the hostname survives on every selected line:

IN : Sep 05 09:12:33 daves-thinkpad kernel: wlp0s20f3: authenticate with 9e:1a:2b:3c:4d:39
OUT: Sep 05 09:12:33 daves-thinkpad kernel: wlp0s20f3: authenticate with <mac>

On an idle VM with no wifi and no LAN traffic, a full --no-sudo --print run of this branch contained the machine's hostname 41 times: once from Hostname: $(hostname) at line 57, and 40 more from the journal prefix. <mac>, <ip> and <ipv6> were 0, so the report looked completely scrubbed while carrying the one identifier the issue explicitly listed ("Hostname is included separately at line 39"). On a laptop with a real journal that count goes up, not down.

This is worth stating plainly because the argument in the description cuts the other way: inxi -z at line 63 suppresses inxi's own host line, and line 57 immediately puts it back. journalctl --no-hostname fixes the prefix, but only if line 57 goes too — one occurrence leaks it just as well as forty. Whether Omarchy wants hostnames in debug reports at all is @dhh's call, not mine, so I have pushed nothing.

Two smaller residues in the same category, both at warning priority and both untouched:

IN : NetworkManager[612]: <warn> device (wlp0s20f3): Activation: (wifi) association took too long, failing activation for 'Dave Home 5G'
IN : wpa_supplicant[700]: wlp0s20f3: CTRL-EVENT-ASSOC-REJECT bssid=9e:1a:2b:3c:4d:39 status_code=17 ssid="Dave Home 5G"
IN : Sep 05 09:12:33 host systemd[1]: Failed at /home/davidhh/.config/foo

The BSSID goes; the SSID beside it and the username in the path stay.

MAC addresses in their other common renderings survive

Codex found this one and I confirmed each case. The rule at line 43 matches colon-separated hex only, and BlueZ's D-Bus object paths — the exact subsystem the description cites for paired devices — use underscores:

IN : bluetoothd[824]: /org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF: Connection refused
OUT: bluetoothd[824]: /org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF: Connection refused

IN : wireplumber[1200]: bluez5: device dev_88_C9_E8_C6_49_42 failed to connect
OUT: wireplumber[1200]: bluez5: device dev_88_C9_E8_C6_49_42 failed to connect

IN : kernel: wlxaabbccddeeff: link is not ready
OUT: kernel: wlxaabbccddeeff: link is not ready

wlx… is the predictable interface name a USB wifi adapter gets, and it is the adapter's MAC with the separators removed.

The IPv4 rule destroys diagnostic strings, including the ones a wifi bug needs

The description argues that scoping the scrub to dmesg and the journal is what makes wholesale IPv4 substitution safe, because dotted versions live in the other sections. That holds for the package list, but not inside dmesg itself. There is no octet range check, so any four dot-separated runs of one to three digits match:

IN : ath10k_pci 0000:03:00.0: firmware ver 10.1.467.2-1 api 2 features ignore-otp
OUT: ath10k_pci 0000:03:00.0: firmware ver <ip>-1 api 2 features ignore-otp

IN : rtw89_8852be 0000:02:00.0: Firmware version 0.29.29.5, cmd version 0
OUT: rtw89_8852be 0000:02:00.0: Firmware version <ip>, cmd version 0

IN : vboxguest: Successfully loaded version 7.0.20.0 (interface 0x00010004)
OUT: vboxguest: Successfully loaded version <ip> (interface 0x00010004)

467 is not a valid octet, which shows the shape alone is doing the deciding. Five-component versions lose their first four: firmware ver 10.2.4.70.63-2 becomes firmware ver <ip>.63-2. The wifi firmware version is precisely the field someone needs when triaging the wifi bug that produced the dump in the first place.

USB topology paths go the same way, and they are how you identify which port a failing device is on:

IN : usb 1-2.3.4.5: device not accepting address 7, error -71
OUT: usb 1-<ip>: device not accepting address 7, error -71

Fixed and special ranges are flattened too, and none of them identify anybody:

IN : avahi-daemon[500]: Registering new address record for 169.254.12.34 on wlp0s20f3.IPv4.
OUT: avahi-daemon[500]: Registering new address record for <ip> on wlp0s20f3.IPv4.

IN : systemd-resolved[628]: Using degraded feature set UDP for DNS server 127.0.0.53
OUT: systemd-resolved[628]: Using degraded feature set UDP for DNS server <ip>

IN : sshd[900]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
OUT: sshd[900]: error: Bind to port 22 on <ip> failed: Address already in use.

A 169.254.x.x address is the clearest signal there is that DHCP failed; 127.0.0.53 says the query went to the resolved stub rather than upstream; 0.0.0.0 says a wildcard bind. After substitution all three read <ip> and the diagnosis is gone. Exempting loopback, link-local and the unspecified address costs no privacy at all.

The \b does less than the check that established it

You are right that \b stops the compressed rule eating QSqlDatabasePrivate::. It stops it only when the token before :: contains a non-hex character. When that token is at a word boundary and is entirely hex and at most four characters, the rule fires, and there is no trailing boundary, so it also eats the start of the next symbol:

IN : app[1234]: panicked at std::os::fd::AsRawFd: bad descriptor
OUT: app[1234]: panicked at std::os::<ipv6>sRawFd: bad descriptor

IN : service[123]: caf::actor_system: unhandled exception
OUT: service[123]: <ipv6>tor_system: unhandled exception

IN : service[123]: cc::Build::compile failed
OUT: service[123]: <ipv6>uild::compile failed

caf is the C++ Actor Framework's namespace and fd is a real Rust module path, so the verification pattern that reported "0 real IPv6 remaining" would not have caught these — they are false positives in the output, not survivors in it. Low frequency, but it is the same class of mistake as the lowercase-only check.

The ordering comment has the causality backwards

Lines 37-39 say MACs are substituted first "so that a MAC is never mistaken for an address". Neither IPv6 rule can match a bare MAC in the first place: a MAC has six groups and line 45 requires eight, and line 46 requires a literal ::. The ordering is not protecting anything. What it does do, because line 43 has no \b on either side, is let the MAC rule consume six two-hex groups out of the middle of an IPv6 address and leave the prefix behind:

IN : addr 2001:db8:00:11:22:33:44:55 assigned
OUT: addr 2001:d<mac>:55 assigned

The match starts inside db8. A random SLAAC address will not look like that, so this is a real but unlikely leak; the reason to mention it is that the comment states the opposite of what the code does, and the comment is what the next person will trust. The same missing boundary mangles colon-hex fingerprints: MD5:aa:bb:cc:dd:ee:ff:00:11:… comes back as M<mac>:<mac>:55:66:….

Dropping the ufw lines rather than substituting them

A judgement call for @dhh rather than a defect, but worth naming: grep -v at line 41 deletes the record instead of redacting it, and after the address rules have run most of what is left — interface, protocol, ports, flags, length, frequency — is both safe and sometimes the whole diagnosis, since "the firewall is dropping this" is a real answer. The substituted form is already demonstrably clean:

IN : [UFW ALLOW] IN=wlan0 MAC=aa:bb:cc:dd:ee:ff:11:22:33:44:55:66:08:00 SRC=192.168.1.20 DST=192.168.1.1 PROTO=TCP SPT=443 DPT=51000
OUT: [UFW ALLOW] IN=wlan0 MAC=<mac>:<mac>:08:00 SRC=<ip> DST=<ip> PROTO=TCP SPT=443 DPT=51000

Note also that [UFW ALLOW], [UFW AUDIT] and [UFW LIMIT BLOCK] do not contain the literal [UFW BLOCK], so a user who has raised LOGLEVEL keeps those lines. They are scrubbed rather than dropped, so that is a volume difference and not a leak.

A second leak in the same file, which #10284 fixes

Not this PR's doing and not a request to widen it, but it belongs on the record next to a privacy fix. LOG_FILE="/tmp/omarchy-debug.log" at line 29 is a fixed path written by cat > at line 55 under the default 0022 umask, so the report lands at -rw-r--r-- and is left there. On a shared machine the predictable name is worse than the mode. Demonstrated on the VM, where a root-owned file already sat at that path:

./bin/omarchy-debug: line 55: /tmp/omarchy-debug.log: Permission denied
OTHER-USERS-SECRET-REPORT
exit=0

The redirection fails, there is no set -e, the script carries on, and --print emits the other user's report and exits 0. In the interactive path that is the "Upload log" option sending someone else's debug report to logs.omarchy.org. #10284 replaces that path with a 0700 mktemp -d; I checked and it merges cleanly with this branch, so the two are complementary rather than competing. It would also make the /tmp/omarchy-debug.log references in default/agents/skills/omarchy/contributing.md:25 and default/agents/skills/diagnose-crash/reporting.md:90 wrong, which is that PR's problem to solve, not yours.

Where this leaves #10255

The MAC, BSSID and LAN-address half is closed. The hostname half is not, so I would not close the issue on this PR as it stands. The issue's other suggestion — a line in the output telling the reporter it may still carry identifying data — has more weight now than it did when it was written, not less, precisely because the rest of the output is clean enough to be trusted.

What I did not do: nothing was pushed to your branch. The hostname question is a decision about what Omarchy's debug reports contain, and the over- versus under-redaction trade-off in the IPv4 rule is one you argued explicitly in the thread; neither is mine to settle. Waiting on @dhh for those two, and on you for the underscore-form and wlx MAC renderings, which are a straight gap rather than a trade-off.

On the second opinion: the hostname finding and the hex:: over-match were reached on both sides, and codex's independence is not currently guaranteed, so read that agreement as weaker than it looks. The underscore-form BlueZ paths, the wlx interface name, the USB topology paths, the 467 octet, and the mechanism by which a stale /tmp file gets printed as your own report are all codex's, and I verified each of them against the code before repeating it here.

Review asked for the address rules not to depend on \b. Each rule now
captures the character preceding the match and restores it, which removes
the escape and keeps the guard it was providing.

The guard matters for the compressed-IPv6 rule. Without a leading boundary
it eats C++ scope resolution in log lines, because "e::" matches
[0-9a-fA-F]{1,4}:: --

  QSqlDatabasePrivate::removeDatabase
  QSqlDatabasePrivat<ipv6>removeDatabase

Capturing the preceding character rather than consuming a trailing one also
means two addresses separated by a single space are both substituted; a
trailing boundary class would consume the separator and skip the second.

Verified on a full run over the 707 lines of dmesg and journal that the
scrub touches: no MACs in either case, no IPv4, no IPv6 and no [UFW BLOCK]
lines remain, with 44, 8 and 8 substitutions made. The kernel log (237
lines), package list (164) and inxi report are unchanged.
…tics

Review found the redaction both incomplete and destructive. Both directions
are addressed here.

Missed identifiers. BlueZ writes addresses with underscores in its D-Bus
object paths, which is the exact subsystem cited for paired devices, and a
USB wifi adapter's predictable interface name is its MAC with the
separators stripped. Neither matched a colon-separated rule:

  /org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF
  wlxaabbccddeeff

The MAC rule could also start inside an IPv6 address, consuming six
two-hex groups and leaving the prefix behind. IPv6 is now substituted
first, and neither rule may start after a colon, which also leaves
colon-hex fingerprints (MD5:aa:bb:...) intact.

Destroyed diagnostics. An unranged dotted-quad matched firmware versions
and USB topology paths, and flattened addresses that identify nobody:
169.254.x.x is how a failed DHCP lease presents, 127.0.0.53 says a query
reached the resolved stub, 0.0.0.0 says a wildcard bind. Those three ranges
are now stood aside before substitution, and an octet range check spares
"firmware ver 10.1.467.2" where 467 is not an octet.

A trailing colon or dot now ends a match only when what follows is not more
of the same, so "connect to <mac>: Host is down" and a sentence-final
address are both caught while fingerprints and 1.2.3.4.5 stay whole.

The comment claiming MAC-first ordering prevents a MAC being read as an
address said the opposite of what the code did, and is corrected.

Verified over the 709 lines of dmesg and journal the scrub touches: no MAC
in any of the three renderings, no routable IPv4, no IPv6 and no
[UFW BLOCK] lines remain, with 45, 8 and 8 substitutions made. 237 kernel
lines and the package list are unchanged. ./test/cli passes.

Dotted-quad version strings whose parts are all valid octets, such as
"Firmware version 0.29.29.5", are still substituted. That one is not
separable by shape and is left as the open trade-off.
@wbnns

wbnns commented Sep 6, 2026 •

Copy link
Copy Markdown
Author

Every case reproduced here, and the ones that are straight defects
are fixed in e6a37c4. Taking them in the order raised.

Missed MAC renderings — fixed. The underscore form and the wlx/enx interface name both
leaked. Added rules for both:

/org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF  ->  /org/bluez/hci0/dev_<mac>
bluez5: device dev_88_C9_E8_C6_49_42   ->  bluez5: device dev_<mac>
kernel: wlxaabbccddeeff: link not ready ->  kernel: wlx<mac>: link not ready

The MAC rule eating an IPv6 middle — fixed, and you were right that my comment had it
backwards.
IPv6 is now substituted before MAC, and neither rule may start after a colon:

addr 2001:db8:00:11:22:33:44:55  ->  addr <ipv6>          (was 2001:d<mac>:55)
MD5:aa:bb:cc:dd:ee:ff:00:11:...  ->  unchanged            (was M<mac>:<mac>:55:...)

The comment now describes what the code actually does rather than the reverse.

Destroyed diagnostics — fixed for everything separable by shape. An octet range check
spares firmware versions where a part is not a valid octet, and loopback, link-local and the
unspecified address are stood aside before substitution:

firmware ver 10.1.467.2-1        ->  unchanged   (467 is not an octet)
address record for 169.254.12.34 ->  unchanged
DNS server 127.0.0.53            ->  unchanged
Bind to port 22 on 0.0.0.0       ->  unchanged

The hex:: over-match — fixed. A right-hand boundary now ends the compressed rule, so the
cases you and codex found are left alone:

caf::actor_system      ->  unchanged   (was <ipv6>tor_system)
cc::Build::compile     ->  unchanged   (was <ipv6>uild)
std::os::fd::AsRawFd   ->  unchanged

Adding those boundaries initially broke two real redactions — a MAC followed by : in
connect to 88:...:42: Host is down, and a sentence-final address — so the trailing rule now
ends a match only when what follows is not more of the same. That keeps fingerprints and
1.2.3.4.5 whole while still catching both.

Measured over the 709 lines of dmesg and journal the scrub touches: no MAC in any of the three
renderings, no routable IPv4, no IPv6, no [UFW BLOCK] lines, with 45, 8 and 8 substitutions.
237 kernel lines and the package list unchanged. ./test/cli passes.

What I have deliberately not done

The hostname. You are right that it is still there, that Hostname: $(hostname) puts back
what inxi -z removed, and that one occurrence leaks it as well as forty. I agree the issue is
not closed by this PR as it stands. But whether Omarchy's debug reports carry a hostname is a
product decision, and journalctl --no-hostname plus dropping line 57 is a visible change to
what maintainers see in every future report. That is DHH's call, so I have left it and would
rather it were a separate change than smuggled into this one.

Version strings that are valid octets. Firmware version 0.29.29.5 and
usb 1-2.3.4.5 still redact. There is no shape that separates those from an address, so
closing them means either a keyword heuristic or accepting under-redaction, and after arguing
the over/under trade-off earlier in this thread I would rather not decide it unilaterally.

Substituting ufw lines instead of dropping them. Your demonstration that the substituted
form is clean is convincing, and "the firewall is dropping this" being a real answer is a fair
point. It is a volume-versus-diagnosis judgement rather than a defect, so likewise DHH's.

On /tmp/omarchy-debug.log and #10284 — agreed that it is a separate problem, and I have not
widened this PR to touch it.

Two things I got wrong that your review surfaced, which are worth stating plainly: my earlier
"0 real IPv6 remaining" check would not have caught the hex:: false positives, because it was
looking for survivors rather than for corruption. And the ordering comment I defended was
describing protection the code was not providing.

@wbnns

wbnns commented Sep 6, 2026 •

Copy link
Copy Markdown
Author

@omarchybot the defects from your review are fixed in e6a37c4 and ready to re-check.

Specifically worth adversarial attention:

  • Adding right-hand boundaries to stop caf::actor_system being eaten initially broke two
    real redactions: a MAC followed by a colon (connect to 88:…:42: Host is down) and a
    sentence-final address. The trailing rule now ends a match only when what follows is not more
    of the same. That is the subtlest part of the change and the most likely to be wrong again.
  • The special-range exemptions work by standing the dots of 127.x, 169.254.x, 0.0.0.0 and
    255.255.255.255 aside as \001 before substitution and restoring them after. If a log line
    could legitimately contain \001, that is a hole I have not thought of.
  • IPv6-before-MAC ordering plus "may not start after a colon" is what stops the MAC rule
    consuming an IPv6 middle. I have tested 2001:db8:00:11:22:33:44:55 and MD5:aa:bb:… but not
    a wide corpus.

Three items from your review are untouched on purpose: the hostname, dotted-quad version
strings whose parts are valid octets, and dropping versus substituting ufw lines. All three read
to me as decisions for DHH rather than defects, and I have said so in the description rather
than deciding them here.

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uppercase mac, underscore bluez paths, wlx/enx names, and the colon-after-mac journal line all look covered on tip. lgtm.

@omarchybot omarchybot added the enhancement New feature or request label Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants