Security in.NET Jørgen Thyme Microsoft Denmark. Topics & non-topics  Cryptography  App domains  Impersonation / delegation  Authentication  Authorization.

Slides:



Advertisements
Similar presentations
© 2003 School of Computing, University of Leeds SY32 Secure Computing, Lecture 17 Secure Coding in Java and.NET Part 2: Code Access Control.
Advertisements

.NET Framework Application Security Overview
Forms Authentication, Users, Roles, Membership Ventsislav Popov Crossroad Ltd.
Module 6: Configuring Windows XP Professional to Operate in a Microsoft Network.
DESIGNING A PUBLIC KEY INFRASTRUCTURE
Security and the.NET Framework. Code Access Security Enforces security policy on code  Regardless of user running the code  Regardless of whether the.
Microsoft ASP.NET Security Venkat Chilakala Support Professional Microsoft Corporation.
Code Access Security vs. Role-Based Security  RBS  Security identity attached to user accounts  Access to resources specified according to user’s group.
Security in.NET Framework Sergey Baidachni MCT, MCSD, MCDBA.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Chapter 13 – Site Security. Internet Information Server ASP.NET Applications.NET Framework Windows NT/2000 Operating System Forms Passport Windows Certificates.
Jonas Thomsen, Ph.d. student Computer Science University of Aarhus Best Practices and Techniques for Building Secure Microsoft.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 7 Configuring File Services in Windows Server 2008.
Understanding Active Directory
Role based Security in.NET By By Aasia Riasat Aasia RiasatCS-795.
Understanding Security Lesson 6. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding the System.Security Namespace Understand the.
.NET Code security including 4.0 & Tools Jon C. Arce
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. ASP.NET Authentication.
1 ASP.NET SECURITY Presenter: Van Nguyen. 2 Introduction Security is an integral part of any Web-based application. Understanding ASP.NET security will.
Edwin Sarmiento Microsoft MVP – Windows Server System Senior Systems Engineer/Database Administrator Fujitsu Asia Pte Ltd
Authentication and Authorization CS795/895. How.Net Security Works Users who log in to the application are granted a principal and an identity, based.
Author: Bill Buchanan. Work Schedule Author: Bill Buchanan.
Chapter 7: WORKING WITH GROUPS
1 Web services and security ---discuss different ways to enforce security Presenter: Han, Xue.
ArcGIS Server and Portal for ArcGIS An Introduction to Security
.NET Framework Danish Sami UG Lead.NetFoundry
Security in.NET. Objectives Security in.NET Basic concepts - permissions Using and Managing permissions Cryprography in.NET Administer.NET Security.
SharePoint Security Fundamentals Introduction to Claims-based Security Configuring Claims-based Security Development Opportunities.
Chapter 9: SHARING FILE SYSTEM RESOURCES1 CHAPTER OVERVIEW  Create and manage file system shares and work with share permissions.  Use NTFS file system.
.Net Security and performance
Dr. Mustafa Cem Kasapbaşı Security in ASP.NET. Determining Security Requirements Restricted File Types.
Efficient Deployment & Management of ASP.NET 2.0 Applications on IIS 6.0 Alexis Eller Program Manager Internet Information Services Microsoft Corporation.
Securing Your ASP.NET Application Presented by: Rob Bagby Developer Evangelist Microsoft ( )
SECURITY ISSUES. Introduction The.NET Framework includes a comprehensive set of security tools –Low-level classes and an overall framework –Managing code.
The.NET Runtime and IIS Presented by Chris Dickey – cdickey.net consulting
Code Access Security CS 795. Terminology--CLR Common Language Runtime: –The.NET Framework provides a runtime environment which runs the code and provides.
Module 11: Securing a Microsoft ASP.NET Web Application.
Slide 1 ASP Authentication There are basically three authentication modes Windows Passport Forms There are others through WCF You choose an authentication.
Section 11: Implementing Software Restriction Policies and AppLocker What Is a Software Restriction Policy? Creating a Software Restriction Policy Using.
System.Security.Policy namespace Chinmay Lokesh.NET Security CS 795 Summer 2010.
CS795.Net Impersonation… why & How? Presented by: Vijay Reddy Mara.
Presented By: Ahmed ALSUM PhD Student CS 895:.Net Security Old Dominion University College of Science Department of Computer Science.
Windows Role-Based Access Control Longhorn Update
ASP.Net Role-based Security Chapter 10 (Freeman and Jones) CS795/895.
MEMBERSHIP AND IDENTITY Active server pages (ASP.NET) 1 Chapter-4.
GUDURU PRAVEEN REDDY.NET IMPERSONATION. Contents Introduction Impersonation Enabled Impersonation Disabled Impersonation Class Libraries Impersonation.
System.Security.Permissions namespace By Venkata Krishna Date: Instructor 06/19/2007 Dr. Ravi Mukkamala.
1 Chapter Overview Managing Object and Container Permissions Locating and Moving Active Directory Objects Delegating Control Troubleshooting Active Directory.
IIS and.Net security -Vasudha Bhat. What is IIS? Why do we need IIS? Internet Information Services (IIS) is a Web server, its primary job is to accept.
DEV240 Fundamentals of Code Access Security Sebastian Lange Program Manager Common Language Runtime Microsoft Corporation.
Impersonation Bharat Kadia CS-795. What is Impersonation ? Dictionary-: To assume the character or appearance of someone ASP.NET-: Impersonation is the.
Security E-Learning Chapter 08. Security Control access to your web site –3 Techinques for Identifying users Giving users access to your site Securing.
Privilege Management Chapter 22.
Configuring and Deploying Web Applications Lesson 7.
Understanding Security
Active Directory. Computers in organizations Computers are linked together for communication and sharing of resources There is always a need to administer.
Autorisierung und rollenbasierte Sicherheit in.NET Anwendungen Jürgen Pfeifer Senior Architect Evangelist Developer & Platform Strategy Group Microsoft.
Windows Security -- Archana Galipalli. Agenda  Windows Security  Windows Security and CLR  Implementing Windows Security for IIS  Configuring Security.
Understanding.NET Framework Security David LeBlanc Microsoft Office.
4.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 12: Implementing Security.
Security. Agenda ASP.NET security basics AuthenticationAuthorization Security principals Forms authentication Membership service Login controls Role Management.
Customizing.NET Security Permissions Nageswari Vallabhaneni.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
Benjamin Day Role-based Security Stinks: Better Authorization in ASP.NET.
Agenda Introduction Security flow for a request Authentication
Subha Desikan CSE775 – Distributed Objects Spring 2003
Security mechanisms and vulnerabilities in .NET
Created by : Asst. Prof. Ashish Shah
Security & .NET 12/1/2018.
ASP.Net Security Framework
Presentation transcript:

