I would like (from code) to start a process with very limited privileges.
- It can save files, but only in its own folder and is limited by a quota.
- Can use memory within the quota.
- CPU time (including any running subprocesses) is limited by quota.
- It is impossible to talk to any other process except its own and the interface with my controller program via stdin / out.
- Unable to interact with any devices.
- Nothing is visible on the network.
(I am building a grid-esque system. Running code may be hostile.)
Here is what I have so far ... - Create some users in advance, grid00-grid99. Give each disk / memory / CPU quota as configured.
To start the process ...
- Select an unused gridxx user.
- Create a folder inside the user's home folder.
- Hard link / bin, / usr, etc. in this folder.
- Create new folders / home / gridxx and / tmp in this folder.
- Copy to program files.
- Switch to gridxx user.
- chroot to a new folder.
- Launch a new process.
Did I miss something?
Many thanks.
source share