Skip to content

Conversation

@fly602
Copy link
Contributor

@fly602 fly602 commented Dec 22, 2025

Added security hardening options to the [email protected] file to improve system security and limit potential attack surfaces. The changes include enabling NoNewPrivileges to prevent privilege escalation, setting ProtectSystem=strict to protect system directories, and configuring specific ReadWritePaths to restrict file system access. Additional protections include restricting kernel module loading and real-time scheduling access.

Log: Enhanced security for update log copy service with systemd hardening features

Influence:

  1. Verify update log copy functionality still works correctly
  2. Test service operation with different user accounts
  3. Confirm log files are properly copied to designated paths
  4. Validate service cannot access unauthorized system areas
  5. Test service behavior under restricted privilege conditions

fix: 增强服务安全性,添加 systemd 加固选项

[email protected] 文件添加了安全加固选项,以提高系统 安全性并限制潜在攻击面。更改包括启用 NoNewPrivileges 防止权限提升,设置
ProtectSystem=strict 保护系统目录,以及配置特定的 ReadWritePaths 限制文 件系统访问。其他保护措施包括限制内核模块加载和实时调度访问。

Log: 通过 systemd 加固功能增强了更新日志复制服务的安全性

Influence:

  1. 验证更新日志复制功能是否正常工作
  2. 使用不同用户账户测试服务操作
  3. 确认日志文件正确复制到指定路径
  4. 验证服务无法访问未经授权的系统区域
  5. 测试在受限权限条件下的服务行为

Added security hardening options to the [email protected]
file to improve system security and limit potential attack surfaces.
The changes include enabling NoNewPrivileges to prevent privilege
escalation, setting ProtectSystem=strict to protect system directories,
and configuring specific ReadWritePaths to restrict file system access.
Additional protections include restricting kernel module loading and
real-time scheduling access.

Log: Enhanced security for update log copy service with systemd
hardening features

Influence:
1. Verify update log copy functionality still works correctly
2. Test service operation with different user accounts
3. Confirm log files are properly copied to designated paths
4. Validate service cannot access unauthorized system areas
5. Test service behavior under restricted privilege conditions

fix: 增强服务安全性,添加 systemd 加固选项

为 [email protected] 文件添加了安全加固选项,以提高系统
安全性并限制潜在攻击面。更改包括启用 NoNewPrivileges 防止权限提升,设置
ProtectSystem=strict 保护系统目录,以及配置特定的 ReadWritePaths 限制文
件系统访问。其他保护措施包括限制内核模块加载和实时调度访问。

Log: 通过 systemd 加固功能增强了更新日志复制服务的安全性

Influence:
1. 验证更新日志复制功能是否正常工作
2. 使用不同用户账户测试服务操作
3. 确认日志文件正确复制到指定路径
4. 验证服务无法访问未经授权的系统区域
5. 测试在受限权限条件下的服务行为
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602

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

@deepin-ci-robot
Copy link

deepin pr auto review

这是一个系统服务配置文件的修改,主要是增加了安全加固相关的配置。让我来分析一下这些修改:

  1. 语法逻辑:
  • 语法正确,符合 systemd 服务单元文件的格式规范
  • 所有新增的配置项都是 systemd 支持的标准选项
  1. 代码质量:
  • 配置项分组合理,使用注释说明了这是安全加固部分
  • 配置项的顺序合理,安全相关的配置集中在一起
  1. 安全性改进:
  • NoNewPrivileges=yes:防止服务进程获取新的权限,这是一个很好的安全实践
  • ProtectSystem=strict:将文件系统访问限制为只读,提高了系统安全性
  • ProtectKernelModules=yes:禁止加载内核模块,防止潜在的内核模块攻击
  • RestrictRealtime=yes:禁止实时调度权限,防止进程滥用系统资源
  1. 潜在问题和建议:
  • ReadWritePaths 配置可能过于宽松:
    • /home 的写入权限范围太大,建议限制到具体需要的路径
    • 建议将多个 ReadWritePaths 合并为一行,使用空格分隔,例如:
      ReadWritePaths=/tmp/deepin-update-ui %i
      
    • 如果只需要写入特定用户的家目录,建议使用更具体的路径
  1. 性能影响:
  • 这些安全限制对性能影响很小
  • ProtectSystem=strict 可能会在需要写入系统文件时造成性能开销,但这是必要的安全权衡
  1. 其他建议:
  • 考虑添加 PrivateTmp=yes 来隔离临时文件
  • 可以考虑添加 ProtectHome=yes 来限制对家目录的访问
  • 如果不需要网络访问,可以添加 PrivateNetwork=yes

改进后的配置建议:

# Security hardening
NoNewPrivileges=yes
ProtectSystem=strict
ReadWritePaths=/tmp/deepin-update-ui %i
ProtectKernelModules=yes
RestrictRealtime=yes
PrivateTmp=yes

这些修改显著提高了服务的安全性,但建议进一步收紧 ReadWritePaths 的权限范围,以实现最小权限原则。

@deepin-bot
Copy link

deepin-bot bot commented Dec 26, 2025

TAG Bot

New tag: 1.0.38
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #208

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.

2 participants