Scripts should respect the principle of least privilege. #7156
Replies: 1 comment 3 replies
-
so-status is the only script out of them so far that I can find that really doesn't need root access. The rest require root because they are either interacting with docker or accessing secrets. So if a user without privileges runs so-status and sees an issue there is nothing they can action on because they don't have access. so-status results are stored in influx which is what grid uses to detect a fault state on a sensor. If you are trying to set up some detection for when things break you can set up an alert in grafana when a sensor goes into the fault state. Or you can monitor /opt/so/log/sostatus/sostatus.log with external tools on each device in the deployment. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
All of the 180+ scrips in
salt/common/tools/sbin
require the user to run them as root. This is the case even with scripts that don't require elevated privileges (so-status), and prevents users from viewing the script's usage.An effort should be made to ensure scripts are run with the least privilege possible, and to allow non privileged users to view usage without having to pop a root shell.
Speaking for myself if presented with a large number of commands requiring root privileges I am likely to
sudo su -
and work from there, which is a very bad habit to get into.Beta Was this translation helpful? Give feedback.
All reactions