Turning Security On and Off
When code access security is disabled, all code access demands succeed. Disabling code access security makes the system vulnerable to attacks by malicious code such as viruses and worms. Turning off security gains some extra performance but should only be done when other security measures have been taken to help protect system security. Examples of other security precautions include disconnecting from public networks, physically securing computers, and so on.
**CAUTION **Turning off code access security is a computer-wide operation that terminates security checks for all managed code and for all users on the computer. Although the –list option shows that security is turned off, nothing else clearly indicates for other users that security has been turned off. If side-by-side versions of the common language runtime are installed, this command turns off security for every version of the runtime installed on the computer.
To turn off security
Type the following command at the command prompt:
caspol –security off
To turn on security
Type the following command at the command prompt:
caspol –security on
See Also
Configuring Security Policy Using the Code Access Security Policy Tool (Caspol.exe) | Resolving Security Policy Issues Using Caspol.exe | Security Policy Model | Code Access Security Policy Tool (Caspol.exe)