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 825137 - radiusd unable to connect to ldap
Summary: radiusd unable to connect to ldap
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-25 08:31 UTC by Patrik Kis
Modified: 2015-11-02 13:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:20:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Patrik Kis 2012-05-25 08:31:56 UTC
Description of problem:

I'm not sure if this is a real bug but better report it.
In out test case radiusd is trying to connect to TCP socket of slapd (ldap server). It succeed on RHEL6 but on not on RHEL7.

The ldap server is running unser ldap user and radiusd under radiusd (this is the same on boot RHEL7 and RHEL6)
[root@rhel70]# ps -eflZ | grep radius | grep -v grep
system_u:system_r:radiusd_t:s0  5 S radiusd   6177     1  0  80   0 - 123909 poll_s 09:29 ?       00:00:00 /usr/sbin/radiusd -d /etc/raddb
[root@rhel70]# ps -eflZ | grep slapd | grep -v grep
system_u:system_r:slapd_t:s0    1 S ldap      5990     1  0  80   0 - 74123 futex_ 09:23 ?        00:00:00 /usr/sbin/slapd -u ldap -h ldapi:/// ldap:/// ldaps:///

When the radiusd attempts to coonect to ldap socket the following avcs appears:
type=AVC msg=audit(1337933665.084:13545): avc:  denied  { name_connect } for  pid=6181 comm="radiusd" dest=389 scontext=system_u:system_r:radiusd_t:s0 tcontext=system_u:object_r:ldap_port_t:s0 tclass=tcp_socket
type=SYSCALL msg=audit(1337933665.084:13545): arch=c000003e syscall=42 success=no exit=-13 a0=d a1=7fdd940010a0 a2=10 a3=7fddac5e0580 items=0 ppid=1 pid=6181 auid=4294967295 uid=95 gid=95 euid=95 suid=95 fsuid=95 egid=95 sgid=95 fsgid=95 tty=(none) ses=4294967295 comm="radiusd" exe="/usr/sbin/radiusd" subj=system_u:system_r:radiusd_t:s0 key=(null)

[root@rhel70 ~]# ausearch -m AVC -ts recent | audit2allow 
WARNING: Policy would be downgraded from version 27 to 26.

#============= radiusd_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     authlogin_nsswitch_use_ldap, allow_ypbind

allow radiusd_t ldap_port_t:tcp_socket name_connect;

[root@rhel70]# semanage boolean -l | grep allow_ypbind
allow_ypbind                   (off  ,  off)  allow_ypbind
[root@rhel70]# semanage boolean -l | grep authlogin_nsswitch_use_ldap
authlogin_nsswitch_use_ldap    (off  ,  off)  authlogin_nsswitch_use_ldap

Enabling any of these booleans allows the socket access so the test pass, but the question if how it is possible that the same test works on RHEL6, where:
[root@rhel62]# getsebool allow_ypbind
allow_ypbind --> off
[root@rhel62]# getsebool authlogin_nsswitch_use_ldap
Error getting active value for authlogin_nsswitch_use_ldap

What has changed?

Version-Release number of selected component (if applicable):
# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.0 Alpha1 (Maipo)
# rpm -qa | grep selinux
libselinux-utils-2.1.10-4.el7.x86_64
selinux-policy-targeted-3.10.0-123.el7.noarch
libselinux-2.1.10-4.el7.x86_64
libselinux-python-2.1.10-4.el7.x86_64
selinux-policy-devel-3.10.0-123.el7.noarch
selinux-policy-3.10.0-123.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. Run the test case /CoreOS/freeradius/Sanity/freeradius-openldap-auth-test and remove the workaround with "allow_ypbind" selinux boolean

Actual results:
radiusd can not connect to ldap socket

Expected results:
radiusd can connect to ldap socket

Additional info:

Comment 1 Karel Srot 2012-05-28 06:07:16 UTC
On RHEL6 we have

$ sesearch -A -C -s radiusd_t -t ldap_port_t -c tcp_socket
Found 5 semantic av rules:
   allow radiusd_t ldap_port_t : tcp_socket { recv_msg send_msg name_connect } ; 
   allow radiusd_t port_type : tcp_socket { recv_msg send_msg } ; 
DT allow radiusd_t reserved_port_type : tcp_socket name_connect ; [ allow_ypbind ]
DT allow radiusd_t rpc_port_type : tcp_socket name_bind ; [ allow_ypbind ]
DT allow radiusd_t port_type : tcp_socket { recv_msg send_msg } ; [ allow_ypbind ]

radius should be able to connect to ldap without ypbind boolean enabled. We should add it into policy.

Comment 2 Daniel Walsh 2012-05-29 17:45:35 UTC
On RHEl6 we allowed all apps that used getpw to connect to ldap.

On RHEL7 we will rely on sssd for this.  If radius needs to connect to ldap for something other then password resolution then we should turn it on in radious policy.

Comment 3 Daniel Walsh 2012-05-29 17:52:10 UTC
Fixed in selinux-policy-3.10.0-128.el7

Comment 5 Ludek Smid 2014-06-13 10:20:43 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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