fix: add ethtool, lsmod, lspci, modinfo, dkms to read-only command allowlist
Read-only diagnostic commands ethtool, lsmod, lspci, modinfo, and dkms were missing from the readOnlyLeadPattern in the command classifier, causing compound diagnostic commands (e.g. 'uname -r && ethtool -i eno1 && lsmod | grep r8169') to be misclassified as config_mutation instead of read_only. This forced operator approval for simple hardware/driver inspection during the 2026-08-12 hubris NIC cutover session. Added regression test with the exact compound command from that session.
This commit is contained in:
@@ -72,6 +72,7 @@ var readOnlyLeadPattern = regexp.MustCompile(
|
||||
`grep|egrep|fgrep|rg|wc|sort|uniq|cut|tr|tee|find|tree|locate|` +
|
||||
`dpkg\s+(-l|-s|--list|--status)\b|apt\s+(list|search|show)\b|` +
|
||||
`systemctl\s+(status|is-active|is-enabled|is-failed|list-units|list-unit-files|list-timers|show)\b|` +
|
||||
`ethtool|lsmod|lspci|modinfo|dkms|` +
|
||||
`timedatectl|hostnamectl|systemd-analyze|` +
|
||||
`docker\s+(ps|images|inspect|logs|version|info|stats)|` +
|
||||
`docker\s+compose\s+(logs|ps|top|config|images|port|cp)\b|` +
|
||||
|
||||
Reference in New Issue
Block a user