Bug 676715

Summary: SELinux is preventing /usr/sbin/openvpn from 'search' accesses on the directory homes.
Product: [Fedora] Fedora Reporter: filemon
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dwalsh, filemon, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:e28182a82bf51c8c2ec6a5663b1657edbe71f6b04ef164c177f878bcdf84b83a
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-11 17:09:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description filemon 2011-02-10 22:04:57 UTC
SELinux is preventing /usr/sbin/openvpn from 'search' accesses on the directory homes.

*****  Plugin file (36.8 confidence) suggests  *******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin file (36.8 confidence) suggests  *******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin catchall_labels (23.2 confidence) suggests  ********************

If you want to allow openvpn to have search access on the homes directory
Then you need to change the label on homes
Do
# semanage fcontext -a -t FILE_TYPE 'homes'
where FILE_TYPE is one of the following: cert_type, home_cert_t, home_root_t, dirsrv_var_run_t, sysctl_crypto_t, openct_var_run_t, setrans_var_run_t, nscd_var_run_t, nslcd_var_run_t, pcscd_var_run_t, slapd_var_run_t, sssd_var_lib_t, httpd_sys_content_t, sysctl_t, openvpn_tmp_t, abrt_t, bin_t, lib_t, mnt_t, root_t, tmp_t, usr_t, var_t, system_dbusd_var_lib_t, system_dbusd_var_run_t, var_t, sysctl_t, device_t, bin_t, cert_t, etc_t, tmp_t, proc_t, usr_t, var_t, openvpn_var_run_t, user_home_dir_t, logfile, winbind_var_run_t, textrel_shlib_t, sssd_public_t, device_t, devpts_t, locale_t, etc_t, rpm_script_tmp_t, proc_t, likewise_var_lib_t, sysfs_t, security_t, default_t, krb5_conf_t, sysctl_net_t, rpm_tmp_t, auth_cache_t, var_run_t, var_lib_t, openvpn_t, var_lib_t, var_run_t, rpm_log_t, dbusd_etc_t, user_home_type, var_log_t, proc_net_t, var_log_t, samba_var_t, abrt_var_run_t, avahi_var_run_t, net_conf_t, openvpn_etc_t, sysctl_kernel_t, home_root_t, nscd_var_run_t, pcscd_var_run_t, cgroup_t, root_t, selinux_config_t, tmp_t, var_t, var_t, user_home_dir_t, default_context_t, sysfs_t, tmpfs_t, etc_t, security_t, var_run_t, var_run_t, file_context_t. 
Then execute: 
restorecon -v 'homes'


*****  Plugin catchall (5.04 confidence) suggests  ***************************

If you believe that openvpn should be allowed search access on the homes 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:
# grep openvpn /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:openvpn_t:s0
Target Context                system_u:object_r:file_t:s0
Target Objects                homes [ dir ]
Source                        openvpn
Source Path                   /usr/sbin/openvpn
Port                          <Ismeretlen>
Host                          (removed)
Source RPM Packages           openvpn-2.1.1-2.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-29.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux leni 2.6.35.10-74.fc14.x86_64 #1 SMP Thu Dec
                              23 16:04:50 UTC 2010 x86_64 x86_64
Alert Count                   1
First Seen                    2011. febr. 10., csütörtök, 23.02.17 CET
Last Seen                     2011. febr. 10., csütörtök, 23.02.17 CET
Local ID                      d76d12b6-bf6c-45e8-9cd2-4b4d596c2a9c

Raw Audit Messages
type=AVC msg=audit(1297375337.61:356): avc:  denied  { search } for  pid=18188 comm="openvpn" name="homes" dev=sda8 ino=8912897 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir


type=AVC msg=audit(1297375337.61:356): avc:  denied  { read } for  pid=18188 comm="openvpn" name="ment" dev=sda8 ino=8922519 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=lnk_file


type=AVC msg=audit(1297375337.61:356): avc:  denied  { read } for  pid=18188 comm="openvpn" name="imre.crt" dev=sda8 ino=8130041 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file


type=AVC msg=audit(1297375337.61:356): avc:  denied  { open } for  pid=18188 comm="openvpn" name="imre.crt" dev=sda8 ino=8130041 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file


type=SYSCALL msg=audit(1297375337.61:356): arch=x86_64 syscall=open success=yes exit=EIO a0=7fff828a1e7e a1=0 a2=1b6 a3=0 items=0 ppid=18186 pid=18188 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=openvpn exe=/usr/sbin/openvpn subj=system_u:system_r:openvpn_t:s0 key=(null)

Hash: openvpn,openvpn_t,file_t,dir,search

audit2allow

#============= openvpn_t ==============
allow openvpn_t file_t:dir search;
allow openvpn_t file_t:file { read open };
allow openvpn_t file_t:lnk_file read;

audit2allow -R

#============= openvpn_t ==============
allow openvpn_t file_t:dir search;
allow openvpn_t file_t:file { read open };
allow openvpn_t file_t:lnk_file read;

Comment 1 Daniel Walsh 2011-02-11 17:09:50 UTC
This looks like you have a mislabeled crt file.  If you mv the cert file to ~/.cert and run restorecon -R -v ~/ 

It should fix the label.

Looks like you mv'd it from a device without labels.

Comment 2 Daniel Walsh 2011-02-11 17:10:25 UTC
*** Bug 676716 has been marked as a duplicate of this bug. ***