FS#65190 - [munin] running munin-node as munin/munin makes it impossible to run plugins which need root rights
Attached to Project:
Community Packages
Opened by Andreas Baumann (andreas_baumann) - Saturday, 18 January 2020, 09:44 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:01 GMT
Opened by Andreas Baumann (andreas_baumann) - Saturday, 18 January 2020, 09:44 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:01 GMT
|
Details
Description:
I have a configuration for munin-node /etc/munin/munin-node.conf with: user munin group munin (this is the standard) When testing the SMART plugin (one which needs root privileges to work properly), I get: su -s /bin/bash munin munin-run smart_sdd # Warning: Root privileges are required to change user/group. The plugin may not behave as expected. Setting other privileges in /etc/munin/plugin-conf.d/munin-node as follows: [smart_*] user root group disk doesn't help. Unless munin-node runs as root it can not change UID/GUID to whatever you configure. What am I missing here? Additional info: * package version(s): 2.0.52-1 |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:01 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/munin/issues/3
Saturday, 25 November 2023, 20:01 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/munin/issues/3
There is a nicer and more secure solution:
/etc/sudoers.d/munin-node:
munin ALL=NOPASSWD:/usr/sbin/smartctl -a -n standby -A -i /dev/sd?
(this needs fine tuning)
In /usr/lib/munin/plugins/smart_
command_tokens = ['sudo'] + [smartctl_bin] + smartctl_args.split()
I should also mention that most plugins don't need root privileges and one could argue
that some plugins should be rewritten to use either use no root privileges at all or
at least provide means to call it via 'sudo' to limit the potential risk.
POSTCONFSPOOL="$(postconf -h queue_directory 2>/dev/null || echo /var/spool/postfix)"
then
deferred.value $( { test -d deferred && find deferred -type f; } | wc -l)
active.value $( { test -d active && find active -type f; } | wc -l)
This can only work, if munin-node would start plugins with 'sudo'.
I start to think that munin-node was meant to run as 'root' in order to
be able to use the right privileges in /etc/munin/plugin-conf.d/munin-node.