chore: enhance D-Bus service security configuration#105
chore: enhance D-Bus service security configuration#105deepin-bot[bot] merged 1 commit intolinuxdeepin:release/eaglefrom
Conversation
- Remove allow own from default policy, restrict to root only - Remove redundant interface-specific allow rules - Simplify configuration while maintaining functionality Log: Tighten D-Bus permissions by restricting service ownership to root user
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR tightens the D-Bus security configuration for the com.deepin.bootmaker service by removing default ownership permissions and redundant interface-specific allow rules, restricting service ownership to root while preserving method invocation capabilities for clients. Sequence diagram for D-Bus name ownership with restricted root-only policysequenceDiagram
actor RootProcess
actor NonRootProcess
participant DBusDaemon
participant BootmakerService
RootProcess->>DBusDaemon: RequestName(com.deepin.bootmaker)
DBusDaemon-->>RootProcess: Grant ownership (allowed by root-specific policy)
RootProcess->>BootmakerService: Start service under owned name
NonRootProcess->>DBusDaemon: RequestName(com.deepin.bootmaker)
DBusDaemon-->>NonRootProcess: Deny ownership (no default allow own)
NonRootProcess->>DBusDaemon: MethodCall(send_destination=com.deepin.bootmaker)
DBusDaemon-->>BootmakerService: Forward method call (allowed by send_destination rule)
BootmakerService-->>NonRootProcess: Method return
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- If the intent is to restrict service ownership to root, consider adding (or pointing to) an explicit
<policy user="root"> <allow own="com.deepin.bootmaker"/> </policy>rule in this file or a referenced config to avoid the service failing to acquire its bus name. - Given the stated goal of tightening D-Bus permissions, you may want to revisit the broad
<allow send_destination="com.deepin.bootmaker"/>in the default policy, as it still allows any user to invoke methods on the service despite the stricter ownership rule.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If the intent is to restrict service ownership to root, consider adding (or pointing to) an explicit `<policy user="root"> <allow own="com.deepin.bootmaker"/> </policy>` rule in this file or a referenced config to avoid the service failing to acquire its bus name.
- Given the stated goal of tightening D-Bus permissions, you may want to revisit the broad `<allow send_destination="com.deepin.bootmaker"/>` in the default policy, as it still allows any user to invoke methods on the service despite the stricter ownership rule.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审查意见:DBUS 策略配置变更分析这份 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全 —— 重点风险提示这里存在一个潜在的安全逻辑变更,需要根据实际业务场景严格评估:
改进建议
总结这个 diff 在逻辑上是合理的(去除了冗余规则),在性能上有微弱优化,但在安全上引入了显著的变化。
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: itsXuSt, max-lvs 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 |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
5d6c2f5
into
linuxdeepin:release/eagle
Log: Tighten D-Bus permissions by restricting service ownership to root user
Summary by Sourcery
Enhancements: