高度安全性的应用程式系统实作.ppt
《高度安全性的应用程式系统实作.ppt》由会员分享,可在线阅读,更多相关《高度安全性的应用程式系统实作.ppt(60页珍藏版)》请在三一文库上搜索。
1、高度安全性的應用程式系統實作,台灣微軟公司 研發處開發工具部 產品規劃經理 何銘哲,今日議程,範例實作架構簡介 .NET Framework 安全機制範例實作 驗證 (Authentication) .NET 的程式碼存取安全性 ASP.NET 中的驗證考量 授權 (Authorization ) 角色架構安全性 授權管理員 加密 (Cryptography) Web 應用程式安全機制範例實作 Web應用程式的安全性考量,範例實作架構簡介,範例實作架構 那裡要驗證?,Intranet,Internet,Web Form,Authentication,Smart Client,APP Serve
2、r,SQL Server,Web Server,ASP.NET Code Access Security,範例實作架構 何時需要授權?,今日議程,範例實作架構簡介 .NET Framework 安全機制範例實作 驗證 (Authentication) .NET 的程式碼存取安全性 ASP.NET 中的驗證考量 授權 (Authorization ) 角色架構安全性 授權管理員 加密 (Cryptography) Web 應用程式安全機制範例實作 Web應用程式的安全性考量,範例實作架構 程式碼存取安全性,什麼是程式碼存取安全性,控制程式碼要對保護資源存取或是執行特定作業的安全機制 由 CLR
3、的安全性系統查核來檢查呼叫堆疊中每個呼叫端授與的使用權限和要求的使用權限 (Stack Walk) 禁止低度受信任的程式碼呼叫高度受信任的程式碼進而使用它來執行未經授權的動作 可使用 Demand 及 Assert 來實作程式碼存取安全性語法,什麼是舉證 (Evidence)?,舉證 (Evidence) 是由應用程式組件的識別項及其出處資訊組成 .NET Framework 安全系統會根據舉證項目來設定其權限,什麼是安全性原則 (Policy)?,安全性原則控制程式碼存取資源的使用權限 (permission) 依據程式碼的 identity 及來源來決定可存取的項目有那些 (Evidenc
4、e based!) 程式碼的 identity 及來源由舉證項目所組成 安全性原則將各類型的舉證對應到不同的使用權限集合 (permission set) Nothing Execution Internet LocalIntranet Everything FullTrust Custom-defined,什麼是程式碼群組?,Cond: All Code PSet: Nothing,Cond: Site = A PSet: All Printer Access,Cond: Publisher=Microsoft PSet: Read:C:Microsoft,Cond: Zone=Intern
5、et PSet: Internet,Cond: Zone=MyComputer PSet: Execution,Cond: SN Key=25 98 PSet: Read:C:Adatum,Cond: SN Key = 9F AD Simple Name = Microsoft Money PSet: Read:C:Money,Cond: SN Key = 9F AD Simple Name = Microsoft.App PSet: Write:C:Microsoft,A hierarchy of code groups,Permission Grant,Evidence,Publisher
6、 = Microsoft Zone= Internet SNKey = 9F AD,Read C:Microsoft Read C:Money Write: C:Microsoft Internet,Publisher = Adatum Site = A SN Key=25 98,Execution Read:C:Adatum All Printer Access,什麼是安全性原則等級?,安全性原則可被使用在不同的層級上 來控制存取資料的權限: 企業 (Enterprise) 電腦 (Machine) 使用者 (User) Application domain 每一個原則層級中都含有一些程式碼
7、群組、使用權限集合,以及原則組件清,當超過一個安全性原則生效時: Permission grant is the intersection of permissions allowed at each policy level The least common permission set is applied Example:,判斷多個安全性原則等級,1. 使用 .NET Framework 組態工具修改安全性原則設定,今日議程,範例實作架構簡介 .NET Framework 安全機制範例實作 驗證 (Authentication) .NET 的程式碼存取安全性 ASP.NET 中的驗證考量
8、 授權 (Authorization ) 角色架構安全性 授權管理員 加密 (Cryptography) Web 應用程式安全機制範例實作 Web應用程式的安全性考量,範例實作架構 ASP.NET 的驗證,Windows 驗證,Client Computer,/ web.config file ,Forms 驗證,/ web.config file ,Anonymous,Passport 驗證,/ web.config file ,Anonymous,P,如何使用 Forms-Based 驗證,Configure IIS to use Anonymous access Set forms-ba
9、sed authentication in Web.config Set up authorization Create a logon page,1,2,3,4,設定 web.config,/ Web.config file ,如何建立 Logon 網頁,Import the System.Web.Security namespace Create a logon page that verifies and checks the credentials of a user and redirects if valid Read user credentials from a cookie
10、User.Identity.Name returns the value saved by FormsAuthentication.RedirectFromLoginPage,If (bValidCredentials) FormsAuthentication.RedirectFromLoginPage _ (strUserName, False) End If,2. 在 ASP.NET 中使用 Windows based 以及 Forms based 驗證,今日議程,範例實作架構簡介 .NET Framework 安全機制範例實作 驗證 (Authentication) .NET 的程式碼存
11、取安全性 ASP.NET 中的驗證考量 授權 (Authorization ) 角色架構安全性 授權管理員 加密 (Cryptography) Web 應用程式安全機制範例實作 Web應用程式的安全性考量,Intranet,Internet,Web Form,SQL Server,APP Server,Web Server,Smart Client,Windows Integrated Role-based security Authorization Manager,Authorization,範例實作架構 授權 -角色架構安全性,什麼是角色架構(Role-Based)安全性?,什麼是 Id
12、entity?,Identity 物件封裝有關使用者或驗證過的實體的資訊 Identity 在 .NET Framework 中可分為三大類: Windows Generic Custom Identity 類別均實作了 IIdentity interface Name (使用者名稱或 Windows 帳戶名稱) IsAuthenticated AuthenticationType (所支援的登入通訊協定),什麼是 Principal?,Principal 則是結合了 identity 及此 Identity 的角色 (Role) 所執行的安全性內容. .NET角色架構安全性支援了三種類型的p
13、rincipals : Windows principal Generic principal Custom principal All principal類別均實作了 IPrincipal interface,如何使用 WindowsIdentity 及 WindowsPrincipal 物件,/ Single validation WindowsIdentity myIdentity = WindowsIdentity.GetCurrent(); WindowsPrincipal myPrincipal = new WindowsPrincipal(myIdentity); / Repea
14、ted validation / 呼叫 AppDomain.SetPrincipalPolicy 方法 / 並將新的 PrincipalPolicy 列舉型別值傳遞給它 AppDomain.CurrentDomain.SetPrincipalPolicy( PrincipalPolicy.WindowsPrincipal); /使用 CurrentPrincipal 擷取目前 Windows 的當事人 WindowsPrincipal myPrincipal = (WindowsPrincipal) System.Threading.Thread.CurrentPrincipal;,如何使用
15、GenericIdentity及GenericPrincipal 物件,可用 GenericIdentity 及 GenericPrincipal 來建立獨立存在於 Windows之外的授權配置:,/ Create a generic identity GenericIdentity myIdentity = new GenericIdentity(“User1“); / Create a generic principal String myStringArray = “Manager“, “Teller“; GenericPrincipal myPrincipal = new Generi
16、cPrincipal(myIdentity, myStringArray); / Attach the generic principal to the thread System.Threading.Thread.CurrentPrincipal = myPrincipal;,檢查 Identity 以及群組的授權,/ Check identity / Assume a valid Principal is in myPrincipal if (String.Compare(myPrincipal.Identity.Name, “DOMAINFred“, true)=0) / Permit
17、access to some code / Check role membership / Assume a valid Principal is in myPrincipal if (myPrincipal.IsInRole(“BUILTINAdministrators“) / Permit access to some code ,3. 使用 Windows 及 Generic 物件來檢查 Role-Based 的授權,今日議程,範例實作架構簡介 .NET Framework 安全機制範例實作 驗證 (Authentication) .NET 的程式碼存取安全性 ASP.NET 中的驗證考
18、量 授權 (Authorization ) 角色架構安全性 授權管理員 加密 (Cryptography) Web 應用程式安全機制範例實作 Web應用程式的安全性考量,範例實作架構 授權 -授權管理員,授權管理員的概念,操作 (Operation) Low-level application work-unit expressed in code Procedure, function, method, LDAP or SQL query 工作 (Task) High-level application work-unit expressed in the UI Submit report,
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 高度 安全性 应用 程式 系统
链接地址:https://www.31doc.com/p-3163642.html