.NET Framework Security

for RuBoard

The .NET Framework default security policy is the culmination of the default policies of all four policy levels. Each policy level has a hard-coded default that is intended to provide a usable and secure environment.

All of the default policy levels are identical with reference to the permission set lists and assembly lists. The permission set lists contain all the named permission sets described earlier in the chapter and no other permission sets. The assembly lists contain the following assemblies:

In addition, mscorlib.dll is always considered a fully trusted policy assembly, even though it is not in the list.

With regard to the code group hierarchy, the Enterprise and User default policy levels are simple and identical. The Machine policy level has a larger, more complex hierarchy that really does the work of making default policy "locked down." There is no default AppDomain policy level. If it isn't set by an application, it doesn't exist.

Enterprise and User Policy

The code group hierarchies of these two policy levels contain a single node ” the root code group. This root code group is a UnionCodeGroup with an AllMembershipCondition and the FullTrust permission set. Hence, all code matches the root code group and is granted all permissions that implement the IUnrestricted interface.

The most important point to understand with these policy levels is that when their grant sets are intersected with some permission set P, the result is P (minus any identity permissions). That is why only one of the four policy levels needs to have a more complex default. Anything restricted in that policy level will define the total default restrictions.

Machine Policy

The machine policy's code group hierarchy is primarily based on the IE security zone model. Figure 8.4 shows a graphical representation of the machine policy level's code group hierarchy. No code groups in default security policy have any PolicyStatementAttribute s. Remember that these are the defaults for SP1. The default code group hierarchy of the original release is different.

Figure 8.4. The default code group hierarchy for the Machine policy level.

The root of the code group matches all code, but grants no permissions. Below that lies a code group for every security zone. All executing code falls into only one zone, and is thus given that zone's permissions. The following is some rationale behind the decisions made in constructing the default machine code group hierarchy:

for RuBoard

Категории