Why
Development keeps having to touch /usr/local's operational, load-bearing
boundary to test anything privileged. That is how this session accidentally
crossed the live sudo path twice while running a conformance case (see #2).
The installed broker is shared infrastructure other agents call constantly; it
must stop being the test target.
Decided 2026-08-18: do both of the following. A macOS VM was considered and
rejected — no Parallels licence, and this machine runs out of disk weekly.
Part A — compile-time test prefix, same machine
Install a second, parallel boundary at a non-standard prefix with its own
service identity, and point development at that.
Already parameterized: install accepts --vault, --service-user,
--service-group, --operator.
The one blocker is sudo-secretspec-cli/src/main.rs:20:
const CONFIG_PATH: &str = "/usr/local/etc/sudo-secretspec.toml";
It is hardcoded on purpose. If a caller could redirect the config it could
redirect the vault path and the service user, which is a straightforward
privilege-escalation vector. So:
Part B — ephemeral macOS CI
Guardrails to preserve
The 229 cargo test -p sudo-secretspec-cli tests already run hermetically
against tempdirs and never touch the live boundary. Keep it that way — Part A is
for the things a unit test genuinely cannot cover (real sudo, real dscl
identities, real sudoers parsing), not a replacement for them.
Related
Why
Development keeps having to touch
/usr/local's operational, load-bearingboundary to test anything privileged. That is how this session accidentally
crossed the live
sudopath twice while running a conformance case (see #2).The installed broker is shared infrastructure other agents call constantly; it
must stop being the test target.
Decided 2026-08-18: do both of the following. A macOS VM was considered and
rejected — no Parallels licence, and this machine runs out of disk weekly.
Part A — compile-time test prefix, same machine
Install a second, parallel boundary at a non-standard prefix with its own
service identity, and point development at that.
Already parameterized:
installaccepts--vault,--service-user,--service-group,--operator.The one blocker is
sudo-secretspec-cli/src/main.rs:20:It is hardcoded on purpose. If a caller could redirect the config it could
redirect the vault path and the service user, which is a straightforward
privilege-escalation vector. So:
behind a cargo feature (
test-boundary,default = []) so a releasebinary does not contain the code path at all, rather than containing it
and declining to use it.
cannot be defeated by a stray
--featuresin a build job./opt/sudo-secretspec-test, serviceuser
_sudo_secretspec_test, vault under the same prefix. The prefix mustbe root-owned and non-group-writable at every level or
drift.rscheck_ancestor_chainwill (correctly) refuse it.uninstall of one cannot remove the other. There is already a test named
uninstall_never_removes_a_policy_it_cannot_prove_it_wrote, so theprovenance machinery exists — verify it covers this case rather than
assuming it does.
the production prefix, and a production binary must not operate the test
prefix. Failing closed here is the whole point.
Part B — ephemeral macOS CI
→ drift → rollback → uninstall →
--purge-vault— on a freshmacos-latestrunner. A throwaway machine is the only place it is safe toexercise the destructive paths honestly.
Guardrails to preserve
The 229
cargo test -p sudo-secretspec-clitests already run hermeticallyagainst tempdirs and never touch the live boundary. Keep it that way — Part A is
for the things a unit test genuinely cannot cover (real
sudo, realdsclidentities, real sudoers parsing), not a replacement for them.
Related
secretspec.provider/1endpoint, whose--clientpathneeds a boundary to talk to that is not the operational one. This issue
blocks that work item.