Bug 1154164
| Summary: | New SELinux policy for bacula doesn't allow writing backup files to NFS/CIFS share | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Robert Scheck <redhat-bugzilla> | ||||||
| Component: | selinux-policy | Assignee: | Simon Sekidde <ssekidde> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 6.6 | CC: | dwalsh, halgol60, lvrabec, mgrepl, michal.bruncko, mmalik, robert.scheck, ssekidde | ||||||
| Target Milestone: | rc | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | selinux-policy-3.7.19-263.el6 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2015-07-22 07:09:03 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Robert Scheck
2014-10-17 17:25:58 UTC
Cross-filed cases #01265653 (ourself), #01265658 (customer1), #01265660 (customer2) on the Red Hat customer portal. Lukas, could you please attach a local policy module with fixes for bacula? We need to allow to access NFS. For now it could be allowed using # semanage permissive -a bacula_t This affects CIFS as well (cifs_t). Maybe something like bacula_anon_write as boolean (or similar) is needed? Single AVC denied example for CIFS from one of our productive systems:
type=AVC msg=audit(1413583503.159:3454): avc: denied { write } for pid=10297 comm="bacula-sd" name="Incremental-0031" dev=cifs ino=9904194586646 scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:cifs_t:s0 tclass=file
type=SYSCALL msg=audit(1413583503.159:3454): arch=x86_64 syscall=open success=yes exit=ENXIO a0=7fad7c014900 a1=2 a2=1a0 a3=8 items=0 ppid=1 pid=10297 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=bacula-sd exe=/usr/sbin/bacula-sd subj=system_u:system_r:bacula_t:s0 key=(null)
AVC denied example from tonight for NFS from one of our productive systems:
type=AVC msg=audit(1413861044.129:28994): avc: denied { write } for pid=24887 comm="bacula-sd" name="bacula" dev=0:1b ino=44840656 scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:nfs_t:s0 tclass=dir
type=AVC msg=audit(1413861044.129:28994): avc: denied { add_name } for pid=24887 comm="bacula-sd" name="Bacula-Full-0128" scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:nfs_t:s0 tclass=dir
type=AVC msg=audit(1413861044.129:28994): avc: denied { create } for pid=24887 comm="bacula-sd" name="Bacula-Full-0128" scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:nfs_t:s0 tclass=file
type=SYSCALL msg=audit(1413861044.129:28994): arch=x86_64 syscall=open success=yes exit=ENXIO a0=7f108c0252e0 a1=42 a2=1a0 a3=10 items=0 ppid=1 pid=24887 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=bacula-sd exe=2F7573722F7362696E2F626163756C612D7364202864656C6574656429 subj=system_u:system_r:bacula_t:s0 key=(null)
Created attachment 973354 [details]
custom policy module
Robert,
The objective is to address this with Bacula Booleans for NFS and CIFS. Can you install the attached local policy module and let us know if this fixes both use cases?
MD5 Checksum 9ca8c3c64d8226e143b1751016ea2c5c
Simon, the mybacula.pp does not introduce any new booleans? Or is the policy module meant to contain the changes that a boolean should bring? Testing the policy is hard to impossible for me, because all our regular (productive!) setups still fail due to unresolved bug #1154158 right now: type=AVC msg=audit(1420715823.303:272904): avc: denied { write } for pid=19335 comm="bacula-dir" name="tmp" dev=sda1 ino=19660874 scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir type=SYSCALL msg=audit(1420715823.303:272904): arch=c000003e syscall=21 success=no exit=-13 a0=30772761fc a1=7 a2=7eff76904a40 a3=8 items=0 ppid=1 pid=19335 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="bacula-dir" exe="/usr/sbin/bacula-dir.sqlite" subj=system_u:system_r:bacula_t:s0 key=(null) type=AVC msg=audit(1420715823.303:272905): avc: denied { write } for pid=19335 comm="bacula-dir" name="tmp" dev=sda1 ino=19660874 scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir type=SYSCALL msg=audit(1420715823.303:272905): arch=c000003e syscall=21 success=no exit=-13 a0=3077276205 a1=7 a2=7eff76904a40 a3=8 items=0 ppid=1 pid=19335 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="bacula-dir" exe="/usr/sbin/bacula-dir.sqlite" subj=system_u:system_r:bacula_t:s0 key=(null) type=AVC msg=audit(1420715823.303:272906): avc: denied { write } for pid=19335 comm="bacula-dir" name="tmp" dev=sda1 ino=25952257 scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir type=SYSCALL msg=audit(1420715823.303:272906): arch=c000003e syscall=21 success=no exit=-13 a0=3077276200 a1=7 a2=7eff76904a40 a3=8 items=0 ppid=1 pid=19335 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="bacula-dir" exe="/usr/sbin/bacula-dir.sqlite" subj=system_u:system_r:bacula_t:s0 key=(null) type=AVC msg=audit(1420715823.315:272907): avc: denied { write } for pid=19335 comm="bacula-dir" name="tmp" dev=sda1 ino=19660874 scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir type=SYSCALL msg=audit(1420715823.315:272907): arch=c000003e syscall=21 success=no exit=-13 a0=30772761fc a1=7 a2=7eff76904ad0 a3=7eff76904fb0 items=0 ppid=1 pid=19335 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="bacula-dir" exe="/usr/sbin/bacula-dir.sqlite" subj=system_u:system_r:bacula_t:s0 key=(null) type=AVC msg=audit(1420715823.315:272908): avc: denied { write } for pid=19335 comm="bacula-dir" name="tmp" dev=sda1 ino=19660874 scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir type=SYSCALL msg=audit(1420715823.315:272908): arch=c000003e syscall=21 success=no exit=-13 a0=3077276205 a1=7 a2=7eff76904ad0 a3=7eff76904fb0 items=0 ppid=1 pid=19335 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="bacula-dir" exe="/usr/sbin/bacula-dir.sqlite" subj=system_u:system_r:bacula_t:s0 key=(null) type=AVC msg=audit(1420715823.315:272909): avc: denied { write } for pid=19335 comm="bacula-dir" name="tmp" dev=sda1 ino=25952257 scontext=system_u:system_r:bacula_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir type=SYSCALL msg=audit(1420715823.315:272909): arch=c000003e syscall=21 success=no exit=-13 a0=3077276200 a1=7 a2=7eff76904ad0 a3=7eff76904fb0 items=0 ppid=1 pid=19335 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="bacula-dir" exe="/usr/sbin/bacula-dir.sqlite" subj=system_u:system_r:bacula_t:s0 key=(null) type=AVC msg=audit(1420715865.966:272912): avc: denied { execute } for pid=19590 comm="bacula-dir" name="bacula-mount.sh" dev=sda1 ino=3145799 scontext=unconfined_u:system_r:bacula_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file type=SYSCALL msg=audit(1420715865.966:272912): arch=c000003e syscall=59 success=no exit=-13 a0=7fb31c0011f0 a1=7fb327237660 a2=7fff6a798ba8 a3=3075418240 items=0 ppid=19515 pid=19590 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=44261 comm="bacula-dir" exe="/usr/sbin/bacula-dir.sqlite" subj=unconfined_u:system_r:bacula_t:s0 key=(null) (In reply to Robert Scheck from comment #13) > Simon, the mybacula.pp does not introduce any new booleans? Or is the policy > module meant to contain the changes that a boolean should bring? Includes changes that will be part of the boolean Created attachment 984867 [details] Updated bacula policy package > Testing the policy is hard to impossible for me, because all our regular > (productive!) setups still fail due to unresolved bug #1154158 right now: > > type=AVC msg=audit(1420715865.966:272912): avc: denied { execute } for > pid=19590 comm="bacula-dir" name="bacula-mount.sh" dev=sda1 ino=3145799 > scontext=unconfined_u:system_r:bacula_t:s0 > tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file > type=SYSCALL msg=audit(1420715865.966:272912): arch=c000003e syscall=59 > success=no exit=-13 a0=7fb31c0011f0 a1=7fb327237660 a2=7fff6a798ba8 > a3=3075418240 items=0 ppid=19515 pid=19590 auid=0 uid=0 gid=0 euid=0 suid=0 > fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=44261 comm="bacula-dir" > exe="/usr/sbin/bacula-dir.sqlite" subj=unconfined_u:system_r:bacula_t:s0 > key=(null) Understood. I have attached a new policy file. MD5 Checksum d606f73c68f84dbf074dc7bf71eaac12 If you label the bacula-mount.sh file as bacula_unconfined_script_exec_t and test with the new policy file can you share the AVCs? Sorry, I overlooked this comment. I tested the new policy file on a system with CIFS a few minutes ago and it seems to work (no AVC so far). Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1375.html |