Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 396241 - Request SELinux policy module for app-backup/bacula
Summary: Request SELinux policy module for app-backup/bacula
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-27 22:32 UTC by Stan Sander
Modified: 2012-02-26 10:10 UTC (History)
1 user (show)

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


Attachments
Patch for sysadm role to allow execution of user interface (sysadm.te.patch,318 bytes, patch)
2011-12-27 22:34 UTC, Stan Sander
Details | Diff
File context for new policy (bacula.fc,715 bytes, text/plain)
2011-12-27 22:34 UTC, Stan Sander
Details
interface file for new policy (bacula.if,961 bytes, text/plain)
2011-12-27 22:35 UTC, Stan Sander
Details
Type enforcement file for new policy (bacula.te,3.05 KB, text/plain)
2011-12-27 22:35 UTC, Stan Sander
Details
Type Enforcement (bacula.te) (bacula.te,2.96 KB, text/plain)
2011-12-28 18:53 UTC, Sven Vermeulen (RETIRED)
Details
Interfaces (bacula.if) (bacula.if,961 bytes, text/plain)
2011-12-28 18:53 UTC, Sven Vermeulen (RETIRED)
Details
File Contexts (bacula.fc) (bacula.fc,594 bytes, text/plain)
2011-12-28 18:53 UTC, Sven Vermeulen (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stan Sander 2011-12-27 22:32:04 UTC
Currently there is no SELinux policy module for the app-backup/bacula package.  The attached files and patch are my proposal for providing this policy.
Comment 1 Stan Sander 2011-12-27 22:34:08 UTC
Created attachment 297125 [details, diff]
Patch for sysadm role to allow execution of user interface
Comment 2 Stan Sander 2011-12-27 22:34:33 UTC
Created attachment 297127 [details]
File context for new policy
Comment 3 Stan Sander 2011-12-27 22:35:08 UTC
Created attachment 297129 [details]
interface file for new policy
Comment 4 Stan Sander 2011-12-27 22:35:42 UTC
Created attachment 297131 [details]
Type enforcement file for new policy
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-28 11:22:31 UTC
Looking good. Okay if I sent these upstream so that the guys from the reference policy can take a look? I'm not fully confident that the admin interface is correct (with which I mean that the name and its content match the refpolicy ideas), but I need to look into that a bit deeper first (I'm not sufficiently confident with my interface naming skills ;)
Comment 6 Stan Sander 2011-12-28 15:43:59 UTC
Yes, send them up.  I'm not confident that I got everything right either, but if it's not hopefully a tweak or two can straighten it out.  Good to hear the first set of eyes that looked at it didn't find anything glaringly stupid.  ;) All I can say at this point is "it works for me".  I did try to copy things I saw in the base refpolicy interfaces, but that doesn't mean that styles and guidelines haven't changed and what I was looking at hadn't been updated.
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-28 18:42:06 UTC
Okay, had a further look at it and suggest the following changes (will also be those that I sent up if okay):

- bacula_pidfile_t is better named bacula_var_run_t as that matches the naming convention more properly
- bacula_conf_t seems not needed, as it is only used for reading, and you already grant etc read access to the application. Having a specific configuration file is usually when it contains private information or when the application needs write access (or you need to define an interface for write access). For now, having it stay an etc_t should suffice, not?
- I'll be marking bacula_admin_t as an application_domain()
- I'll separate bacula_t and bacula_admin_t rules in the .te file 

Before pushing up, I'll attach them here for your convenience
Comment 8 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-28 18:53:10 UTC
Created attachment 297233 [details]
Type Enforcement (bacula.te)
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-28 18:53:33 UTC
Created attachment 297235 [details]
Interfaces (bacula.if)
Comment 10 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-28 18:53:53 UTC
Created attachment 297237 [details]
File Contexts (bacula.fc)
Comment 11 Stan Sander 2011-12-28 19:17:25 UTC
Agreed, it should suffice to have the bacula_conf_t remain as an etc_t.  I was just trying to be thourough and didn't really understand the criteria for seperating out a conf type.  Although I noticed that you still left the bacula_conf_t in the file context -- might want to go ahead and clean that up.
Comment 12 Stan Sander 2011-12-28 19:32:07 UTC
On further looking, the bacula-dir.conf file DOES contain private info.  It holds the password for the bacula user in the mysql database.  That would warrant keeping it locked down, correct?
Comment 13 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-28 19:57:19 UTC
In that case, yes - best is to have a bacula_etc_t type then.
Comment 14 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-30 20:10:54 UTC
selinux-bacula-2.20110726 is now in hardened-dev overlay

It should include the bacula_etc_t information as well.

Can you please stop (all) bacula processes, unload your personal module, install selinux-bacula, relabel your system (rlpkg -a -r) and try starting it again? Since the module uses naming schemes you had in your module too it is possbile that you have collisions. In that case you'll need to "undo" your changes before installing.
Comment 15 Stan Sander 2011-12-31 02:15:09 UTC
Yes, I'll be glad to do that.  However, just FYI, it will probably be Monday or Tuesday before it happens.
Comment 16 Stan Sander 2012-01-02 16:39:30 UTC
At first look everything seems to be OK.  I'll let the jobs run overnight and do a little more testing tomorrow.
Comment 17 Stan Sander 2012-01-03 17:30:47 UTC
Everything seems to be working fine here.
Comment 18 Sven Vermeulen (RETIRED) gentoo-dev 2012-01-14 20:11:28 UTC
Pushed to main tree, ~arch
Comment 19 Sven Vermeulen (RETIRED) gentoo-dev 2012-02-26 10:10:39 UTC
Marked as stable in tree