Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 426660 - /usr/sbin/nslcd is not labeled correctly and fails to start in enforcing
Summary: /usr/sbin/nslcd is not labeled correctly and fails to start in enforcing
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard: sec-policy r15
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-15 00:58 UTC by Matthew Thode ( prometheanfire )
Modified: 2012-10-04 18:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
audit log for starting the daemon (audit.log,3.24 KB, text/plain)
2012-07-15 01:00 UTC, Matthew Thode ( prometheanfire )
Details
modules and reload line (file_426660.txt,1.46 KB, text/plain)
2012-07-16 19:14 UTC, Matthew Thode ( prometheanfire )
Details
nslcd patch to allow connect to ldap (nslcd-ldap-name-connect.patch,514 bytes, text/plain)
2012-07-16 20:12 UTC, Matthew Thode ( prometheanfire )
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-07-15 00:58:21 UTC
It looks like we have nslcd in the contrib section.  I tried creating an ebuild for nslcd in my overlay but it's not working :(


dev strict # semodule -b base.pp -i $(ls *.pp | grep -v base.pp)
libsepol.permission_copy_callback: Module nagios depends on permission use in class db_table, not satisfied (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
semodule:  Failed!
dev strict # semodule -i nslcd.pp 
libsepol.permission_copy_callback: Module nslcd depends on permission epollwakeup in class capability2, not satisfied (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
semodule:  Failed!

I'd appreciate tips for dealing with these errors so I can help write some policies.
Comment 1 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-07-15 00:59:09 UTC
my ebuild is in
http://git.overlays.gentoo.org/gitweb/?p=dev/prometheanfire.git
Comment 2 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-07-15 01:00:59 UTC
Created attachment 318200 [details]
audit log for starting the daemon
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2012-07-16 18:08:19 UTC
First check if the policy you have loaded is of at least the same version as the one that you have built for nslcd. Your overlay suggests BASEPOL="2.20120215-r13" so your base policy should already be at rev13 (and also loaded).

The command to load the entire policy you gave failed on nagios:

"""
libsepol.permission_copy_callback: Module nagios depends on permission use in class db_table, not satisfied (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
semodule:  Failed!
"""

In this case, this sais that the nagios module has dependencies on other policy modules which eventually cause it to need the "use" privilege for db_table class. This sounds like postgresql stuff, although I can't find a direct reference to postgresql interfaces in the nagios module.

So two things to look at:

(1.) Does /sys/fs/selinux/class/db_table/perms list "use" as a privilege for the db_table class?
(2.) If you "grep -v nagios" in the semodule command, what is the next error you get?

If the "use" privilege is indeed needed, we might need to update the policy/flask/access_vectors file to support it too, but I don't even notice this on the refpolicy (development branch) so it would mean that it's a non-gentoo-related issue. I'm not sure about this then though.

Regardless, we should first focus on getting "semodule -b base.pp -i $(ls *.pp | grep -v base.pp | grep -v unconfined.pp)" working properly (with or without nslcd.pp).
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-07-16 19:13:54 UTC
can't reload modules still, just made sure everything was installed as it should be (as far as I can tell).
Comment 5 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-07-16 19:14:27 UTC
Created attachment 318360 [details]
modules and reload line
Comment 6 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-07-16 20:12:35 UTC
Created attachment 318368 [details]
nslcd patch to allow connect to ldap
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2012-07-17 08:47:36 UTC
Seems logical that nslcd can connect to LDAPs, since it is his main functionality. You might want to look at the commit history for nslcd.te to find out if there was some discussion on it before, since I would find it strange that this isn't part of the existing policy.
Comment 8 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-07-18 07:05:59 UTC
submitted patch upstream
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2012-07-20 17:33:24 UTC
It'll also be in rev15
Comment 10 Sven Vermeulen (RETIRED) gentoo-dev 2012-07-21 20:16:47 UTC
in hardened-dev overlay
Comment 11 Sven Vermeulen (RETIRED) gentoo-dev 2012-07-28 09:28:27 UTC
In main tree, ~arched
Comment 12 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-04 18:35:15 UTC
stabilized