2017-06-14 25 views
0

對於如何管理ASP.NET中的SQL Server連接,似乎沒有明確的最佳做法。對於聽取以下解決方案的優缺點感興趣,以及其他未列出的解決方案。自IIS 7.5以來,我還沒有重新討論過,所以也許現在有更好的方法:針對IIS 8及更高版本的ASP.NET SQL數據庫連接安全性

  1. 使用虛擬應用程序池標識(虛擬帳戶)並將其添加爲SQL登錄。
  2. 應用程序池是否使用域帳戶作爲其身份。在SQL Server中設置與登錄名相同的帳戶。
  3. 讓asp.net應用程序用從註冊表收集的信息模擬一個域帳戶。應用程序池將使用虛擬應用程序池標識。在SQL Server中添加域帳戶作爲登錄名。

回答

1
1) pro: simple 
    con: if there are multiple web apps on the IIS server, they will all use the machine account to authenticate to a remote SQL instance. 

2) pro: can give each app pool a distinct domain identity 
    con: password management 

3) pro: none 
    con: insecure credential storage 
+0

您對託管服務帳戶有任何經驗嗎? – AnotherDeveloper

+0

不適用於IIS,但我的理解是,MSA或gMSA應該可以工作,並將刪除「密碼管理」問題。 –