Where can I find out about permissions in the .NET Framework?

I would like to review an overview of each resolution defined by the .NET environment and what possible security holes open, allowing an untrusted assembly to access each resolution.

I would also like to know what specific permissions are allowed in the Silverlight application on the Internet, which seems like a good starting point for running builds in the sandbox.

Also, how do I configure a new AppDomain with the necessary permissions?

+4
source share
1 answer

This may not be the best answer, but I try. You can check security permissions as a starting point and from there access rights to the code can be of interest.

As with any form of defense, you must make the attack surface as small as possible. This means that you should not worry about all possible permission attacks, but, by default, reject all permissions. You will only allow the minimum necessary permissions required to run the application. If you have a small set of permissions, you can ask a narrower question.

To configure AppDomain, you can define PermissionSet and Evidence security settings before creating a new domain. Once a domain is created, it is theoretically impossible to escalate these privileges.

var setup = new AppDomainSetup { ApplicationBase = Path.GetDirectoryName(platform.Location) }; PermissionSet permissionSet = new PermissionSet(); permissionSet.AddPermission( new FileIOPermission(FileIOPermissionAccess.Read | FileIOPermissionAccess.PathDiscovery, Path.GetDirectoryName(platform.Location))); permissionSet.AddPermission( new SecurityPermission(SecurityPermissionFlag.Execution)); var sandbox = AppDomain.CreateDomain(name, null, setup, permissionSet); 

The code taken from here , the evidence-based security model , and Creating an AppDomain with limited rights may also interest you.

+2
source

Source: https://habr.com/ru/post/1388841/


All Articles