Security in.NET Jørgen Thyme Microsoft Denmark

Topics & non-topics  Cryptography  App domains  Impersonation / delegation  Authentication  Authorization  Digital signatures  Code Access Security (Evidence Based)  Passport integration  Principal (role) Based Security  Specific implementations (ASP.NET, WinForms etc)

Security is TOP focus  Trustworthy Computing  “…for people to be as comfortable using devices powered by computers and software as they are today using a device that is powered by electricity…”  Get Secure – Stay Secure  More information  

Agenda  Code Access Security  Evidence Based Security  Role Based security  ASP.NET Security Overview  Isolated Storage

Code Access Security User/code interaction  Things happen when users use code Trusted user Trusted code Untrusted user Untrusted code Trusted user Untrusted code Untrusted user Trusted code ! !  Need to authorize both users & code  If mismatched, reduce authorization

Code Access Security  Code authorization for managed code  Fine-grained policy  Fine-grained permissions  Multiple levels of trust  Layer of security over O/S  Both security checks always apply  Policy driven based on code evidence  No runtime security decisions by users

Code Access Security Managed code in an OS process Windows® Operating System Native code process CLR Application Domain 2 Application Domain 1.NET Framework NativeCode calls Code

Code Access Security Verification  Security enforceable on well-behaved code  Code exempted only by permission  Code is verified to be memory type safe  only access objects it has references to  only use defined interfaces to objects  also, well-formed metadata and instructions  Verifiability is compiler code gen. issue  VB, C# (except ‘unsafe’) verifiable;  C++ is generally not verifiable

