Active Directory 和 PrimaryPermission
这更多的是出于好奇,而不是请求帮助,但我注意到,当使用 PrimaryPermission 并验证用户是否属于 Active Directory 中的特定组时,它不会使用真实的组名称,而是根据 Windows 2000 之前的组进行验证名称代替。 通常这不会产生什么影响——除非有人碰巧使这些值不同。
谁能想到为什么 .Net API 会使用该组名称而不是“真实”名称? 这让我经历了几个小时的悲伤和一点点运气,终于弄清楚了这一切。
This is more of a curiosity than a request for help, but I noticed that when using PrincipalPermission and verifying a user is part of a specific group in Active Directory it will not use the true group name but instead validates against the pre-Windows 2000 group name instead. Ordinarily this wouldn't make a difference - unless someone happens to make these values different.
Can anyone think of why the .Net API would use that group name instead of the "true" name? This caused me hours of grief and a bit of blind luck to finally figure it all out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设(没有亲自测试和尝试过)PrincipalPermission 属性将使用 Active Directory 中的“sAMAccountName”作为用户和组名称(例如“Users”或“JohnDoe”),而不是“可分辨名称”(DN)您可能会期望(“CN =用户”,“CN = John Doe”)。
其背后的原因很可能是您正在使用独立服务器或 NT4 域等情况。 在这些情况下,您根本没有任何基于 AD 的可分辨名称 - 但您有 SAM 帐户名称。
因此,从某种意义上说,一开始这似乎有点令人惊讶 - 但在我看来,使用这些 SAM 帐户名称(AD 之前的名称)确实有意义 - 您同意吗?
马克
I would assume (without having tested and tried this myself) that the PrincipalPermission attribute will use the "sAMAccountName" in Active Directory for user and group names (e.g. "Users" or "JohnDoe") instead of the "distinguished name" (DN) you might expect ("CN=Users", "CN=John Doe").
The reasoning behind this will most likely be the scenario where you're working on e.g. a stand-alone server, or a NT4 domain. In those cases, you simply don't have any AD-based distinguished names - but you do have the SAM account names.
So in a sense this might seems a bit surprising at first - but it does make sense in my opinion to use those SAM account names (pre-AD names) - don't you agree?
Marc
原因是安全有保障。
samAccountName
属性是唯一的跨 NTDS 域中的所有安全主体对象。 如果使用其他名称属性,攻击者可以通过在不同的组织单位或容器中创建具有相同名称的其他用户/组来轻松解决安全权限问题。The reason is guaranteed security. The
samAccountName
attribute is unique across all security principal objects in an NTDS domain. If other name attribute would be used instead an attacker could easily workaround security permission by creating other user/group with the same name in a different organizational unit or container.