Provide readonly and mutating framework_tool instances with scoped sudoers #389
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config#389
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
framework_toolis already installed on Electra fromframework-system(0.6.6) and carries the thermal, fan and expansion-bay commands, but it cannot be used without root:/dev/portiscrw-r----- root kmem(chardev 1,4) — the portio interface used for EC access/dev/v4l/ecchars, and/sys/kernel/debug/ec/is emptyMust be root to get SMBIOS data.→Failed to find SMBIOS→Not a Framework LaptopSo every EC capability, including read-only diagnostics such as
--thermal,--sensorsand--expansion-bay, is currently blocked behind an interactive password. Observed 2026-10-26 on Electra while investigating background heat.Why two instances
The upstream
readonlyCargo feature is a compile-time capability guard, not a runtime flag. Because the guard is compiled in, a sudoers rule on the readonly binary does not need to enumerate safe arguments — the binary physically cannot issue a blocked command. That is the reason to use the feature rather than sudoers argument wildcards.Deliverables
readonlybuild installed under a distinct name (framework-tool-ro).framework-tool, with the existingnvidiafeature only in thedgputier.--expansion-bayoutput as an assertion inelectra-select-latest-specialisationinstead of trusting operator input.Upstream behaviour to design around (verified in the 0.6.6 source)
framework_lib/src/commandline/mod.rsreplaces the parsed CLI with an explicit allow-list, then..Default::default(). Upstream's own TODO: "Instead of silently ignoring blocked command, we should remind the user." Blocked options therefore fail silently.Allowed in a
readonlybuild:--thermal,--thermalget,--thermalset,--sensors,--power,--expansion-bay,--inputdeck(-mode),--pdports,--pd-info,--switches,--console,--sysinfo,--uptimeinfo,--s0ix-counter,--port80read,--panicinfo,--protoinfo,--versions,--features,--esrt,--kblight,--rgbkbd,--remap-key,--fp-led-level,--fp-brightness,--get-gpio,--intrusion,--privacy,--ps2-enable,--nvidia(when that feature is also on)Blocked in a
readonlybuild:--autofanctrl,--fansetduty,--fansetrpm,--charge-limit,--charge-current-limit,--charge-rate-limit,--smartbattery,--smartbattery-auth, all--flash-*,--force,--host-command,--ec-hib-delay,--tablet-mode,--touchscreen-enable,--pd-reset/disable/enable,--dp-hdmi-update,--dump-ec-flashConsequences for the current thermal investigation:
--thermalsetsurvives in the readonly build, so the "safe" binary can still write fan thresholds — it is not purely read-only.--autofanctrland--fansetdutydo not survive; fan control belongs in the mutating binary.--smartbattery(EC battery) and thesmartmontoolsfeature (disk SMART via libsmartmon) are unrelated despite similar names.Upstream defect: the allow-list contains
pd_info: cli.version, so in a readonly build--pd-infoonly fires when--versionis also set.Draft shape
Both still need root regardless of the difference above: the difference between them is capability and authentication, not privilege.
Completion criteria
nix flake checkcleanframework-tool-ropresent, and a blocked command (e.g.--fansetduty 50) is a no-op rather than a writesudo -n framework-tool-ro --thermalsucceeds without a password and returns fan/temperature stateframework-tool --thermalset ...requires authentication--expansion-bayoutput recorded through the ro binaryjust teston electra passes with the new packages and sudoersNot yet verified
readonlybuild has not been compiled; the feature is declared inCargo.tomlbut untested here.smartmonandnvml-wrapperare declared inCargo.lock, but the cargo vendor dirs are not realised in this store, so enablingsmartmontoolsornvidiais not confirmed to build offline.--thermalreadings have been obtained; fan/thermal state on Electra is still unknown.Licensing
framework-systemis BSD-3-Clause. Thesmartmontoolsfeature pulls in libsmartmon,GPL-2.0-or-later— a standard license with nothing unusual in it. The only consequence is that the combined binary becomes GPL-2.0-or-later, a one-way door for publishing that binary. Not a blocker here; enable only if disk SMART detail is actually wanted.Related
Opened in error — this repository's issues are tracked on GitLab (
forge.nimmog.uk,nimmo-nix/nixos-config), which is where the git remote points. Tracked instead as https://forge.nimmog.uk/nimmo-nix/nixos-config/-/work_items/358.