Code Access Security Default Security Policy  Default Security Policy is installed as part of the.NET Framework  Has default permissions for code access to protected system resources

Code Access Security Permissions  Permissions can be defined to limit access to system resources.  Use EnvironmentPermission class for environment variables access permission.  The constructor defines the level of permission (read, write,…)

Code Access Security Deny & Revert Deny  The Deny method of the permission class denies access to the associated resource  The RevertDeny method will cause the effects of any previous Deny to be cancelled

Built-in Permission Classes  DBDataPermission  PrintingPermission  DnsPermission  SocketPermission  WebPermission  UIPermission  SecurityPermission  RegistryPermission  FileIOPermission  PrincipalPermission  MessageQueuePermission  EnvironmentPermission  FileDialogPermission  IsolatedStoragePermission  ReflectionPermission  PublisherIdentityPermission  StrongNameIdentityPermissi on  ZoneIdentityPermission  SiteIdentityPermission  UrlIdentityPermission

Code Access Security Permission Sets  A group or collection of permissions  Manipulate a group of permissions with one method call

Code Access Security Security Exceptions  An exception of type SecurityException is thrown when code attempts to access a protected resource without having the needed permission

Code Access Security PermitOnly & RevertPermitOnly  Permissions may be granted by code using the PermitOnly method  More permissions may not be granted than is allowed by the current level of trust  The RevertPermitOnly method will cause the effects of any previous PermitOnly to be cancelled

Code Access Security Demand  Permissions may be demanded before accessing a protected resource using the Demand method  Only the calling components permissions are checked

calls Code Access Security Stack walk  Demand must be satisfied by all callers  Ensures all code in causal chain is authorized  Cannot exploit other code with more privilege Code B Code C Demand P B has P? A has P? calls Code A

Code Access Security Working with Assert  The Assert method can be used to limit the scope of the stack walk  Processing overhead decreased  May inadvertently result in weakened security CAUTION Use assertions carefully because they can open security holes and undermine the runtime's mechanism for enforcing security restrictions.

Code Access Security Working with Declarative Security  Code access security can be implemented through attributes  Available on the assembly, class or Method level  Stored as part of the assemblies meta data  Enables use of permview.exe

Demonstration Code Access Security Deny Demand Walking the Stack Declarative Security

Agenda  Code Access Security  Evidence Based Security  Role Based security  ASP.NET Security Overview  Isolated Storage

Evidence Based Security Evidence  The CLR examines evidence about code to determine if it is trustworthy  Evidence is presented by an assembly at load time  Location based or identity based  Origin of the assembly, assembly publisher, digital signature….

Evidence Based Security Code Groups  Assembly evidence is matched against a code group to gain permissions  A code group has 2 attributes  Membership condition  Permission set  An assembly can match more than one code group

Security Policy Evidence Based Security The policy system Code Load Evidence about Code Code originates from? Code signed by? etc…. Permission Grant Code Authorization Rules about what code to authorize based on evidence

Evidence Based Security Administration Tools  The.Net Framework configuration tool can be used to modify and manage security policy  Mscorcfg.msc - Management Console  The command-line tool caspol.exe can be used to modify and managed security policy

Evidence Based Security Policy Level Evaluation  Each policy level is evaluated by the CLR to determine an assemblies permissions or level of trust  The least amount of trust from the three policy levels is granted

