SELinuxは、root以外のユーザーのVPN接続をブロックしています。

SELinuxは、root以外のユーザーのVPN接続をブロックしています。

すべてのユーザーが(オープン)VPN接続を使用できるようにしたいが、rootではない場合はSELinuxによってブロックされます。

var/log/audit/audit.log私は最初に非快適なモードでそれを見ました:

type=AVC msg=audit(1659770552.275:309): avc:  denied  { getattr } for  pid=1923 comm="openvpn" path="/root/.cert/nm-openvpn/ie-dub.prod.blk.com_udp-tls-auth.pem" dev="nvme0n1p3" ino=802406 scontext=system_u:system_r:openvpn_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0

その後、ブロックされたコンテンツを表示できるように設定しました。

type=AVC msg=audit(1659770802.776:318): avc:  denied  { getattr } for  pid=2124 comm="openvpn" path="/root/.cert/nm-openvpn/hu-bud.prod.blk.com_udp-tls-auth.pem" dev="nvme0n1p3" ino=802398 scontext=system_u:system_r:openvpn_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=1
type=AVC msg=audit(1659770802.777:319): avc:  denied  { read } for  pid=2124 comm="openvpn" name="hu-bud.prod.blk.com_udp-tls-auth.pem" dev="nvme0n1p3" ino=802398 scontext=system_u:system_r:openvpn_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=1
type=AVC msg=audit(1659770802.777:320): avc:  denied  { open } for  pid=2124 comm="openvpn" path="/root/.cert/nm-openvpn/hu-bud.prod.blk.com_udp-tls-auth.pem" dev="nvme0n1p3" ino=802398 scontext=system_u:system_r:openvpn_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=1
type=NETFILTER_CFG msg=audit(1659770805.461:321): table=firewalld:6 family=1 entries=5 op=nft_register_rule pid=916 subj=system_u:system_r:firewalld_t:s0 comm="firewalld"
type=SERVICE_START msg=audit(1659770805.528:322): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'UID="root" AUID="unset"

*.pemファイルのコンテキストタグを変更する必要があるようですが、どのコンテキストを使用するのかは不明です。

ベストアンサー1

のファイルを見ると/etc/openvpnタグがあるのがわかりますopenvpn_etc_t

# cd /etc/openvpn
# ls -lZ
total 0
drwxr-x---. 1 root openvpn system_u:object_r:openvpn_etc_t:s0 0 Jun 10 13:36 client
drwxr-x---. 1 root openvpn system_u:object_r:openvpn_etc_t:s0 0 Jun 10 13:36 server

もともとこのディレクトリに構成ファイルを作成した場合は、すでに正しいラベルがあります。しかし、エラーと判断した場合、openvpnは/rootファイルを読み取ろうとしています。これはサービスに高い権限が必要なため、一般的に良い考えではありません。

最も簡単な解決策は、おそらくファイルを/etc/openvpnmv次のことがうまく機能します。

tar -C /root/.cert -cf- . | tar -C /etc/openvpn -xf-

これにより、nm-openvpnディレクトリが/etc/openvpn正しいタグに配置されます。

新しい場所で証明書を使用するには、接続プロファイルを更新する必要があります。

おすすめ記事