Ronen Ashkenazi Solutions Development Architect Microsoft Israel
Ronen Ashkenazi Solutions Development Architect Microsoft Israel
NET
Ronen Ashkenazi Solutions Development Architect Microsoft Israel [email protected]
23 January 2003
Agenda
Security Considerations Relationship Between IIS and ASP.NET Authentication Methods Security for Web Services
Security Considerations
Consider the following when designing an application: Security goals Security risks Authentication Authorization Securing data transmission Impersonation Delegation Operating system security Securing physical access Code access security
Access denied
IIS
Yes Launch ASP.NET application
User authenticated? No
ASP.NET impersonation enabled? ASP.NET application runs with local No machine identity Yes Access check OK? (e.g. NTFS) ASP.NET application No assumes client identity
ASP.NET
Yes
Access granted
Forms
Basic
Windows
Integrated
ASP.NET impersonation
Disabled Enabled
"Jeff"
"Jeff"
"Jeff"
10
Application Identities
ASP.NET application worker process (aspnet_wp.exe) executes under ASPNET account
11
Authentication Methods
Factors in Choosing an Authentication Method
12
13
Yes
No
Personalization required?
No
Anonymous
Users in Passport?
No
Yes
Passport
Yes Anonymous and cookies Anonymous and passport No Certificates Interactive user logon? Yes Secure logon? Yes Forms over SSL Certificates
Forms
No
14
No
Yes Basic Forms Digest Servers and clients Win2K?
Secure logon?
No
15
Authentication Methods
Anonymous Authentication
Basic Authentication
Digest Authentication Integrated Windows Authentication
Certificate Authentication
Passport Authentication Forms Authentication Using Cookies
16
17
Anonymous Authentication
Typical usage scenarios Consider Anonymous authentication when:
Caller name and/or password is not required for logon or business logic components The information you are protecting is considered "public"
18
Anonymous Authentication
Other considerations Good choice for sites containing personalized content only
For example, a news site only interested in user's zip code
19
Anonymous Authentication
Implementation Configure IIS for Anonymous authentication Configure the appropriate anonymous user account in IIS Configure the ASP.NET Web.config file
<!-- web.config file --> <system.web> <authentication mode="None" /> </system.web>
20
21
Basic Authentication
Typical usage scenarios Consider Basic authentication when you require:
Users to have Windows NT Domain or Active Directory accounts
22
Basic Authentication
Other considerations Delegation is possible using Basic authentication Combine Basic authentication with SSL to prevent passwords from being deciphered
23
Basic Authentication
Implementation Configure IIS for Basic authentication Configure user accounts to have "log on locally" enabled on Web server Configure the ASP.NET Web.config file
<!-- web.config file --> <system.web> <authentication mode="Windows" /> </system.web>
24
25
Digest Authentication
Typical usage scenarios Consider Digest authentication when:
The Web server is running Windows 2000 and users have Windows accounts stored in Active Directory All clients use either the .NET platform or Internet Explorer 5.0 or later Password encryption above that of Basic authentication is required Support of authentication over the Internet is required
Digest Authentication
Other considerations Security
Digest authentication is more secure than Basic authentication alone Less secure than Basic authentication with SSL Can also be combined with SSL
27
Digest Authentication
Implementation Configure IIS for Digest authentication Configure the ASP.NET Web.config file
<!-- web.config file --> <system.web> <authentication mode="Windows" /> </system.web>
28
29
30
31
Configure IIS for Integrated Windows authentication Configure the ASP.NET Web.config file
<!-- web.config file --> <system.web> <authentication mode="Windows" /> </system.web>
32
Domain Controller
33
Certificate Authentication
Typical usage scenarios Consider Certificate authentication when:
Data is considered very sensitive and you require a very secure solution Mutual authentication is required Third parties will manage the relationship between the server and the certificate holder Client interaction must be seamless; for example, automated B2B exchanges
34
Certificate Authentication
Other considerations Client certificates must be deployed to the client workstations Map certificates to:
Individual user accounts (one-to-one mapping) Any user from a single company (many-to-one mapping)
35
Certificate Authentication
Implementation Configure IIS for Certificate authentication Configure the ASP.NET Web.config file
<!-- web.config file --> <system.web> <authentication mode="Windows" /> </system.web>
36
Request: Welcome.aspx Response: Passport Sign In Request: Login.aspx + Cookie Response: Welcome.aspx Web Server
Microsoft Passport
37
Passport Authentication
Typical usage scenarios Consider Passport authentication when:
Your site will interact with other Passport-enabled sites Single sign-on capability is required External maintenance of user names and passwords is useful
38
Passport Authentication
Other considerations Requires registration with the Passport service and installation of the Passport SDK on the server Delegation is not possible on Windows 2000 Passport User ID (PUID) is an identity only
Implement code to map PUID to users in Active Directory or custom database
39
Passport Authentication
Implementation Install Passport SDK on server Register with Passport service Configure IIS for Anonymous authentication Configure the ASP.NET Web.config file
<!-- web.config file --> <system.web> <authentication mode="Passport" /> </system.web>
40
Client
Request: Welcome.aspx
Response: Login.aspx Request: Login.aspx + data Response: Welcome.aspx + Cookie
41
Forms Authentication
Typical usage scenarios Consider Forms authentication when:
User names and passwords are stored somewhere other than Windows accounts Your application runs over the Internet Support for all browsers and client operating systems is required
42
Forms Authentication
Other considerations Use SSL to secure passwords submitted via the logon page Set cookie expiration to avoid cookie theft and misuse SSL degrades performance, so consider separating logon and content servers Checking for the cookie is automatic in ASP.NET applications Use Forms authentication with Windows accounts as an alternative to Basic or Digest authentication
43
Forms Authentication
Implementation Create a logon page Create your custom account information lookup code Configure IIS for Anonymous authentication Configure the ASP.NET Web.config file, including the redirect URL for unauthenticated clients
<!-- web.config file --> <system.web> <authentication mode="Forms" <forms loginUrl="login.aspx"/> /> </system.web>
44
Additional Resources
Patterns & practices are Microsofts recommendations for architects, software developers, and IT professionals responsible for delivering and managing enterprise systems on the Microsoft Platform
45