RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1651248 - pam_systemd timeout when nrpe runs sudo
Summary: pam_systemd timeout when nrpe runs sudo
Keywords:
Status: CLOSED DUPLICATE of bug 1653309
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.6
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-19 14:16 UTC by Rik Theys
Modified: 2019-01-11 14:38 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-16 21:09:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3716371 0 None None None 2018-12-07 07:52:20 UTC

Description Rik Theys 2018-11-19 14:16:12 UTC
Description of problem:

NRPE runs commands using sudo to monitor our server health. After upgrading to 7.6, the following error is logged and the nrpe commands time out:

Nov 19 14:39:34 tamar sudo: pam_systemd(sudo:session): Failed to create session: Connection timed out

This seems to be caused by a missing selinux permission.


Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.13.1-229.el7.noarch
selinux-policy-3.13.1-229.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. Configure nrpe to run a command under sudo, and trigger the check
2.
3.

Actual results:
nrpe check times out and the following message is logged:

Nov 19 14:49:44 tamar.esat.kuleuven.be sudo[323848]:     nrpe : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/ipmitool sdr type Power Supply
Nov 19 14:50:09 tamar.esat.kuleuven.be sudo[323848]: pam_systemd(sudo:session): Failed to create session: Connection timed out
Nov 19 14:50:09 tamar.esat.kuleuven.be sudo[323848]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 19 14:50:10 tamar.esat.kuleuven.be sudo[323848]: pam_unix(sudo:session): session closed for user root


Expected results:
No error and no timeout.

Additional info:

I was able to fix this issue by create an selinux policy module with the following settings:

module dbus2nrpe 1.0;

require {
        type systemd_logind_t;
        type nagios_unconfined_plugin_t;
        class dbus send_msg;
}

#============= systemd_logind_t ==============
allow systemd_logind_t nagios_unconfined_plugin_t:dbus send_msg;

Comment 3 Lukas Vrabec 2018-12-16 21:09:49 UTC

*** This bug has been marked as a duplicate of bug 1653309 ***


Note You need to log in before you can comment on or make changes to this bug.