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
Run NATS and the controller as their own users #1945
architectureLong-term design of how the system fits together; needs deep thought before any workcomponent/controllerinternal/controller: the API server, admission, auditenhancementNew feature or request
The agent runs as osapi after #1907 (#1943). The NATS server and the controller still run as root when osapi nats service install and osapi controller service install install them.
Run each one as its own user:
osapi-nats owns the JetStream store directory and the NATS config.
osapi-controller owns the controller's state and its signing keys.
Each unit gets the same sandbox as the agent unit: no capabilities, NoNewPrivileges=yes, and ProtectSystem=strict with a StateDirectory.
On macOS, each launch daemon names its user.
The install makes the users and the groups, and makes each state directory through descriptors with no link, as the agent install does.
The design is order-of-work item 5 of components/osapi/least-privilege.md in specs (osapi-io/specs#756).
Check: in the lab, ps -o user shows osapi-nats and osapi-controller, and the integration tests pass under the real units.
Layout note from #1943: osapi follows the FHS by default, with the least config possible, and the lab uses only the defaults. #1943 moves only the paths of the broker and the agent:
the enabled list: /etc/osapi/privileged/enabled (root 0644, in a root 0755 directory);
the broker's call directories: /run/osapi/privileged/ (root 0700), with the socket at /run/osapi/privileged.sock;
the rescue: /var/lib/osapi/privileged/rescue, in /var/lib/osapi/privileged (root 0711), and the check tree in /run/osapi/rescue-check;
the agent's state: /var/lib/osapi/agent (StateDirectory=osapi/agent), with its keys in /var/lib/osapi/agent/pki and its pending changes in /var/lib/osapi/agent/pending. Root owns /var/lib/osapi (0755).
The rest of the layout is in this issue:
a state directory for each component: /var/lib/osapi/controller and /var/lib/osapi/nats (the JetStream store is /var/lib/osapi/jetstream today);
the key directories of the controller and NATS;
per-user XDG paths for the CLI and for osapi start.
architectureLong-term design of how the system fits together; needs deep thought before any workcomponent/controllerinternal/controller: the API server, admission, auditenhancementNew feature or request
Activity
retr0h commentedon Dec 6, 2026
Layout note from #1943: osapi follows the FHS by default, with the least config possible, and the lab uses only the defaults. #1943 moves only the paths of the broker and the agent:
The rest of the layout is in this issue:
osapi start.