Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use 'Integrated Security=True' in a production environment?

Is it a bad practice to use Integrated Security=True on a production server in ASP.NET?

like image 399
user441365 Avatar asked Oct 18 '10 11:10

user441365


3 Answers

Nope - perfectly safe*

All you are doing is saying that you are going to use the credentials of (usually) the Windows user that the process is running under in order to authenticate with SQL Server (as opposed to supplying a username and password).

In fact in general using integrated security is considered more secure.

(*) Of course it always depends on your exact situation, but in the general case yes its fine.

like image 135
Justin Avatar answered Sep 28 '22 05:09

Justin


This can be a good thing or a bad thing depending on the account that IIS is using to run the web application.

In any case, there is a distinct advantage that the SQL user id and password does not appear in the connection string; always a good thing.

However, you need to carefully setup your production environment. I would suggest that you create a distinct user account for IIS to use to run the web application. That user account could be configured to have access to only the SQL resources required by your application. That would protect you from have other applications easily compromised in the event that your web application's security is compromised.

I've heard of programmers doing acrobatics where a SQL connection string with the user id and password is loaded at run-time from an encrypted resource :-)

like image 25
Vivian River Avatar answered Sep 28 '22 05:09

Vivian River


Answer to the title question:
You should not touch (less use) anything in production environment while you are having such questions or doubts!

Answer to body question:
SQL Server in production should not be enabled for SQL Server authentication at all

Update:
I am surprised to see that all answers use probabilistic "this depends", "in some cases", "more" possibilities.

like image 31