-
Notifications
You must be signed in to change notification settings - Fork 42
chore: harden systemd service security #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Added security hardening options to the application update notifier systemd service: 1. ProtectSystem=strict - Prevents writing to system directories 2. PrivateNetwork=yes - Isolates the service from network access 3. RestrictAddressFamilies=AF_UNIX - Limits socket communication to local Unix sockets only 4. NoNewPrivileges=yes - Prevents the service from gaining additional privileges These security measures follow systemd best practices to minimize the service's attack surface and contain potential security breaches by restricting filesystem access, network capabilities, and privilege escalation. Influence: 1. Verify the update notifier service starts correctly with new restrictions 2. Test that application update notifications still function properly 3. Confirm the service cannot access network resources 4. Validate that file system operations are properly restricted 5. Check that privilege escalation attempts are blocked chore: 增强 systemd 服务安全性 为应用程序更新通知器的 systemd 服务添加安全加固选项: 1. ProtectSystem=strict - 防止写入系统目录 2. PrivateNetwork=yes - 隔离服务与网络访问 3. RestrictAddressFamilies=AF_UNIX - 限制套接字通信仅限本地 Unix 套接字 4. NoNewPrivileges=yes - 防止服务获取额外权限 这些安全措施遵循 systemd 最佳实践,通过限制文件系统访问、网络能力和权限 提升来最小化服务的攻击面并遏制潜在的安全漏洞。 Influence: 1. 验证更新通知器服务在新增限制下能正确启动 2. 测试应用程序更新通知功能是否正常工作 3. 确认服务无法访问网络资源 4. 验证文件系统操作是否被正确限制 5. 检查权限提升尝试是否被阻止
Reviewer's guide (collapsed on small PRs)Reviewer's GuideHardens the Application Update Notifier systemd service by adding several security-focused unit options that restrict filesystem access, networking, socket address families, and privilege escalation, following systemd hardening best practices. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- Given
ProtectSystem=strictand the likely need to write state somewhere, consider explicitly declaringStateDirectory=/CacheDirectory=/RuntimeDirectory=(or otherwise ensuring writable paths under/varare clearly defined) so future changes don’t accidentally break the service’s ability to persist data. - You might want to complement the existing hardening with other low-risk systemd protections that usually don’t interfere with D-Bus–only services, such as
ProtectHome=yes,PrivateTmp=yes, andProtectKernelTunables=yes, if they are compatible with how the notifier runs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Given `ProtectSystem=strict` and the likely need to write state somewhere, consider explicitly declaring `StateDirectory=`/`CacheDirectory=`/`RuntimeDirectory=` (or otherwise ensuring writable paths under `/var` are clearly defined) so future changes don’t accidentally break the service’s ability to persist data.
- You might want to complement the existing hardening with other low-risk systemd protections that usually don’t interfere with D-Bus–only services, such as `ProtectHome=yes`, `PrivateTmp=yes`, and `ProtectKernelTunables=yes`, if they are compatible with how the notifier runs.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review这是一个针对systemd服务单元文件的安全加固补丁,我来详细分析一下改进的各个方面:
建议:
总的来说,这是一个很好的安全加固补丁,显著提高了服务的安全性,同时保持了服务的核心功能。这些改进符合最小权限原则,有效降低了潜在的安全风险。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
为什么obs构建失败了 |
Added security hardening options to the application update notifier systemd service:
These security measures follow systemd best practices to minimize the service's attack surface and contain potential security breaches by restricting filesystem access, network capabilities, and privilege escalation.
Influence:
chore: 增强 systemd 服务安全性
为应用程序更新通知器的 systemd 服务添加安全加固选项:
这些安全措施遵循 systemd 最佳实践,通过限制文件系统访问、网络能力和权限
提升来最小化服务的攻击面并遏制潜在的安全漏洞。
Influence:
Summary by Sourcery
Enhancements: