Repository navigation
Conversation
chessing234
left a comment
There was a problem hiding this comment.
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.
95d010e to
cb823ba
Compare
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.
|
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 My verification in the PR description missed it for exactly the same reason the code did — I Addresses outside the ufw lines. Also confirmed. A real IPv6 address was sitting in a I have added IPv4 and IPv6 rules next to the MAC one, and made all hex matching I should also correct something I argued in the PR description. I said masking IPs wholesale Ordering detail, since it is easy to get wrong: the MAC rule runs before the IPv6 rules, so a Current counts on a full run — MACs, IPv6 and On IPv6 I want to be straight about the limits: I only had one machine to test on, and the only |
chessing234
left a comment
There was a problem hiding this comment.
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.
|
You were right on both earlier points, so I tested this one carefully rather than assuming GNU sed does support $ 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 + And $ 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 useTwo journal lines on this machine would be mangled that way. The real address is still caught If the underlying concern is portability rather than GNU behaviour, I am happy to change it — One caveat on my own numbers, since I got this wrong earlier in this PR: my first check for a |
|
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: 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, 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
On an idle VM with no wifi and no LAN traffic, a full This is worth stating plainly because the argument in the description cuts the other way: Two smaller residues in the same category, both at warning priority and both untouched: The BSSID goes; the SSID beside it and the username in the path stay. MAC addresses in their other common renderings surviveCodex 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:
The IPv4 rule destroys diagnostic strings, including the ones a wifi bug needsThe description argues that scoping the scrub to
USB topology paths go the same way, and they are how you identify which port a failing device is on: Fixed and special ranges are flattened too, and none of them identify anybody: A The
|
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.
|
Every case reproduced here, and the ones that are straight defects Missed MAC renderings — fixed. The underscore form and the The MAC rule eating an IPv6 middle — fixed, and you were right that my comment had it 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 The Adding those boundaries initially broke two real redactions — a MAC followed by Measured over the 709 lines of dmesg and journal the scrub touches: no MAC in any of the three What I have deliberately not doneThe hostname. You are right that it is still there, that Version strings that are valid octets. Substituting ufw lines instead of dropping them. Your demonstration that the substituted On Two things I got wrong that your review surfaced, which are worth stating plainly: my earlier |
|
@omarchybot the defects from your review are fixed in e6a37c4 and ready to re-check. Specifically worth adversarial attention:
Three items from your review are untouched on purpose: the hostname, dotted-quad version |
chessing234
left a comment
There was a problem hiding this comment.
uppercase mac, underscore bluez paths, wlx/enx names, and the colon-after-mac journal line all look covered on tip. lgtm.
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-debugoutput. On a stock install that outputidentifies the reporter's network, and nothing warns them before they paste it into a public
issue.
install/config/firewall.shenables ufw, and ufw shipsLOGLEVEL=low, so every blocked packetlands 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
bluetoothdlogs the address of everypaired 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 thedmesgand
journalctl -b -p 4..1sections, since ufw logs at kernel warning level and the journalcarries the same packet log. One shared function so the two cannot drift.
Details that took a few passes to get right:
uppercase.
consume six groups out of the middle of an address and leave the prefix, and colon-hex
fingerprints (
MD5:aa:bb:…) are left whole.catches
connect to <mac>: Host is downand a sentence-final address while leavingfingerprints and
1.2.3.4.5intact.\b, and each rule runs twice so twoaddresses separated by one character are both caught.
and losing them destroys the diagnosis:
169.254.x.xis a failed DHCP lease,127.0.0.53aquery to the resolved stub,
0.0.0.0a wildcard bind.10.1.467.2, where467is not anoctet.
Why the scrub is scoped to two sections
Only
dmesgand the journal are touched — never theinxireport or the package list.inxiis already invoked as
inxi -Farz, and-zis its own privacy filter; this brings the twolarger sections in line with the intent already applied to the smallest.
Verified
Over the 709 lines of
dmesgand journal the scrub touches:[UFW BLOCK]lines<mac>, 8<ip>, 8<ipv6>237 kernel lines, the package list and the inxi report are unchanged.
./test/clipasses.Not in scope, on purpose
Hostname: $(hostname)and the journal's defaultshortprefix. 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.
Firmware version 0.29.29.5.Not separable from an address by shape.
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
wlxMAC renderings, the MAC rule eating an IPv6 middle, thehex::over-matchcorrupting
caf::actor_system, and the unranged IPv4 rule destroying firmware versions andspecial-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. Thenumbers above are measured with deliberately wider patterns than the code uses.