-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Secure the Logviewer service Log: Secure the Logviewer service Task: https://pms.uniontech.com/task-view-355359.html
- Loading branch information
1 parent
6edca8a
commit 98da0d9
Showing
3 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 33 additions & 3 deletions
36
logViewerService/assets/data/deepin-log-viewer-daemon.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,42 @@ | ||
[Unit] | ||
Description=Deepin Log Viewer Daemon | ||
Wants=dbus.socket | ||
After=dbus.socket | ||
|
||
[Service] | ||
Type=dbus | ||
BusName=com.deepin.logviewer | ||
ExecStart=/usr/lib/deepin-daemon/log-view-service | ||
CapabilityBoundingSet=~CAP_NET_RAW | ||
# cap能力不能填为空,否则日志收集工具启动卡,并且不能查看/var/log下日志,建议cap能力不能为dbus必查项 | ||
#CapabilityBoundingSet=~CAP_NET_RAW | ||
MemoryLimit=8G | ||
# 非root有阻塞,deepin-daemon启动后不能通过/proc/pid/exe获取启动进程全路径,下一阶段再按deepin-dameon启动 | ||
#User=deepin-daemon | ||
ProtectSystem=strict | ||
|
||
InaccessiblePaths=-/etc/shadow | ||
InaccessiblePaths=-/etc/NetworkManager/system-connections | ||
InaccessiblePaths=-/etc/pam.d | ||
InaccessiblePaths=-/usr/share/uadp/ | ||
|
||
NoNewPrivileges=yes | ||
# 传参需要/home,比如导出日志到/home路径下,读取/home/$user/.cache下应用日志 | ||
#ProtectHome=yes | ||
ProtectKernelTunables=yes | ||
ProtectKernelModules=yes | ||
ProtectControlGroups=yes | ||
PrivateMounts=yes | ||
PrivateTmp=yes | ||
PrivateDevices=yes | ||
PrivateNetwork=yes | ||
RestrictNamespaces=yes | ||
LockPersonality=yes | ||
RestrictRealtime=yes | ||
RemoveIPC=yes | ||
MemoryDenyWriteExecute=yes | ||
|
||
# 需要device权限,可能导出日志到U盘等外部设备 | ||
#DeviceAllow=/dev/loop-control | ||
# 需要使用network,进行埋点上报 | ||
#RestrictFileSystems=~@network | ||
|
||
[Install] | ||
WantedBy=multi-user.target |