Friday, 23 November 2007

Chapter 11, lesson 1: Understanding Code Access Security.

Code Access Security (CAS) - enables users to control permissions that individual apps have. Developers thus have to create apps that work with restricted permissions.

Can also use CAS as a developer - by restricting which calers can use your code + forcibly limiting your app to a restricted permission set.

---
  • What is CAS - a security system that aloows administrators + developers to control application authorization.
  • can control auth to following resources: file sys., registry, printers, event logs, sending web requests, whether app can make DNS requests.
  • CAS can only be applied to managed apps - ones that use the .NF runtime. Unmanaged apps limitied only by O.Ss role-based security (RBS).
  • CAS identifies and assigns permissions to apps rather than to people.
  • CAS IDs assembiles ~ evidence.
  • evidence - location where assm is stored, a hash of assm code, assm signature.
  • An assembly's evidence determine which code group it belongs to.
  • code groups - grant an assm a permission set.
  • evidence - info that runtime gathers about an assm to determine which code group it belongs to e.g. folder or web site that it runs from, digitial signatures. It's info that provs identity and describes an assm as deserving a certain level of trust.
  • types of evidence - appn dir (in whcih assm resides), hash of assm, publisher (their digitial signature thus IDs software developer), Site (from which assm was downloaded), Strong Name, URL (from where downloaded).
  • host evidence - describes assm origin.
  • assm evidence - custom user or develoer-provided evidence.
  • Permission - a CAS access control entry e.g. File Dialog - determines whether an assm can prompt user with the Open dialog box. There exist 19 permissions. You can add custom permissions.
  • Permission set - CAS ACL - a group of permissions that apply to apps falling under a particular group. (e.g. LocalIntranet Zone contains more permissions that Internet). .NF has 7 default permission sets.
  • code groups - authorization devices that associate assm with permission sets. Membership to a code group is not set manually - it is determined by the evidence that you specify as the code group's membership condition.
  • Internet_Zone code group - membership condition - host presents Zone evidence + Zone evidence IDs assm as being in Internet zone.
  • A code group must be associated with a permission set.
  • You can only specify only a single type of evidence and a single permission set for a code group.
  • An assm can be a member of mult. code groups.
  • union of permsiions - assm will receive perms as union of all code grps.
  • security policy - a logical grouping of code groups and permission sets.
  • security policy - allow administrators to configure CAS settings at 4 lvls: Enterprise, Machine, User, App Domain.
  • Enterprise Security Policy - configured ~ Active directory svc.
  • Intersection of the permission sets - rutime evalutes Enterprise, Machine & User levels separately, and grants assm minimum set of perms.
  • .NF Configuration Tool - to grant/restrict an assm perms: 1. Evaluate assm to determine which code grps it is a member of, 2. eval assm to det. perms it will be assigned, 3. adding new perm sets, 4. adding mew code groups, 5. increasing an assm's trust.
  • CAS wokrs on top of OS security - if CAS grants an assm access to write to a folder but the user running the assm does not have that perm, then assm cannot write.
  • CAS Policy Tool - caspol.exe - to examine/modify machine/user/enterprise-lvl code access policies.

1 comment:

Anonymous said...

Great work.