Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

We have a application which takes a C++, C, or Java file as input, executes it, and displays the output to the client. What are the best measures that can be taken so that no security related issues occur in the server in which program is executed. For example, the C++ program can open an fstream and create a custom file on our server

I know some practices like:

  1. Running it as normal user
  2. Writing our own sandbox scripts which do not allow system calls, etc.

Which is the best way to do this?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Compile, then execute as a dedicated user in a chroot environment that contains only the necessary libraries.

share|improve this answer
    
will try this thanks :-) –  harish.venkat Jan 14 '13 at 4:45

What about SELinux?

SELinux can potentially control which activities are allowed for each user, process and daemon, with very precise specifications

share|improve this answer

Run it on a decicated computer just for these tasks or in virtual.

share|improve this answer
    
dude i want to essentially protect the data in my application as well.I know I can create jailed environment inside my server and protect it or as you suggested run it on dedicated server but this protect the server from this application which leaves application to danger –  harish.venkat Jan 13 '13 at 19:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.