简体   繁体   English

Team Foundation Server - 应用程序层到数据层:身份验证,模拟和授权

[英]Team Foundation Server - Application Tier to Data Tier: Authentication, Impersonation and Authorisation

According to the Team Foundation Server Architecture document , in the Groups and Permissions section: 根据Team Foundation Server Architecture文档 ,在“ 组和权限”部分中:

Team Foundation Server has its own set of default groups and permissions that you can set at the project, collection, or server level. Team Foundation Server具有自己的一组默认组和权限,您可以在项目,集合或服务器级别设置这些组和权限。 You can create custom groups and customize permissions at group and individual levels. 您可以在组和各个级别创建自定义组和自定义权限。 However, users or groups that you add to Team Foundation Server are not automatically added to two components on which Team Foundation Server can depend: SharePoint Products and Reporting Services . 但是,添加到Team Foundation Server的用户或组不会自动添加到Team Foundation Server可依赖的两个组件:SharePoint产品和Reporting Services If your deployment uses these programs, you must add users and groups to them and grant the appropriate permissions before those users or groups will function correctly across all operations in Team Foundation Server. 如果部署使用这些程序,则必须向其添加用户和组,并在这些用户或组在Team Foundation Server中的所有操作中正常运行之前授予相应的权限。

Authentication and Impersonation: 身份验证和假冒:

