billpg
billpg

Reputation: 3293

How to launch a process on Linux with highly restricted privileges?

I'd like to (from code) launch a process with highly restricted privileges.

(I'm building a grid-esque system. The launched code may be hostile.)

Here's what I've got so far... - In advance, create some users, grid00-grid99. Give each one disk/memory/CPU quota as configured.

To launch a process...

Have I missed anything?

Many thanks.

Upvotes: 4

Views: 580

Answers (3)

Mark Wagner
Mark Wagner

Reputation: 111

You should be able to accomplish that with ulimit, chroot, disk quotas, and a firewall. Limiting all forms of "talking" (IPC) is hard. In the end you may want to go with a set of virtual machines.

Upvotes: 1

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798576

The standard resource usage limits (via ulimit) can handle the first three, and SELinux can handle the other three. Simply create a new domain for the application, assign the proper permissions, and away you go (but not it).

Upvotes: 4

Greg Hewgill
Greg Hewgill

Reputation: 992955

It sounds like you're looking for something like the FreeBSD jail feature. (That's for FreeBSD of course, but that page has links to similar technologies for Linux.)

Upvotes: 3

Related Questions