Skip to content

Conversation

@zhaohuiw42
Copy link
Contributor

This service creates a configuration file under /tmp owned by the deepin-daemon user, and other users do not have permission to modify it.

Bug: https://pms.uniontech.com/bug-view-346161.html

This service creates a configuration file under /tmp owned by the deepin-daemon
user, and other users do not have permission to modify it.

Bug: https://pms.uniontech.com/bug-view-346161.html
@github-actions
Copy link

github-actions bot commented Dec 30, 2025

CLA Assistant Lite bot:
提交邮箱中包含我们的合作伙伴,但您似乎并非合作伙伴的成员或对接人,请联系相关对接人将您添加至组织之中,或由其重新发起 Pull Request。
The commit email domain belongs to one of our partners, but it seems you are not yet a member of the current organization, please contact the contact person to add you to the organization or let them submit the Pull Request.

You can retrigger this bot by commenting recheck in this Pull Request

@deepin-ci-robot
Copy link

deepin pr auto review

我来对这个 systemd 服务文件的修改进行审查:

  1. 修改内容分析:
  • 删除了 User=deepin-daemon 这一行配置
  1. 安全性分析:
    这是一个安全风险较高的修改。原因如下:
  • 权限提升风险:
    原配置通过指定 User=deepin-daemon 限制了服务的运行权限,这是一个很好的安全实践。删除此配置后,服务将以 root 权限运行,增加了潜在的安全风险。

  • 攻击面扩大:
    当服务以 root 权限运行时,如果服务代码存在漏洞,攻击者可能获得系统最高权限。

  1. 改进建议:

a. 恢复用户配置:

User=deepin-daemon

b. 如果确实需要更高权限,建议:

User=root
# 或者使用 Capability 机制仅授予必要的权限
CapabilityBoundingSet=CAP_NET_ADMIN CAP_SYS_ADMIN
AmbientCapabilities=CAP_NET_ADMIN CAP_SYS_ADMIN

c. 其他安全加固建议:

# 限制文件系统访问
ProtectSystem=full
ProtectHome=true

# 限制网络访问
PrivateNetwork=true
# 或者如果需要网络访问
RestrictAddressFamilies=AF_INET AF_INET6

# 限制系统调用
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM

# 限制设备访问
PrivateDevices=true
DevicePolicy=closed

# 限制内核特性
RestrictRealtime=true
MemoryDenyWriteExecute=true
  1. 总结:
    建议恢复 User=deepin-daemon 配置,除非有特殊的权限需求。如果确实需要更高权限,应该使用最小权限原则,只授予必要的权限。同时建议添加更多的安全限制配置来加固服务安全性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: electricface, zhaohuiw42

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zhaohuiw42 zhaohuiw42 merged commit 29c17b6 into linuxdeepin:master Dec 30, 2025
12 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants