Bug 1342733

Summary: SELinux is preventing asterisk from 'write' accesses on the directory asterisk.
Product: [Fedora] Fedora Reporter: Lior Mizrahi <lior>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 24CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:524192d1e8e0665738c555d6a2619f2e8732485a235e1c95f4161d04e0d228ce;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-20 09:07:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lior Mizrahi 2016-06-04 09:43:18 UTC
Description of problem:
SELinux is preventing asterisk from 'write' accesses on the directory asterisk.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow asterisk to have write access on the asterisk directory
Then you need to change the label on asterisk
Do
# semanage fcontext -a -t FILE_TYPE 'asterisk'
where FILE_TYPE is one of the following: asterisk_log_t, asterisk_spool_t, asterisk_tmp_t, asterisk_tmpfs_t, asterisk_var_lib_t, asterisk_var_run_t, tmp_t, tmpfs_t, var_log_t, var_run_t, var_spool_t.
Then execute:
restorecon -v 'asterisk'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that asterisk should be allowed write access on the asterisk directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c asterisk --raw | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:asterisk_t:s0
Target Context                unconfined_u:object_r:var_lib_t:s0
Target Objects                asterisk [ dir ]
Source                        asterisk
Source Path                   asterisk
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-182.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.5.6-300.fc24.x86_64 #1 SMP Wed
                              Jun 1 21:29:58 UTC 2016 x86_64 x86_64
Alert Count                   27
First Seen                    2016-06-04 12:38:41 IDT
Last Seen                     2016-06-04 12:39:39 IDT
Local ID                      9f89dfcc-68a2-4ed7-827a-839698070f2b

Raw Audit Messages
type=AVC msg=audit(1465033179.346:423): avc:  denied  { write } for  pid=18326 comm="asterisk" name="asterisk" dev="dm-0" ino=3151178 scontext=system_u:system_r:asterisk_t:s0 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=dir permissive=0


Hash: asterisk,asterisk_t,var_lib_t,dir,write

Version-Release number of selected component:
selinux-policy-3.13.1-182.fc24.noarch

Additional info:
reporter:       libreport-2.7.0
hashmarkername: setroubleshoot
kernel:         4.5.6-300.fc24.x86_64
reproducible:   Not sure how to reproduce the problem
type:           libreport

Comment 1 Lukas Vrabec 2016-06-20 09:07:29 UTC
Hi, 
Please run: 
# restorecon -Rv /var/lib/asterisk

To fix your issue. Thank you.