Shellbox
Library and server for containerized shell execution
|
A ulimit/cgroup wrapper implemented as a bash script. More...
Public Member Functions | |
__construct ( $cgroup=false) | |
wrap (Command $command) | |
Modify the command passed as a parameter. | |
getPriority () | |
Get an integer priority level used to determine the order in which to run multiple wrappers. | |
Public Member Functions inherited from Shellbox\Command\Wrapper | |
setLogger (LoggerInterface $logger) | |
Set the logger. | |
Public Attributes | |
const | PRIORITY = 60 |
Needs to be outside of firejail so that it can set up a cgroup. | |
Additional Inherited Members | |
Protected Attributes inherited from Shellbox\Command\Wrapper | |
$logger | |
A ulimit/cgroup wrapper implemented as a bash script.
Shellbox\Command\BashWrapper::__construct | ( | $cgroup = false | ) |
string | false | $cgroup | Under Linux: a cgroup directory used to constrain memory usage of shell commands. The directory must be writable by the web server. If this is false, no memory limit will be applied. |
Shellbox\Command\BashWrapper::getPriority | ( | ) |
Get an integer priority level used to determine the order in which to run multiple wrappers.
Low numbers are innermost, high numbers are outermost, run last.
If you nest sandboxes, it makes sense to have the most privileged hypervisor/wrapper at the outside, and the least privileged on the inside. Suggested values:
Reimplemented from Shellbox\Command\Wrapper.
Shellbox\Command\BashWrapper::wrap | ( | Command | $command | ) |
Modify the command passed as a parameter.
Command | $command |
Reimplemented from Shellbox\Command\Wrapper.
const Shellbox\Command\BashWrapper::PRIORITY = 60 |
Needs to be outside of firejail so that it can set up a cgroup.
Also, firejail may disable syscalls, breaking the bash wrapper.