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
Task Type Bug Report
Category Packages
Status Closed
Assigned To Santiago Torres (sangy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
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

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
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.

Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...