2

I would like the user to specify a list of commands for gathering statistics about the system that he/she is interested in. I would run these under various scenarios automatically. However I'm not quite sure how to sandbox the commands safely.

One option would be to carry a whitelist of allowed commands, but it would need to be maintained. I'd like to be really flexible such as, is it possible to run an arbitrary command in Linux with read only file permissions?

What are your ideas?

1
  • You could have a user who owns no files and can't sudo, I suppose
    – Phoshi
    Commented Jun 29, 2010 at 20:28

2 Answers 2

3

Under Gentoo there is the sandbox tool that allows running programs in a sandbox with only read access to the outside. I built it successfully under Ubuntu, too. The sources can be downloaded here.

2
2

SELinux will allow you to do this. You can either put the executables into a restricted domain, or you can create a new role with limited permissions.

1
  • This is exactly what I'm looking for, unfortunately we aren't running SELinux.
    – kalaxy
    Commented Jul 12, 2010 at 14:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .