Domanda

In a .NET web site I need to get code submitted by users, compile it and execute it. But I need code to be executed in an isolated environment so that no malicious code can harm my system (for instance, no Directory.Delete("C:\Windows") should be ever executed).

Is it possible to execute code in a kind of chroot environment?

È stato utile?

Soluzione

You can compile and run the code in a sandbox. This is a newly created AppDomain with restricted permissions.

Altri suggerimenti

You can take a look at AppDomains. It's an isolated environment where applications execute. Take a look.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top