fix(auth): unify caller authentication to isTrustedSender and remove binary path identification#428
fix(auth): unify caller authentication to isTrustedSender and remove binary path identification#428Fire-dtx wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Fire-dtx 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 |
e4fe428 to
617487e
Compare
…d polkit Replace binary path-based caller identification with isTrustedSender + polkit authentication across all protected D-Bus interfaces. Add allow-caller registration mechanism for deepin-security-loader integration. Remove binary path constants and whitelists: - getExecutablePathAndCmdline, mapMethodCaller, checkSenderNsMntValid - allowInstallPackageExecPaths, allowRemovePackageExecPaths Add isTrustedSender check with polkit fallback in checkInvokePermission (Manager method) for InstallPackage, RemovePackage, DistUpgradePartly, PrepareDistUpgradePartly, PrepareFullScreenUpgrade, SetUpdateSources, UpdateMode, CheckUpdateModeWrite, and SetMirrorSource. Add manager_auth.go: - Allow-caller registration with persistent runtime state under /run/lastore - Lightdm trusted UID support via initTrustedCallerUIDs - Export SetAllowCaller D-Bus method D-Bus access rules: deny SetAllowCaller/PowerOff for default policy, allow deepin-daemon and lightdm groups. systemd: RuntimeDirectoryMode 0700 with RuntimeDirectoryPreserve=yes. Refactor PrepareFullScreenUpgrade to use terminate() closure, removing dead lastore-upgrader.service fallback path. Remove inline PowerOff execPath check. Add isInstallLikeJobType helper. Remove deprecated install-package-support-auth config item. Add unit tests for manager_auth and isInstallLikeJobType. Fix appinfo_test to use t.TempDir().
deepin pr auto review这是一个非常全面且核心的权限重构补丁。该补丁将 整体来看,这个重构方向是正确的,解决了旧模型中路径伪造、更新后路径失效 以及硬编码等一系列问题。但代码在逻辑严谨性、性能和安全性上仍有改进空间。 以下是详细的审查意见: 一、 安全性1.
2.
3.
二、 逻辑与语法1.
2.
3.
三、 性能1.
四、 代码质量1. DBus 配置文件中的 <policy context="default">
<allow send_destination="org.deepin.dde.Lastore1"/>
<deny send_destination="org.deepin.dde.Lastore1" send_member="SetAllowCaller"/>
</policy>DBus 配置的匹配规则是后匹配优先,且具体规则优先级高于通用规则。这里先
2. 测试用例 3. 总结此次重构大幅提升了鉴权的安全性和可维护性,尤其是引入了 DBus Unique Name 动态注册机制,非常值得肯定。但必须修复 |
|
TAG Bot New tag: 6.2.59 |
Replace binary path-based caller identification (getExecutablePathAndCmdline, mapMethodCaller, checkInvokePermission) with isTrustedSender + polkit authentication for DistUpgradePartly and PrepareDistUpgradePartly interfaces. Remove caller authentication from RemovePackage interface. Add appstore_intranet.list to trusted source list. Remove deprecated deny-exec-whitelist and install-package-support-auth config items.
Introduce manager_auth.go with allow-caller registration, lightdm trusted UID support, and persistent runtime state under /run/lastore. Export SetAllowCaller D-Bus method for deepin-security-loader integration. Add D-Bus access rules for SetAllowCaller deny and deepin-daemon group policy. Configure RuntimeDirectory with 0700 mode and preserve semantics.