Lima's hostagent logs a proxy variable's value, password and all, when it
replaces a loopback proxy's address with the guest's gateway, overrides
the system's or lima.yaml's value, or can't parse it (Lima's
pkg/cidata setupEnv), and limactl start passes those lines on to its
stderr. For a VM without network policy, Start gives limactl the shell's
proxy variables, so a password in the shell's HTTPS_PROXY could land in
devvm's run log.
LoggedCmd's output now goes to the run log through a redacting writer:
whole lines (ended by \n or \r, or 64 KiB), each redacted, so a password
split across writes is still found, the rest written once the command
ends. redact, which the command's + line already took, also replaces the
password of any URL's user info with <password>, besides the proxy keys'
<key>. limactl.go's comment says when Lima logs the values.
- ui: urlPassword, redacting, redactLineMax.
- Tests: TestURLPasswordsStayOutOfTheLog (a Lima-like line, the URL in
the command's environment, never its arguments), TestRedactingWriter;
network.txtar and e2e's network check expect Lima's password stand-in
as devvm:<password>@ in the run log.
- Docs: troubleshooting's run log, network policy's Without network
policy.
Co-Authored-By: Claude Opus 5.5 <[email protected]>