28.12.2013 Views

Building Secure ASP.NET Applications - People Search Directory

Building Secure ASP.NET Applications - People Search Directory

Building Secure ASP.NET Applications - People Search Directory

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

viii<br />

Contents<br />

Passport Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169<br />

Custom Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170<br />

Process Identity for <strong>ASP</strong>.<strong>NET</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170<br />

Use a Least Privileged Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170<br />

Avoid Running as SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171<br />

Using the Default <strong>ASP</strong><strong>NET</strong> Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171<br />

Impersonation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173<br />

Impersonation and Local Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173<br />

Impersonation and Remote Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174<br />

Impersonation and Threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174<br />

Accessing System Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174<br />

Accessing the Event Log. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174<br />

Accessing the Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175<br />

Accessing COM Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175<br />

Apartment Model Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176<br />

Accessing Network Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177<br />

Using the <strong>ASP</strong>.<strong>NET</strong> Process Identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178<br />

Using a Serviced Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179<br />

Using the Anonymous Internet User Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180<br />

Using LogonUser and Impersonating a Specific Windows Identity . . . . . . . . . . . . . 182<br />

Using the Original Caller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182<br />

Accessing Files on a UNC File Share . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183<br />

Accessing Non-Windows Network Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183<br />

<strong>Secure</strong> Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184<br />

Storing Secrets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184<br />

Options for Storing Secrets in <strong>ASP</strong>.<strong>NET</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186<br />

Consider Storing Secrets in Files on Separate Logical Volumes . . . . . . . . . . . . . . . 186<br />

Securing Session and View State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187<br />

Securing View State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187<br />

Securing Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187<br />

Securing SQL Session State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187<br />

Web Farm Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189<br />

Session State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190<br />

DPAPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190<br />

Using Forms Authentication in a Web Farm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190<br />

The Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191<br />

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192<br />

Chapter 9<br />

Enterprise Services Security 195<br />

Security Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195<br />

Gatekeepers and Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197<br />

Use Server <strong>Applications</strong> for Increased Security . . . . . . . . . . . . . . . . . . . . . . . . . . 198<br />

Security for Server and Library <strong>Applications</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199<br />

Code Access Security Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!