180 likes | 191 Views
Learn about the principle of least privilege in Condor and how it is implemented through the PrivSep Kernel, Switchboard, and ProcD. Discover the goals, operations, and implementation of PrivSep in Condor.
E N D
Principle of Least Privilege • “Every program and every user of the system should operate using the least set of privileges necessary to complete the job.” • Saltzer and Schroeder, 1975
condor user root user User IDs in Condor • An unprivileged account for Condor’s files and processes • Unprivileged accounts for regular users who submit jobs to Condor • The machine-wide superuser
condor user root user Un-Separated Condor Condor Daemon Files Processes
PrivSep: Goals • Reduce the part of Condor that runs with superuser privileges to a small “PrivSep Kernel” • Restrict actions that Condor can perform via the PrivSep Kernel to a reasonable minimum for Condor’s operation
PrivSep Kernel Condor Daemon PrivSep Kernel checks if requested operation is authorized PrivSep Kernel
PrivSep Kernel Operations • File Operations • Change ownership of a directory tree • Delete a directory tree • Perform an open or rename operation as a regular user • Process Operations • Execute program as a regular user • Signal a process • Suspend, continue, or kill a process family • Get process family usage info
PrivSep Kernel Implementation • Switchboard • Supports the file system operations and ability to create processes as regular users • ProcD • Support the rest of the process operations
Implementation: The PrivSep Switchboard • root-owned setuid binary • Configured to allow a single account (condor) to use its operations • Limits on what actions it will perform are defined in a root-owned configuration file
Switchboard: rm -rf StartD “remove the directory tree at /condor/execute/dir_1234” “dir_1234 is in a Condor-managed directory, so I’ll go ahead” Switchboard
Switchboard: Open as User SchedD “open file X as user gquinn” Switchboard
Implementation: The ProcD • Tracks the “family tree” of the Condor Master • Allows Condor to signal and gather accounting data for processes under its control • Runs as root (it’s part of the PrivSep Kernel) • Like the Switchboard, only accepts commands from the condor user account
Implementation: The ProcD Master ProcD “send a SIGTERM to Job B” StartD Starter Starter SIGTERM Job A Job B
Execute Side Master • PrivSep Kernel provides everything needed for full privilege separation • File transfer is accomplished by changing the ownership of the job’s sandbox to the condor user temporarily ProcD StartD Switch- board Starter
Submit Side Master • Cannot take care of file transfer via chown • File transfer logic needs to be executed in a separate, user-owned process (the TransferD) ProcD SchedD Switch- board Shadow
The TransferD SchedD sends data to the execute side TransferD Shadow
Current Status • PrivSep Kernel is implemented completely on UNIX, ProcD-only on Windows • Execute-side has been modified to use the PrivSep Kernel, and can now run as an unprivileged user • TransferD implementation is complete • Submit-side integration with PrivSep Kernel and TransferD yet to come