1

So I have an ASP.net project hosted on Azure that runs.exe executables supplied by users.

Think of it like an online web terminal simulator.

I'm running the submitted exe's with Process.Start().

How do I specify access restrictions when running a user-provided executable.

For example, I want to sandbox the execution in a particular directory so that a malicious exe will not be able to see or copy my files in other locations.

And I want the exe process to time out after say 5 mins so it does not hold up my process pool.

Basically, I want to run the exe in a very controlled, secure environment and at the first sign of it doing anything fishy I kill it.

What'd be the best way to do this in an ASP.net project hosted on Azure?

2 Answers 2

0

This will explain how to use the AppDomain class to sandbox the application.
And this will explain how to load the executable into the AppDomain.
Please notice this will work for .NET executables only.

Good luck!

1
  • I mean it would only work for managed code that targets the CLR. If you have some exe that targets win32 api it would not be able load it this way. Apr 24, 2014 at 7:15
0

There is very little documentation on this but, in Windows Azure Websites (PAAS) your website located here :

d:\home\site\wwwroot

which actually mapping for :

C:\DWASFiles\Sites\[your website name]

you can't access any parent folder above that folder in C: partition in Azure Websites. But yes you have full access to other drives. (D:)

Windows Azure Websites is a managed solution, so you will have less control over the deployment or access restrictions. For more fine grained control over the deployment\impose access restrictions I suggest adopting Windows Azure Virtual Machines\Web Roles.

Hope the above info helps !! Happy Coding.

1
  • it's hosted on Azure Web Sites, not sure if it's IAAS or PAAS.
    – igbgotiz
    Apr 24, 2014 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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