开发者

About SQL Server security

开发者 https://www.devze.com 2022-12-30 07:41 出处:网络
I have an ASP.NET application which runs under the Classic .NET AppPool in IIS. I have a report to render from my website.

I have an ASP.NET application which runs under the Classic .NET AppPool in IIS.

I have a report to render from my website.

The p开发者_如何学Croblem is SQL Server keeps telling me that it failed to create a connection to the datasource, because login failed for user IUSR.

After adding that user directly to the databse I could get the report to work, but I'm concerned about security.

By doing that, am I opening my specified databases to all websites hosted on IIS? Or is that account identity-specific?


A better way to so it would be to change the application pool identity to a specific user and add that user to the database, otherwise you are giving the standard IIS anonymous user access to the database.


You're using Windows Authentication. You could use Sql Server authentication so you're independent of the current user of your client application. You should have a sql server user created with just the necessary credentials for your application and use it like this on the connection string.

Data Source=SERVER;Initial Catalog=DATABASE;Persist Security Info=True;User ID=USER;Password=PASSWORD

0

精彩评论

暂无评论...
验证码 换一张
取 消