Bug 648949 - Need dirsrv and dirsrv-admin policy modules merged into base policy
Summary: Need dirsrv and dirsrv-admin policy modules merged into base policy
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks: 653794 655206
TreeView+ depends on / blocked
 
Reported: 2010-11-02 15:23 UTC by Nathan Kinder
Modified: 2010-11-19 21:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 653794 655206 (view as bug list)
Environment:
Last Closed: 2010-11-16 07:45:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
dirsrv policy source (2.85 KB, application/x-gzip)
2010-11-02 15:28 UTC, Nathan Kinder
no flags Details
dirsrv-admin policy source (2.34 KB, application/x-gzip)
2010-11-02 15:29 UTC, Nathan Kinder
no flags Details
File context for admin policy (613 bytes, application/octet-stream)
2010-11-04 20:02 UTC, Daniel Walsh
no flags Details
File context for dirsrv.fc (985 bytes, application/octet-stream)
2010-11-04 20:03 UTC, Daniel Walsh
no flags Details

Description Nathan Kinder 2010-11-02 15:23:59 UTC
The two SELinux policy modules used for the 389 Directory Server are currently contained within the 389 packages.  We would like these policy modules to be merged into the base system policy instead of being carried separately.

We began including our policy modules in the following packages:

    389-ds-base-1.2.6
    389-admin-1.1.11

I will attach our policy module source code to this bug.  Please let me know what other info you need from me.

Comment 1 Nathan Kinder 2010-11-02 15:28:08 UTC
Created attachment 457199 [details]
dirsrv policy source

Comment 2 Nathan Kinder 2010-11-02 15:29:49 UTC
Created attachment 457200 [details]
dirsrv-admin policy source

Comment 3 Nathan Kinder 2010-11-02 15:37:06 UTC
One thing that we currently do during the 389 build process is to build the *.fc files from a template.  You will see in the attachments that our *.fc files have path macros that are substituted with real paths.  We will have to change this to use the actual hard-coded paths.  The macros should be replaced with the following paths for the dirsrv module:

@package_name@     dirsrv
@sbindir@          /usr/sbin
@localstatedir@    /var
@sysconfdir@       /etc
@datadir@          /usr/share

I will gather the data for replacing the other macros used in the dirsrv-admin module.

Comment 4 Nathan Kinder 2010-11-02 20:51:43 UTC
The dirsrv-admin *.fc macros should be replaced as follows:

@configdir@        /etc/dirsrv/admin-serv
@dsgwconfigdir@    
@logdir@           /var/log/dirsrv/admin-serv
@piddir@           /var/run/dirsrv
@instancename@     admin-serv
@cgibindir@        /usr/lib64/dirsrv/cgi-bin
@dsgwcgibindir@    /usr/lib64/dirsrv/dsgw-cgi-bin
@dsgwcookiedir@    /opt/dirsrv/var/run/dirsrv/dsgw/cookies

Note that the paths for both @cgibindir@ and @dsgwcgibindir@ are going to differ between i586 and x86_64 platforms since they reside in libdir.

Comment 5 Daniel Walsh 2010-11-03 13:52:19 UTC
Nathan if you want to allow alternative paths you can do this with semanage commands now.

For example

# semanage fcontext -a -e /var/log/dirsrv /var/log/mydirsrv

Would end up labeling everything under /var/log/mydirsrv the same as it would under /var/log/dirsrv.

We are going to have to coordinate an update.  I can ship an updated policy which contains your policy, then I will have to put a conflicts with your current dirsrv version, and you will have to ship an update which does not include the policy.


When you install a module to you use -u or -i?

