How to restrict .Net build to run on specific machines

We have a server application that we want to restrict non-users from launching it from other computers or even double clicking from any resource.

However, it should be easy for a developer to run it on their blocks.

What are the different ways to enforce this policy?

0


a source to share


3 answers


One idea: you can use a registry key that must be present to run.

Other: would need to install X509 certificate in keystore to run



Other: use System.Security.Permissions and restrict the action to a set of users or group.

and etc.

+2


a source


There are several ways to control access to assemblies.

We protect our builds on a license basis, so only licensed workstations can run the build.

We allow developers to run debug builds without checking. Of course, we keep tight control over the debug builds. you can put additional checks in the debug build for more security if needed. Or issue licenses to developers.



For our debug builds, we add the license to the debug code wrapped in "#IF DEBUG" to make sure it is not compiled into a release build.

I am not saying this is the best way, but this is the method we are using.

+2


a source


I'm assuming you are looking for a simple fail-safe, not airborne access control ...

Place the machine name in the config file and compare it with the machine name when starting the application. This way you can't run it elsewhere by mistake, and it's easy enough to change when developing or moving the app.

+2


a source







All Articles