_sudo() sends echo '<password>' | sudo -S -p "" <command> through the shell. For as long as it runs, the password is part of a process's argument list on the host, visible to every local user (ps, /proc/<pid>/cmdline), and in the shell's history if one is kept.
run_command(..., privileged=True) (#18) already does it right: the password goes to sudo -S on stdin of an exec channel and never into a command line.
Every _sudo caller is affected: package install/uninstall, updates, crontabs, VPN tunnels, fix_docker_permissions, fix_apt_proxy, fix_snmp. netOrk's Docker permission fix goes through run_device_action("fix_docker_permissions") since NetOrk/netork#775 (phase 7 of #765), which is how this came up.
Fix: let _sudo run privileged commands through run_command(privileged=True), or at least feed the password on stdin. That also overlaps with #10 (sudo -n without a password).
`_sudo()` sends `echo '<password>' | sudo -S -p "" <command>` through the shell. For as long as it runs, the password is part of a process's argument list on the host, visible to every local user (`ps`, `/proc/<pid>/cmdline`), and in the shell's history if one is kept.
`run_command(..., privileged=True)` (#18) already does it right: the password goes to `sudo -S` on stdin of an exec channel and never into a command line.
Every `_sudo` caller is affected: package install/uninstall, updates, crontabs, VPN tunnels, `fix_docker_permissions`, `fix_apt_proxy`, `fix_snmp`. netOrk's Docker permission fix goes through `run_device_action("fix_docker_permissions")` since NetOrk/netork#775 (phase 7 of #765), which is how this came up.
**Fix:** let `_sudo` run privileged commands through `run_command(privileged=True)`, or at least feed the password on stdin. That also overlaps with #10 (`sudo -n` without a password).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
_sudo()sendsecho '<password>' | sudo -S -p "" <command>through the shell. For as long as it runs, the password is part of a process's argument list on the host, visible to every local user (ps,/proc/<pid>/cmdline), and in the shell's history if one is kept.run_command(..., privileged=True)(#18) already does it right: the password goes tosudo -Son stdin of an exec channel and never into a command line.Every
_sudocaller is affected: package install/uninstall, updates, crontabs, VPN tunnels,fix_docker_permissions,fix_apt_proxy,fix_snmp. netOrk's Docker permission fix goes throughrun_device_action("fix_docker_permissions")since NetOrk/netork#775 (phase 7 of #765), which is how this came up.Fix: let
_sudorun privileged commands throughrun_command(privileged=True), or at least feed the password on stdin. That also overlaps with #10 (sudo -nwithout a password).