94. pepsi-console¶
Run Pepsi commands in a terminal window of the browser console.
94.1. Role¶
pepsi-console serve is the daemon behind the console’s CLI windows
(The CLI console). It runs as root, started on demand by
pepsi-console.socket in the package pepsi-httpd-admin, and only
pepsi-httpd may connect to its socket /run/pepsi/console.sock. For
each window it creates a pseudo-terminal and starts pepsi-console shell in
it: a restricted shell that runs the operator programs of Pepsi, each under its
own account, and nothing else. Reference: pepsi-console(1).
94.2. Why a daemon of its own¶
pepsi-httpd runs unprivileged and must stay so. The privileged applier
(pepsi-setup apply) cannot serve a terminal either: it takes its work from
a closed list of tasks in the database and never from a socket that speaks a
protocol. A terminal needs a process that can start programs as root and
as other accounts, so that process is separate, small and started only when a
window is opened. It does not believe pepsi-httpd: it checks the
administrator’s session in the database itself and checks it again every
minute (The CLI console).
94.3. What it costs¶
A console runs pepsi-setup, pepsi-config, pepsi-keys and
pepsi-whitelist as root. Whoever holds the scope cli:exec can therefore change anything
that root can change through those programs, the configuration included, and
the configuration names the programs that the pipeline runs. Treat the scope
as a root shell; only the role superadmin has it. The daemon’s own check
of the session does not protect against a compromised pepsi-httpd, which
may write the sessions that the daemon reads: while the socket is armed, such
a compromise reaches root. The socket therefore ships disabled; the operator
arms it with systemctl enable --now pepsi-console.socket (on macOS
pepsi-launchd enable console) and disarms it with systemctl disable
--now pepsi-console.socket. Removing the package pepsi-httpd-admin
removes the applier too. The threat model states
the residual in A compromised component and A delegated administrator.
94.4. See also¶
pepsi-httpd, pepsi-setup, The administration console, Security model, pepsi-console(1).