Closed jdeanwallace closed 4 months ago
⏳ @jotaen4tinypilot please review this Pull Request
@mtlynch - Can we mark the new check_privilege_guard
check as "required" on GitHub? I don't have the right permissions to do that myself.
Can we mark the new check_privilege_guard check as "required" on GitHub? I don't have the right permissions to do that myself.
Sure thing! I've added it.
Resolves https://github.com/tiny-pilot/tinypilot-pro/issues/1214
Blocked by https://github.com/tiny-pilot/tinypilot/pull/1744Blocked by https://github.com/tiny-pilot/tinypilot/pull/1745This PR adds a dev script that checks for possible cases of privilege escalation in tinypilot-writable scripts (i.e.,
scripts/
).The script only does a superficial check that root privileges were at least considered by matching on:
Example output of
dev-scripts/check-privilege-guard
:Notes
These tinypilot-writable scripts legitimately require root privileges:scripts/install-bundle
script/upgrade
So they do risk being used for privilege escalation, but they are/should never be executed by privileged scripts on the device.
I've also added a superficial check for this too.
dev-scripts/check-privilege-guard
as picked up. As a reminder, the fix is a runtime error asking for reduced permissions which is something we'll only encounter when we physically test the device. So as a result, this PR also tries to avoid those runtime errors by running these identified scripts astinypilot
where needed: