We have a internal asp.net website running on IIS with Windows Security. From what I understand (and observe) this means that each thread runs using the credentials of the user who connects to the website.
The website connects to a SQL Server 2014 database. We use a SQL Server username and password to make the connection. Having a look at MSDN I see that using SQL Server authentication is not recommended.
The password for the SQL Server account logging on. Not recommended. To maintain a high level of security, we strongly recommend that you use the Integrated Security or Trusted_Connection keyword instead. SqlCredential is a more secure way to specify credentials for a connection that uses SQL Server authentication.
Since removing Windows Security for the website is not an option, the only options I see to follow the MSDN advice is:
Ignore MS advice and keep using SQL Authentication as we are
Give every website user the same access to SQL Server as the current SQL Server credential has. This means if any user connects directly to the server they can run their own queries instead of being limited to what we have coded. Maybe some sort of firewall rule could fix this. The business is not a fan of this idea (I'm not either)
Give every user connect access (no other permissions) and use an application role to provide permissions when the user connects through the website.
Every time a connection is made to SQL Server, it should be done on a thread that impersonates a domain user who has access.
None of these options sounds any better than using a SQL Server username and password.
What is the recommended way to connect to the database?