Bug 1342733 - SELinux is preventing asterisk from 'write' accesses on the directory asterisk.
Summary: SELinux is preventing asterisk from 'write' accesses on the directory asterisk.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 24
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:524192d1e8e0665738c555d6a26...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-04 09:43 UTC by Lior Mizrahi
Modified: 2016-06-20 09:07 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-20 09:07:29 UTC
Type: ---


Attachments (Terms of Use)

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.


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