Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#65190 - [munin] running munin-node as munin/munin makes it impossible to run plugins which need root rights

Attached to Project: Arch Linux
Opened by Andreas Baumann (andreas_baumann) - Saturday, 18 January 2020, 09:44 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 26 February 2020, 18:31 GMT
Task Type Bug Report
Category Packages: Extra
Status Unassigned
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

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

Comment by Andreas Baumann (andreas_baumann) - Saturday, 18 January 2020, 10:01 GMT
Actually, I was not suggesting to run munin-node to run as root. :-)

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.
Comment by Andreas Baumann (andreas_baumann) - Sunday, 19 January 2020, 09:39 GMT
The postfix_mailqueue plugin is a different case:

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.

Loading...