Repository navigation
Add native Active Directory security descriptor utilities - #831
Open
stevebauman wants to merge 5 commits into
Open
stevebauman wants to merge 5 commits into
stevebauman wants to merge 5 commits into
Conversation
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.
Active Directory stores permissions in the binary
ntSecurityDescriptorattribute. Editing these permissions is required for settings such as "User cannot change password", which cannot be set through the account control flag alone.I've added native utilities for reading, editing, and encoding security descriptors. You can load a descriptor with
withSecurityDescriptor(), edit it throughsecurityDescriptor(), assign it back tontSecurityDescriptor, and call the usualsave()method.Saving automatically selects the descriptor sections that changed and writes them alongside other pending attributes in one LDAP request. The connection's previous controls are restored after the operation. I've also included documentation and a runnable example for disabling password changes.
The unit and integration suites pass locally on PHP 8.1 and 8.4, along with Pint. Live Active Directory writes still need validation.
Closes #681.