有两个建议:
考虑让clash-meta把需要写的文件和理应只读的配置文件分开,并且开启一些保护功能:
[Service]
ProtectHome=true
ProtectSystem=full
PrivateTmp=true
ProtectKernelTunables=true
ProtectControlGroups=true
NoNewPrivileges=true
MemoryDenyWriteExecute=true
StateDirectory=clash-meta
ConfigurationDirectory=clash-meta
ConfigurationDirectoryMode=0555
ExecStartPre=
ExecStartPre=-ln -s /etc/clash/Country.mmdb $STATE_DIRECTORY
ExecStart=
ExecStart=clash-meta -d $STATE_DIRECTORY -f ${CONFIGURATION_DIRECTORY}/config.yaml
按道理来说 /usr 和 /etc 对于绝大多数服务而言都应该是只读的。
另外,默认配置应该做成无条件直连的
Pinned Comments
sukanka commented on 2023-02-15 01:05 (UTC)
If you want use tun mode, add the following pacman hook.