Repository navigation
Conversation
The AD LDAP query was hardcoded to objectCategory=person, so computer accounts and sMSA/gMSA/dMSA could not authenticate. Match on sAMAccountType (user 805306368, machine 805306369) instead, so any account that can authenticate is found. - Add AccountType to the returned User object (most specific AD objectClass: user, computer, msDS-GroupManagedServiceAccount, ...), across the Directory Services, OpenLDAP, ActiveDirectory module and IIS providers - Use Get-ADObject instead of Get-ADUser for the ActiveDirectory module provider, since Get-ADUser doesn't return computer/service accounts - Reuse Get-PodeAuthADQuery in Get-PodeAuthADGroupDirect rather than duplicating the filter - Escape RFC 4515 special characters in the username before it is put into the LDAP filter (fixes LDAP filter injection via the username) - Return $null from the OpenLDAP/ADModule lookups when no entry is found - Document AccountType and the supported account types, including the note about retrieving managed passwords for Basic/Form auth - Add unit tests for Get-PodeAuthADQuery
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Windows AD authentication only worked for user accounts, because the LDAP query was hardcoded to
objectCategory=person. Computer accounts and managed service accounts (sMSA, gMSA, dMSA) could not authenticate.Get-PodeAuthADQuerynow matches onsAMAccountType(user805306368, machine805306369), so any account that can authenticate is found.AccountTypeproperty: the most specific AD object class of the account (user,computer,msDS-GroupManagedServiceAccount, ...). It is populated by the Directory Services, OpenLDAP, ActiveDirectory module and IIS providers.Get-ADObjectinstead ofGet-ADUser, sinceGet-ADUserdoes not return computer or service accounts.Get-PodeAuthADGroupDirectreusesGet-PodeAuthADQueryinstead of a duplicated filter.$nullwhen no entry is found.WindowsAD.md,IIS.md) and unit tests added forGet-PodeAuthADQuery.Examples
Computer and managed service accounts are supplied with their trailing
$, e.g.DOMAIN\WEB01$.Additional Context
Add-PodeAuthWindowsAdIISis usually the better choice (noted in the docs).$and special-character escaping. Not yet tested against a live domain with gMSA/computer accounts.