Evidence Based Security Code Groups  Each policy level has a set of code groups  Code groups are related hierarchically  There must be at least one code group for each policy level  Once the CLR determines that a code group does not map to an assembly, no dependent code groups are examined

Code Access Security Policy levels  Multiple policy levels for administration  Enterprise: common policy for entire org.  Machine: policy for all users of a machine  User: policy specific to logged in user  Effective policy is the intersection of levels Enterprise policy Machine1 policy Machine2 policy User A User B User C User D

Evidence Based Security Code Group Evaluation  More than one code group within a policy level may map to the evidence of an assembly  A policy level has the combination (union) of all code group permissions that map to an assembly  The intersection of policy levels determines permissions granted

Demonstration Evidence Based Security Code Groups NET Framework Configuration Tool caspol.exe

Agenda  Code Access Security  Evidence Based Security  Role Based security  ASP.NET Security Overview  Isolated Storage

Role-Based Security  Applications use role-based security to enforce business rule constraints  Individuals are grouped into roles with varying levels of access .NET role-based security works by making user and role information available to the current thread  Role-based security checks are similar to code access security checks

 Identity is the combination of an entity’s name and the authentication scheme used to validate it  The Framework implements several Identity classes  WindowsIdentity: Identity = Windows user name  GenericIdentity: General purpose; extension point  FormsIdentity: Used by many ASP.NET applications  PassportIdentity: Microsoft’s single sign-on scheme namespace System.Security.Principal { interface IIdentity { string Name { get; } string AuthenticationType { get; } bool IsAuthenticated { get; } } } // example 9 Role Based Security Identity

 Principals are identifiable entities in a secure system  A Principal is the combination of an identity and a set of roles  The Framework implements two Principal classes  WindowsPrincipal: a Windows user and security token  GenericPrincipal: encapsulates a GenericIdentity; adds custom role information namespace System.Security.Principal { interface IPrincipal { IIdentity Identity { get; } bool IsInRole(string role); } } // examples 10, 11 Role Based Security Principal

 Principal-based security checks can be performed through the PrincipalPermission class  Demand() compares the requested permission against Thread.CurrentPrincipal  The PrincipalPermissionAttribute allows for declarative principal security Role Based Security Principals-based security

 ASP.NET can authenticate user credentials using any of the following methods  Windows Authentication: relies on IIS for authentication; ASP.NET typically impersonates the authenticated principal  Forms Authentication: unauthenticated requests are redirected to a login form; cookies are used to cache credentials  Passport Authentication: authentication is delegated to Microsoft Passport servers; Passport ticket is sent back to originating server and used for site access  No Authentication: everyone is allowed access ASP.NET Security Authentication

 ASP.NET configuration files have three sections that pertain to security  Authentication: identifies the authentication mode; provides additional resource information (such as the Forms authentication URL or the Passport redirection URL)  Authorization: specifies which users and roles are allowed or denied access; typically not used with Windows authentication since ACLs address the same problem  Identity: whether or not to use impersonation  Configuration files are arranged hierarchically to provide varying degrees of authorization ASP.NET Security Configuration

Demonstration ASP.NET Forms based authentication Using roles

Agenda  Code Access Security  Evidence Based Security  Role Based security  ASP.NET Security Overview  Isolated Storage

Isolated Storage Overview of Isolated Security  Allows a trusted assembly to store data on a client machine  Standard file IO operations are not used  Permission to access the local file system not required  Isolated storage handles the physical actual physical location of the data

Isolated Storage Store  A virtual file system  May have its own folder structure  Files may have data of almost any kind  User data or application state

Isolated Storage Store Scope  Data is kept in a “Store”  Stores are isolated by scope  Can be by assembly, domain, user…  Size may be limited by setting a quota

Demonstration Isolated storage Writing Reading Deleting

For More Information…  MSDN Web site at  msdn.microsoft.com  msdn.microsoft.com/net  Msdn.microsoft.com/security  Got Dot Net 