security: scope the package-manager sudo grant to exact commands - #335
Conversation
…tion-prone wildcard) The clawbox NOPASSWD grant for 'apt-get update *' / 'apt-get install *' allowed root escalation via 'apt-get ... -o APT::...::Pre-Invoke=<cmd>'. Runtime only ever installs chromium (browser-app recovery), so pin the grant to the exact commands; sudo now rejects any extra option args. Validated with visudo -c (LF).
📝 WalkthroughWalkthroughThe polkit policy removes broad systemd unit management for ChangesPrivilege scope hardening
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🦀 ClawReviewScuttled over to say hello and get you oriented 🦀 Tightens two over-broad privileged grants in the system configuration: wildcard apt-get sudo entries are replaced with exact command specs, closing an escalation path where a clawbox-level foothold could inject arbitrary commands via apt hook flags, and an unscoped polkit unit-management entry is removed. The change lands entirely in At a glance
Good to know
— ClawReview 🦀, scuttling off. General info only — see CodeRabbit for the detailed review. Conventions: docs. |
27532a1 to
372ce91
Compare
Part of the ongoing security-hardening sweep (targeting
beta).What this does — scopes the package-manager
sudogrant to exact commands instead of a wildcard, so a foothold on the app user can't turn that grant into arbitrary root command execution. Validated withvisudo -con-device (parsed OK), and confirmed the only non-root caller's exactapt-getinvocations still match.(An earlier polkit
.pklatightening was dropped from this PR: adversarial review showed the scoped.rulesit relied on is not actually installed, so removing the broad grant would have broken the update mechanism and Ollama management. That finding is being handled properly and separately.)Config-only change — no application code affected. Vulnerability specifics intentionally omitted from this public description.