인디노트

SELinux 관련 openvpn 인증서 읽지 못할때 처리 본문

개발 플랫폼 및 언어

SELinux 관련 openvpn 인증서 읽지 못할때 처리

인디개발자 2019. 5. 29. 15:42

SELinux 로그 파일위치
/var/log/audit/audit.log

type=AVC msg=audit(1559111499.690:263): avc:  denied  { read } for  pid=13132 comm="openvpn" name="kcs_vpn_kcsca.crt" dev="dm-0" ino=35284142 scontext=system_u:system_r:openvpn_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
type=SYSCALL msg=audit(1559111499.690:263): arch=c000003e syscall=21 success=no exit=-13 a0=55cd4d1ba088 a1=4 a2=1 a3=12 items=0 ppid=1 pid=13132 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)
type=PROCTITLE msg=audit(1559111499.690:263): proctitle=2F7573722F7362696E2F6F70656E76706E002D2D6364002F6574632F6F70656E76706E2F002D2D636F6E66696700636C69656E742E636F6E66
type=AVC msg=audit(1559111499.690:264): avc:  denied  { read } for  pid=13132 comm="openvpn" name="kcs_vpn_kcsca.key" dev="dm-0" ino=35284168 scontext=system_u:system_r:openvpn_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
type=SYSCALL msg=audit(1559111499.690:264): arch=c000003e syscall=21 success=no exit=-13 a0=55cd4d1ba0d8 a1=4 a2=1 a3=6e6f697373696d72 items=0 ppid=1 pid=13132 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)
type=PROCTITLE msg=audit(1559111499.690:264): proctitle=2F7573722F7362696E2F6F70656E76706E002D2D6364002F6574632F6F70656E76706E2F002D2D636F6E66696700636C69656E742E636F6E66
type=AVC msg=audit(1559111499.690:265): avc:  denied  { getattr } for  pid=13132 comm="openvpn" path="/etc/openvpn/kcs_vpn_kcsca.key" dev="dm-0" ino=35284168 scontext=system_u:system_r:openvpn_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
type=SYSCALL msg=audit(1559111499.690:265): arch=c000003e syscall=4 success=no exit=-13 a0=55cd4d1ba0d8 a1=7ffee33ecb90 a2=7ffee33ecb90 a3=6e6f697373696d72 items=0 ppid=1 pid=13132 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)

[root@kcsca ~]# cd /
[root@kcsca /]# cd etc
[root@kcsca etc]# cd openvpn
[root@kcsca openvpn]# ls -al
total 32
drwxr-xr-x.   2 root root   89 May 29 02:15 .
drwxr-xr-x. 146 root root 8192 May 29 01:49 ..
-rw-------.   1 root root 2317 May 29 01:55 ca.crt
-rw-r--r--.   1 root root  211 May 29 02:12 client.conf
-rw-r--r--.   1 root root 7959 May 29 02:10 kcs_vpn_kcsca.crt
-rw-------.   1 root root 3272 May 29 02:10 kcs_vpn_kcsca.key
[root@kcsca openvpn]# ls -lZ
-rw-------. root root unconfined_u:object_r:openvpn_etc_t:s0 ca.crt
-rw-r--r--. root root unconfined_u:object_r:openvpn_etc_t:s0 client.conf
-rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 kcs_vpn_kcsca.crt
-rw-------. root root unconfined_u:object_r:admin_home_t:s0 kcs_vpn_kcsca.key
[root@kcsca openvpn]# chcon -R -t openvpn_etc_t kcs_vpn_kcsca.*
[root@kcsca openvpn]# ls -lZ
-rw-------. root root unconfined_u:object_r:openvpn_etc_t:s0 ca.crt
-rw-r--r--. root root unconfined_u:object_r:openvpn_etc_t:s0 client.conf
-rw-r--r--. root root unconfined_u:object_r:openvpn_etc_t:s0 kcs_vpn_kcsca.crt
-rw-------. root root unconfined_u:object_r:openvpn_etc_t:s0 kcs_vpn_kcsca.key

반응형
Comments