简体   繁体   English

IIS 7.5集成身份验证NTFS文件夹权限,没有模拟

[英]IIS 7.5 Integrated Authentication NTFS Folder Permissions without Impersonation

This is a similar question to many that I have seen before but I have not found a clear answer yet so I will try to be very specific here to avoid duplication. 这是我之前见过的许多类似的问题,但我还没有找到一个明确的答案,所以我将在这里尝试非常具体,以避免重复。

We are running IIS7.5 on 2008R2 with only windows authentication turned on (no anonymous) and no impersonation. 我们在2008R2上运行IIS7.5, 打开了Windows身份验证(没有匿名),没有模拟。 There is a network account specified for the application pool user. 存在为应用程序池用户指定的网络帐户。

When I check the WindowsIdentity.GetCurrent() of the currently executing page I get the expected (App-pool) user based on our configuration. 当我检查当前正在执行的页面的WindowsIdentity.GetCurrent()时,我会根据我们的配置获得预期的(App-pool)用户。

http://www.mikeobrien.net/blog/identities-for-different-iis7/ http://www.mikeobrien.net/blog/identities-for-different-iis7/

This matches the expectations nicely. 这很符合预期。 However, it appears that NTFS folder permissions on our application are being checked against the identity of the authenticated user. 但是,似乎正在根据经过身份验证的用户的身份检查我们的应用程序上的NTFS文件夹权限。

This seems to contradict most of the documentation I have found. 这似乎与我发现的大多数文档相矛盾。 The above link as well as 以上链接以及

http://msdn.microsoft.com/en-us/library/kwzs111e(v=vs.100).aspx http://msdn.microsoft.com/en-us/library/kwzs111e(v=vs.100).aspx

http://msdn.microsoft.com/en-us/library/3yfs7yc7(v=vs.100).aspx http://msdn.microsoft.com/en-us/library/3yfs7yc7(v=vs.100).aspx

http://msdn.microsoft.com/en-us/library/gg703322%28v=vs.98%29.aspx http://msdn.microsoft.com/en-us/library/gg703322%28v=vs.98%29.aspx

How is IIS checking the authenticated user's identity in folder ACLs when .Net is clearly indicating that the WindowsIdentity in play is that of the App-Pool? 当.Net清楚地表明正在播放的WindowsIdentity是App-Pool的那个时,IIS如何在文件夹ACL中检查经过身份验证的用户的身份?

The only theory I have so far is that the file authorization module is utilized with integrated authentication automatically and it is explicitly checking this... but it still seems to go against the documented expectation. 到目前为止,我唯一的理论是文件授权模块自动与集成身份验证一起使用,它明确地检查了这一点......但它似乎仍然违背了记录的期望。

http://msdn.microsoft.com/en-us/library/gg703322%28v=vs.98%29.aspx http://msdn.microsoft.com/en-us/library/gg703322%28v=vs.98%29.aspx

This article, for example, seems to document both expectations. 例如,这篇文章似乎记录了这两个期望。

When Windows authentication is enabled but impersonation is disabled, ASP.NET performs file access checks in the file authorization module using the credentials that are sent from the browser. 启用Windows身份验证但禁用模拟后,ASP.NET将使用从浏览器发送的凭据在文件授权模块中执行文件访问检查。 Impersonation does not need to be enabled, because the FileAuthorizationModule module ensures that the requesting user is allowed read access or write access to the resource, depending on the request verb (for example, GET or POST) before executing the request. 不需要启用模拟,因为FileAuthorizationModule模块确保允许请求用户对资源进行读访问或写访问,具体取决于执行请求之前的请求谓词(例如,GET或POST)。

Followed a few lines later by 接下来几行

Windows authentication without impersonation. 没有模拟的Windows身份验证。 This is the default setting. 这是默认设置。 ASP.NET performs operations and accesses resources by using your application's process identity, which by default is the application pool identity on Windows 7 and Windows 2008 R2. ASP.NET通过使用应用程序的进程标识来执行操作和访问资源,默认情况下,该进程标识是Windows 7和Windows 2008 R2上的应用程序池标识。 For more information, see Application Pool Identities. 有关更多信息,请参阅应用程序池标识。

Windows authentication with impersonation. 带模拟的Windows身份验证。 With this approach, the Web application impersonates the authenticated user and uses that identity to perform operations and access local resources. 使用此方法,Web应用程序模拟经过身份验证的用户,并使用该标识执行操作和访问本地资源。 When you configure your application for impersonation, an impersonation token for the authenticated user is attached to the Web request thread. 将应用程序配置为模拟时,已通过身份验证的用户的模拟令牌将附加到Web请求线程。 As a result, all local resource access is performed using the caller's identity. 因此,使用调用方的标识执行所有本地资源访问。

My question: 我的问题:

What identity should be used when file system ACL checks are performed? 执行文件系统ACL检查时应使用什么标识? (My understanding was App-Pool when impersonation = off) and what settings might affect which identity is used outside of impersonation? (我的理解是当模拟=关闭时App-Pool)以及哪些设置可能会影响在模仿之外使用哪个身份?

This is very similar to this question: 这与这个问题非常相似:

Does an IIS 7.5 web app with windows authentication require end users to have file permissions? 具有Windows身份验证的IIS 7.5 Web应用程序是否要求最终用户具有文件权限?

The marked answer on this question does not address my concern. 这个问题的明确答案并未解决我的担忧。 Authorizing 'authenticated users' group should not be required as the identity being used should not rely on the set of end-users being authorized. 不应要求授权“经过身份验证的用户”组,因为所使用的身份不应依赖于被授权的最终用户集。 My question is much more specifically, which identity and how is this controlled? 我的问题更具体,哪个身份以及如何控制?

"NEW IN IIS 7.5 “IIS 7.5中的新功能

IIS 7.5 added the authenticatedUserOverride attribute to the element, which configures whether the IIS 7 server runtime will provide the authenticated user's identity or the worker process identity in the IHttpUser::GetPrimaryToken and IHttpUser::GetImpersonationToken methods. IIS 7.5将authenticatedUserOverride属性添加到元素,该元素配置IIS 7服务器运行时是否将在IHttpUser :: GetPrimaryToken和IHttpUser :: GetImpersonationToken方法中提供经过身份验证的用户身份或工作进程标识。 This attribute can be set to UseAuthenticatedUser or UseWorkerProcessUser, and these values respectively specify whether the IIS 7 server runtime will provide the authenticated user's identity or the worker process identity for any module that is using impersonation." 此属性可以设置为UseAuthenticatedUser或UseWorkerProcessUser,这些值分别指定IIS 7服务器运行时是否将为使用模拟的任何模块提供经过身份验证的用户的标识或工作进程标识。

Source 资源

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

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