Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Access Security - Basics and Example

I was going through this link to understand CodeAccessSecurity: http://www.codeproject.com/KB/security/UB_CAS_NET.aspx

It's a great article but it left me with following questions:

  1. If you can demand and get whatever permissions you want, then any executable can get Full_Trust on machine. If permissions are already there, then why do we need to demand those?

  2. Code is executing on Server, so the permissions are on server not on client machine?

  3. Article takes an example of removing write permissions from an assembly to show security exception. Though in real world, System.IO assembly (or related classes) will take care of these permissions. So is there a real scenario where we will need CAS?

like image 311
user274915 Avatar asked Nov 06 '22 15:11

user274915


1 Answers

  1. The idea of "least privilege access" a very important Principal of secuirty. A hacker is going to make your application do something that it wasn't intended to do. Whatever rights the application has at the time of attack then the attacker will have thoughs same rights. You can't stop every attack against your application, so you need lower the impact of a possible attack as much as you can. This isn't bullet proof, but this significantly raises the bar. An attacker maybe able to chain a privilege escalation attack in his exploit.

  2. In most situations you can't control the actions of the client. In general you should assume that the attacker can control the client using a debugger or a using modified or rewritten client. This is especially true for web applications. You want to protect the server as much as possible, and adjusting permissions is a common way of doing that.

  3. Sorry, I can't answer this one without Google. But CAS is deprecated anyway.

like image 164
rook Avatar answered Nov 12 '22 11:11

rook