Comment 6 Nathan Kinder 2010-11-03 17:23:17 UTC
(In reply to comment #5)
> Nathan if you want to allow alternative paths you can do this with semanage
> commands now.
> 
> For example
> 
> # semanage fcontext -a -e /var/log/dirsrv /var/log/mydirsrv
> 
> Would end up labeling everything under /var/log/mydirsrv the same as it would
> under /var/log/dirsrv.

Yes, this is what we are going to be documenting for paths that are configurable at runtime.

We hard-code some paths at buildtime that are built from options to configure.  These are always the same when we build official 389 builds on Fedora and RHEL, so we can just hard-code them in the *.fc files as I described above.  This will suit our needs just fine.
 
> We are going to have to coordinate an update.  I can ship an updated policy
> which contains your policy, then I will have to put a conflicts with your
> current dirsrv version, and you will have to ship an update which does not
> include the policy.

Ok.  Perhaps you can get a test package for us to work with first and then we can coordinate a release.  I will need to talk with Rich to determine the best timeline.

> When you install a module to you use -u or -i?

We curently use 'semodule -i' in our spec file to install the module.

Comment 7 Daniel Walsh 2010-11-04 18:42:08 UTC
What is the path for

@dsgwconfigdir@

Comment 8 Daniel Walsh 2010-11-04 18:49:58 UTC
What is this?

# Net-SNMP persistent data file
files_manage_var_files(dirsrv_snmp_t)

Comment 9 Nathan Kinder 2010-11-04 18:58:07 UTC
(In reply to comment #7)
> What is the path for
> 
> @dsgwconfigdir@

Sorry about missing that one.  The path for this is "/opt/dirsrv/etc/dirsrv/dsgw".

(In reply to comment #8)
> What is this?
> 
> # Net-SNMP persistent data file
> files_manage_var_files(dirsrv_snmp_t)

The Net-SNMP libraries used by our SNMP subagent (ldap-agent) create a persistent data file in /var/lib/net-snmp.  This access was required to allow that file to be managed.

Comment 10 Rich Megginson 2010-11-04 19:17:27 UTC
(In reply to comment #9)
> (In reply to comment #7)
> > What is the path for
> > 
> > @dsgwconfigdir@
> 
> Sorry about missing that one.  The path for this is
> "/opt/dirsrv/etc/dirsrv/dsgw".

I think it is just /etc/dirsrv/dsgw since we're using FHS.

Comment 11 Daniel Walsh 2010-11-04 20:02:45 UTC
Created attachment 457927 [details]
File context for admin policy

Comment 12 Daniel Walsh 2010-11-04 20:03:34 UTC
Created attachment 457929 [details]
File context for dirsrv.fc

Comment 13 Daniel Walsh 2010-11-04 20:04:23 UTC
What is the last version of dirsrv that will have policy in it?  I need to add an obsoletes for the package in selinux-policy.

Comment 14 Rich Megginson 2010-11-04 21:06:17 UTC
389-ds-base-1.2.6.1
and
389-admin-1.1.11
are the latest Stable packages.  We can remove the policy from 389-ds-base-1.2.7 and 389-admin-1.1.12

Comment 15 Daniel Walsh 2010-11-05 18:47:59 UTC
Latest rawhide has a fixed up policy for dirsrv and dirsrv-admin, please try it out.  I removed some stuff, please add avc messages to this bugzilla.

In Rawhide you want to 

conflicts: selinux-policy-base < 3.9.8

Comment 16 Daniel Walsh 2010-11-05 18:59:26 UTC
selinux-policy-3.9.8 has

Conflicts:  389-ds-base < 1.2.7, 389-admin < 1.1.12

Comment 17 Nathan Kinder 2010-11-12 17:35:38 UTC
Testing with this new selinux-policy package looks good so far.

Is there a chance that we can get the changes ported to F13 and F14 and released in updates-testing?  We don't want the changes in stable there yet as we need to build and test our packages first so we can coordinate releasing everything.

Comment 18 Daniel Walsh 2010-11-12 18:38:16 UTC
Miroslav can you take the dirsrv* files out of Rawhide and put them in F13 and F14

Nathan, I don't want to hold up F13 and F14 policy for a long period of time, so when Miroslav puts them in update testing, you will need to have packages ready to go also.

If he adds 

Conflicts:  389-ds-base < 1.2.7, 389-admin < 1.1.12

Policy will not be allowed to update on machines with 389 installed, and 389 will not be allowed to be installed with the new version of selinux-policy.

Comment 19 Nathan Kinder 2010-11-12 18:56:17 UTC
(In reply to comment #18)
> Nathan, I don't want to hold up F13 and F14 policy for a long period of time,
> so when Miroslav puts them in update testing, you will need to have packages
> ready to go also.
> 
> If he adds 
> 
> Conflicts:  389-ds-base < 1.2.7, 389-admin < 1.1.12
> 
> Policy will not be allowed to update on machines with 389 installed, and 389
> will not be allowed to be installed with the new version of selinux-policy.

Yes, this is what we want to avoid/minimize.  We are working on building packages now, but we would like to test 389 upgrade scenarios before pushing to stable.

Comment 20 Nathan Kinder 2010-11-12 22:51:01 UTC
I will need to know the versions of selinux-policy-base that we need to conflict with for F-13 and F-14 to proceed with building our updated 389 packages.  I would like a few days to play with some test selinux-policy packages to make sure everything seems ok on those platforms before pushing to stable.

Comment 21 Miroslav Grepl 2010-11-15 13:26:59 UTC
I am adding it to 

selinux-policy-3.7.19-72.fc13
selinux-policy-3.9.7-13.fc14

which I will build later today. So you can test it and I can wait till tomorrow with pushing to testing repo.


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