Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Code Access Security in .NET

Tags:

.net

What is CAS (Code Access Security) in .NET, and how to achieve it? What are the benefits of using it?

like image 368
tush1r Avatar asked Apr 10 '09 15:04

tush1r


1 Answers

In short, CAS is the security sandbox for .NET. Local apps typically have full trust which means they can do anything. .NET apps that are hosted in the browser can't do much. In between, just about any security setting can be fine-tuned using CAS.

It's benefits: great control over what .NET apps can do, even within the context of the logged in user. The best part about it, IMO, is that security checks walk the stack, so that even if some code has permission to do something, if that method was called by another program that doesn't have permission to do something, that request will fail (unless special measures are taken).

The downsides: it's a pretty complex beast to learn. Lots of gotchas. But hopefully the links I've provided will lead you to learn whatever details you need to know.

like image 153
Andrew Arnott Avatar answered Sep 28 '22 01:09

Andrew Arnott