-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CIS hardening may affect nagios_plugin3.py permissions #91
Comments
(by afreiberger) juju run -a 'chmod 644 /usr/local/lib/nagios/plugins/nagios_plugin3.py' |
(by vultaire) sudo -u nagios -- /usr/lib/nagios/plugins/check_etcd-alarms.pyTraceback (most recent call last): I would extend Drew's tweak as follows, to address the extra path, as well as the path from which the charm seems to do an rsync: juju run -a 'chmod 644 -v /usr/local/lib/nagios/plugins/nagios_plugin3.py /usr/lib/nagios/plugins/nagios_plugin3.py files/plugins/nagios_plugin3.py' |
(by marcusboden) The same was true for the files in /var/lib/juju/agents/unit-nrpe*/charm/files. I ran on the units |
(by aieri) |
During an NRPE charm upgrade to charmhub version 75 on a bionic endpoint, we experienced 'NRPE: Unable to read output' errors in Nagios.
Trying to run the failing check resulted in the following dump:
Traceback (most recent call last):
File "/usr/local/lib/nagios/plugins/check_lacp_bond.py", line 14, in
from nagios_plugin3 import CriticalError, WarnError, try_check
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 674, in exec_module
File "", line 780, in get_code
File "", line 832, in get_data
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/nagios/plugins/nagios_plugin3.py'
When looking at /usr/local/lib/nagios/plugins/nagios_plugin3.py, we found the owner was root:root and permissions were 640, meaning user nagios could not read the module for import.
When I checked the code in the main branch, it appears that the permissions of the source file are correctly set as 664, and the code uses shutil.copy2() to attempt to preserve permissions.
There may be an issue with CIS hardening that denies this attribute preservation, so the charm should hard-code the expected resulting file permissions within the nrpe_utils.py code that writes the file.
Imported from Launchpad using lp2gh.
date created: 2022-03-10T20:51:23Z
owner: afreiberger
assignee: None
the launchpad url
The text was updated successfully, but these errors were encountered: