MSDN Library

.NET Framework Documentation

System.Security.SecurityZone Enum

Represents the trust zone assigned to code.

This enumeration is used to identify the security zone from which code originates. These zones are associated with different levels of trust, allowing the .NET Framework to enforce security policies. Common zones include My Computer, Local Intranet, Trusted Sites, Internet, and Restricted Sites.

Syntax
public enum SecurityZone
Members

Members

  • AllZones Field

    : Represents all security zones. This value is used for operations that apply to all zones.

  • Everything Field

    : Equivalent to AllZones.

  • Internet Field

    : Represents the Internet zone, typically associated with the lowest level of trust.

  • LocalMachine Field

    : Represents the local computer zone, typically associated with the highest level of trust.

  • MyComputer Field

    : Represents the My Computer zone, which is synonymous with the LocalMachine zone.

  • NoZone Field

    : Represents an unknown or undefined security zone.

  • TrustedSites Field

    : Represents the Trusted Sites zone, which has a higher level of trust than the Internet zone.

  • Untrusted Field

    : Represents an untrusted zone.

  • InternetZone Field

    : Represents the Internet zone. This is an alias for Internet.

  • LocalIntranetZone Field

    : Represents the Local Intranet zone, which has a moderate level of trust.

Remarks

The SecurityZone enumeration is a fundamental part of the .NET Framework's Code Access Security (CAS) model. Administrators and developers can configure security policies based on the zone from which code is executed. This allows for granular control over what operations code is permitted to perform.

For instance, code originating from the Internet zone might have very limited permissions, while code running from LocalMachine would have significantly more privileges. The System.Security.Policy.Zone class can be used to obtain the security zone for a given evidence. Developers can also programmatically check the current zone of execution using classes within the System.Security.Policy namespace.

Requirements

Namespace: System.Security

Assembly: mscorlib (in mscorlib.dll)

Framework Versions: .NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, 4.7, 4.8; .NET Standard 2.0; .NET Core 2.0

See Also