I have an application in .NET 4 that uses MEF for extensibility. My main application has three assemblies: Host
, Application
and Contracts
.
Host
is the "boot-strapping" executable that creates the container and does the composition.
Application
contains the logic of my application, and more extension points for 3rd parties.
Contracts
contains the interfaces (and some helper classes) that are used in the extension points.
Therefore, someone developing a 3rd party application has to include a reference to Contracts
, but not to Application
.
I'm thinking that my security model should look like this:
Host
andApplication
should be SecurityCriticalContracts
should be SecuritySafeCritical- All 3rd party extensions should be SecurityTransparent
I think that 1. will be satisfied by default. I know that I can implement 2. with an assembly attribute. The question is, how do I enforce rule 3.? Does the operating system do this automatically by flagging all downloaded extensions as untrusted? Is it possible for a downloaded extension assembly to become fully trusted?