You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prove that a behavior runs without privilege, for osapi's and an extension's #1959
The lab found each privilege bug of #1943 only on a real host: ping under SELinux, sysctl under PrivateDevices, the journal group, apt's setuid helper, the netplan read, ip link and CAP_NET_ADMIN, the pipes on systemd 257. The author of a behavior, and of an extension, needs to find these before a lab run, and needs to learn the rule from osapi itself (#1948).
Three layers:
Static, in osapi dsl behavior validate:
A provider that runs a program (os/exec or the exec helper) outside a declared root call or step is refused.
A read of a path that the agent user cannot read (from a list: shadow, the SSH host keys, /root) must go through a declared read step.
The message names the fix: do it in Go, or declare a call or step with its Needs.
Generated test, osapi dsl behavior verify: runs each method of the behavior the way that the agent runs it:
as a non-root user, in the agent's systemd sandbox (the same unit properties);
with a broker, against a container or a VM;
on an SELinux-enforcing host (Fedora) and on a non-SELinux host (Debian) at least.
It reports each method that needs a privilege that it does not declare. CI runs it for osapi's behaviors. An extension author runs it against the lab or a VM.
Teach it:
spec get and the build-a-behavior skill give the rules: prefer Go to running a program (the ping example); when root is needed, declare the narrowest call or step with Needs; and a confined program under SELinux cannot use the broker's files.
Each refusal of the broker says which declaration is missing.
Part of #1948 (discoverability, with source and with extensions).
Activity