Please support your answer with evidence by way of profiler traces, configuration snippets, or an authoritive description from Microsoft articles (personally, I couldn't find any). 请通过分析器跟踪,配置片段或Microsoft文章的授权说明(个人,我找不到任何内容)来证明您的答案。

  1. Is integrated security enabled from the Application Tier through to the underlying Sql Server? 是否从应用程序层到底层Sql Server启用了集成安全性?
  2. If integrated security is enabled, is impersonation enabled (assuming a standard configuration) to impersonate the identity of the user within the Application Tier? 如果启用了集成安全性,是否启用模拟(假设标准配置)来模拟应用程序层中用户的身份?
  3. If impersonation is enabled, is the Application Tier responsible for managing the security of the underlying databases? 如果启用了模拟,应用程序层是否负责管理基础数据库的安全性?
  4. If impersonation is not enabled in the Application Tier, is all interaction with the Data Tier done by the TFSService identity? 如果在应用程序层中未启用模拟,那么是否所有与数据层的交互都由TFSService标识完成?

Authorisation: 授权:

  1. To the best of available knowledge, is authorisation evaluated in the Data Tier or in the Application Tier (ie the value of Project.HasWorkItemReadRightsRecursive )? 根据可用知识,是在数据层或应用程序层中评估的授权(即Project.HasWorkItemReadRightsRecursive的值)?

Why: 为什么:

I have programmed a solution in which I am passing integrated security from the client's process, through a WCF web service and into Sql Server using impersonation, from where I can evaluate object authorisation and role membership using Transact-Sql. 我已经编写了一个解决方案,我将客户端进程中的集成安全性通过WCF Web服务传递到使用模拟的Sql Server,从中我可以使用Transact-Sql评估对象授权和角色成员资格。 We are discussing the advantages and disadvantages of this as an appropriate pattern and decided to investigate how TFS handles this. 我们正在讨论这种优缺点作为一种适当的模式,并决定研究TFS如何处理这种情况。

If you have any broader comments on object level authorisation within a database driven application, please feel free to share them. 如果您对数据库驱动的应用程序中的对象级别授权有任何更广泛的意见,请随时分享它们。

Rabid, 狂犬病

Most of what you're looking for can be found in the web.config for TFS web services and by looking at the security of your TFS databases. 您正在寻找的大部分内容可以在TFS Web服务的web.config中找到,也可以查看TFS数据库的安全性。

1. Is integrated security enabled from the Application Tier through to the underlying Sql Server? 1.从应用程序层到底层Sql Server是否启用了集成安全性?

Yes. 是。 The web.config is located here on your application tier server: C:\\Program Files\\Microsoft Team Foundation Server 2010\\Application Tier\\Web Services web.config位于应用程序层服务器上:C:\\ Program Files \\ Microsoft Team Foundation Server 2010 \\ Application Tier \\ Web Services

Within there you can find the connection string for the Tfs_Configuration database. 在那里,您可以找到Tfs_Configuration数据库的连接字符串。 This quite explicitly shows that it uses Integrated Security. 这非常明确地表明它使用集成安全性。

<add key="applicationDatabase" value="Data Source=YOURSQLSERVER\YOURSQLINSTANCE;Initial Catalog=Tfs_Configuration;Integrated Security=True;" />

2. If integrated security is enabled, is impersonation enabled (assuming a standard configuration) to impersonate the identity of the user within the Application Tier? 2.如果启用了集成安全性,是否启用模拟(假设使用标准配置)来模拟应用程序层中用户的身份?

No. When TFS connects to the database it uses the credentials within the Microsoft Team Foundation Server Application Pool, not the credentials of the calling end-user. 当TFS连接到数据库时,它使用Microsoft Team Foundation Server应用程序池中的凭据,而不是调用最终用户的凭据。 Again from the TFS services web.config... 再次从TFS服务web.config ...

    <!-- Disable Identity Impersonation -->
    <identity impersonate="false"/>

This is further evidenced by the fact that your end-users of TFS do not have any level of access whatsoever to the underlying Tfs_Configuration database. 事实上,TFS的最终用户对底层Tfs_Configuration数据库没有任何访问级别,这进一步证明了这一点。 (or the project collection databases, for that matter) (或项目集合数据库,就此而言)

If you open your Tfs_Configuration database in SQL Management Studio and look at the Security folder you will only see users listed who have been added as "Administration Console Users" in the TFS Administration Console. 如果在SQL Management Studio中打开Tfs_Configuration数据库并查看Security文件夹,则只会在TFS管理控制台中看到列出的已添加为“管理控制台用户”的用户。

3. If impersonation is enabled, is the Application Tier responsible for managing the security of the underlying databases? 3.如果启用了模拟,应用程序层是否负责管理基础数据库的安全性?

N/A due to the answer to question #2. 由于对问题#2的回答,不适用。 However, the answer is "yes." 但是,答案是肯定的。 When you initially configure TFS (assuming you use the Microsoft installation guide, which you should be using: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=24337 ) you will setup your "TFSSERVICE" account with the sysadmin or *db_creator* security role on your SQL server. 当您最初配置TFS时(假设您使用的是Microsoft安装指南,您应该使用它: http//www.microsoft.com/download/en/details.aspx ?displaylang = en&id = 24337),您将设置“TFSSERVICE” “在SQL Server上使用sysadmin或* db_creator *安全角色的帐户。 This allows the TFS application tier to manage the security of its own databases. 这允许TFS应用程序层管理其自己的数据库的安全性。 When you add a new "Admin Console User" it will grant that user permissions on the TFS databases. 添加新的“管理控制台用户”时,它将授予该用户对TFS数据库的权限。 You can see this yourself by looking at the Security folder for the Tfs_Configuration database before and after adding a user to the admin console. 在将用户添加到管理控制台之前和之后,您可以通过查看Tfs_Configuration数据库的Security文件夹来自行查看。

Additionally, if you open the TFS Admin Console as a user who does NOT have access to the underlying databases the console will load with a bunch of friendly "User does not have database access" error messages instead of populating the data you would expect to see in the admin console. 此外,如果您以无权访问底层数据库的用户身份打开TFS管理控制台,则控制台将加载一堆友好的“用户无权访问数据库”错误消息,而不是填充您希望看到的数据在管理控制台中。

4. If impersonation is not enabled in the Application Tier, is all interaction with the Data Tier done by the TFSService identity? 4.如果应用程序层中未启用模拟,那么TFSService标识是否完成了与数据层的所有交互?

Yes. 是。 I think everything stated above pretty clearly demonstrates this. 我认为上面所说的一切都清楚地证明了这一点 Even the application pool for TFS Web Access runs under the TFSSERVICE identity. 甚至TFS Web Access的应用程序池也在TFSSERVICE标识下运行。 (this is all out-of-the-box, of course... you can always explicitly grant access to a TFS database and start monkeying around with it yourself... you'll void your support contract with MS by doing so though :D) (这是开箱即用的,当然......你总是可以明确地授予对TFS数据库的访问权限,并开始用它来自行解决...你这样做会使你的MS支持合同无效:d)

Authorization Question: To the best of available knowledge, is authorisation evaluated in the Data Tier or in the Application Tier (ie the value of Project.HasWorkItemReadRightsRecursive) 授权问题:根据可用知识,在数据层或应用程序层中评估授权(即Project.HasWorkItemReadRightsRecursive的值)

This authorization (Project.HasWorkItemReadRightsRecursive) is evaluated within the Application Tier. 此授权(Project.HasWorkItemReadRightsRecursive)在Application Tier中进行评估。 This is true of all work items and version control items. 所有工作项和版本控制项都是如此。 Why? 为什么? Because this is part of TFS' internal security model. 因为这是TFS内部安全模型的一部分。 There is an extensive set of permissions that TFS maintains for its version control and work item objects which are completely decoupled from the underlying data layer. TFS为其版本控制和工作项对象维护了一组广泛的权限,这些权限与底层数据层完全分离。 Having access to read\\write to a specific work item or file under version control does not mean that you have access to the SQL tables which contain the data for those version control or work item objects. 在版本控制下访问对特定工作项或文件的读/写并不意味着您可以访问包含这些版本控制或工作项对象的数据的SQL表。

It's all more or less spelled out here. 这或多或少都在这里拼写出来。 http://msdn.microsoft.com/en-us/library/ms252587(v=vs.100).aspx There are server level permissions, collection level permissions, team project level permissions, build level permissions, work item permissions, and version control permissions. http://msdn.microsoft.com/en-us/library/ms252587(v=vs.100).aspx有服务器级权限,集合级权限,团队项目级权限,构建级权限,工作项权限和版本控制权限。 This entire permissions system is orchestrated within the TFS application tier without any knowledge of the underlying database schema or database security. 整个权限系统在TFS应用程序层中编排,而不了解底层数据库架构或数据库安全性。

To echo the point which you opened your question with 回应你打开问题的观点

However, users or groups that you add to Team Foundation Server are not automatically added to two components on which Team Foundation Server can depend: SharePoint Products and Reporting Services. 但是,添加到Team Foundation Server的用户或组不会自动添加到Team Foundation Server可依赖的两个组件:SharePoint产品和Reporting Services。

Why is this? 为什么是这样? Because SharePoint and Reporting Services both use a similar pattern where there is an extensive security system which is managed at the application tier but only one (or maybe a few) accounts have actual access to the SQL databases. 由于SharePoint和Reporting Services都使用类似的模式,其中存在广泛的安全系统,该系统在应用程序层进行管理,但只有一个(或几个)帐户可以实际访问SQL数据库。 Ie You can set Content Viewer, Content Manager, etc permissions in SSRS and you can set Contributor, Site Collection Admin, Farm Admin, etc permissions within SharePoint. 即您可以在SSRS中设置Content Viewer,Content Manager等权限,并且可以在SharePoint中设置Contributor,Site Collection Admin,Farm Admin等权限。 Your SSRS service account or SharePoint farm admin account will be the only accounts which have SQL database access. 您的SSRS服务帐户或SharePoint场管理员帐户将是唯一具有SQL数据库访问权限的帐户。

In summary 综上所述

If the application you're developing is taking the actual client user's credentials and passing them all the way down to the database you could be opening yourself up to a major security problem. 如果您正在开发的应用程序正在获取实际客户端用户的凭据并将它们一直传递到数据库,那么您可能会遇到严重的安全问题。 Since those users' accounts will have direct SQL access there's nothing stopping them from opening up SQL Management Studio, connecting to the database, and doing whatever they have access to. 由于这些用户的帐户将具有直接的SQL访问权限,因此无法阻止他们打开SQL Management Studio,连接到数据库以及执行他们有权访问的任何内容。 Maybe your users aren't savvy enough but why take the chance?? 也许你的用户不够精明,但为什么要冒这个机会?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM