SQL 2000 security and impersonation
From Scott Guthrie
You can enable impersonation within ASP.NET by simply changing the <identity> section of either your web.config or machine.config configuration file.
In general, though, impersonation is a bad idea and can lead to a variety of other security and performance issues (which is why we turned it off specifically with asp.net). Specifically, it can cause the database to "leak" access to data to end-users on middle tier applications (ie: because a user has access to the data, they can bypass the webserver middle tier logic and access the sprocs/tables directly -- something that a lot of apps don't protect against).
Rather than use SQL authentication when connecting from ASP.NET to SQL Server, you should use native windows authentication -- but lock down access not to the identity of the calling user, but rather to that of the ASP.NET worker process identity of the running application. That way you can restrict access to only allow the application access to the data (not the end users using it). You also do not have to worry about the SQL authentication usernames/passwords ever being compromised and access in these scenarios -- since no username/password is ever stored in an unencrypted way.
Hope this helps,
- Scott
Thanks Scott, but my 2 cents on windows authentification. In the scenario of a Live server connected through a firewall to a SQL box, and if all the potentially unsecured services like the Netbios are disabled, is the windows authentication is still an option ?