[CentOS] SELinux C7 audit

Tue Jul 5 15:21:12 UTC 2016
Alessandro Baggi <alessandro.baggi at gmail.com>

Hi list,
I'm studying SELinux on my workstation and for this I've enforced.
In a first time selinux was permissive and when switched to enforcing I 
had relabel some things.
Due to my "nescience" about selinux and what I must configure, I'm 
waiting avc denied for specified services.

Until today, I've configured successfully httpd, smbd.
Today I've noticed that my bacula system does not work due to selinux 
denied because when bacula try to run pre/post job script I get access 
denied due to differences about context.

Bacula is on bacula_t and in pre script I call commands in other context 

... (and other)

Reading from RHEL DOC (SELinux Guide) I can accomplish to remove denied 
access using audit2allow and creating TE rules.

I've runned:

grep systemctl /var/log/audit/audit.log | audit2allow -M pol

and I got 2 files pol.pp (compiled) and pol.te.

pol.te reports:

require {
         type systemd_systemctl_exec_t;
         type bacula_t;
         class file execute;

#============= bacula_t ==============
allow bacula_t systemd_systemctl_exec_t:file execute;

Loading this policy things "will work".

Now this problem is solved by audit2allow and not by me. I don't know 
what is necessary to make pre/post job script to get work done.

What are the meaning of rules on pol.te and why bacula can't do 
transiction between context?

Hope in help.

Thanks in advance.