You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows ACL handling was duplicated across the filesystem and registry resources and exposed raw SDDL. This change introduces a shared typed model so both resources can manage DACLs and SACLs consistently through structured ACE objects.
Changes
Add lib-acl with Win32-backed security descriptor, SID resolution, privilege, DACL, and SACL management.
Represent ACE access masks with resource-specific permission enums and accept either usernames or SIDs as principals.
Rename the filesystem resource to Microsoft.Filesystem/AccessControlList and replace raw SDDL inputs with accessControlList.
Replace the registry acl property with the same typed accessControlList shape.
Add _purge, defaulting to true; _purge: false merges ACL entries, removes semantic duplicates, and canonicalizes DACLs with deny ACEs first.
Update schemas, registry documentation, localization, and filesystem/registry integration coverage.
This intentionally changes the existing public ACL schema and filesystem resource type name. Reviewers should pay particular attention to permission mappings, SACL privilege handling, and merge/canonicalization semantics.
Introduce typed DACL and SACL management for filesystem and registry resources, including SID or username principals, resource-specific permission enums, and merge behavior through _purge.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Validate ACL operations before registry mutation, represent absent SACLs as empty audit lists, map generic rights for semantic comparison, and align the filesystem schema contract.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Require accessControlList on the ACL resource without invalidating File/Content instances.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Security-sensitive registry SACL writes and privilege activation still need reliable regression coverage.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Add round-trip coverage for registry SACL writes
lib/dsc-lib-registry/src/acl.rs:178
The new registry SACL write has no round-trip test: current registry SACL tests cover access flags, can_set, and what-if, but never execute this RegSetKeySecurity call. Add an elevated Set/Get/Test case in resources/registry/tests/registry.config.set.tests.ps1 that verifies audit entries, systemProtected, and preservation of the unrequested DACL. Use a temporary key with guaranteed cleanup. The filesystem SACL test uses a different Windows setter and does not cover this path.
Privilege availability test leaves SeSecurityPrivilege enabled
lib/dsc-lib-registry/src/acl.rs:471
This availability check enables SeSecurityPrivilege on the process token before can_set runs and leaves it enabled. The test therefore still passes if privilege setup is removed from can_set. Exercise the check against an existing temporary key in an isolated process with the privilege held but initially disabled, and verify that removing privilege setup makes the test fail. Do not disable the shared test process's privilege, since other Rust tests can run concurrently.
Round-trip registry audit ACLs and verify privilege activation from an isolated process with SeSecurityPrivilege initially disabled.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Prepare ACL changes before writing registry values
lib/dsc-lib-registry/src/lib.rs:417
With _purge: false, a valid request can pass preflight but fail when effective reads an existing DACL containing a conditional or object-specific ACE that parse_acl rejects. If the request also changes a value, reg_key.set_value at line 398 has already run, so the command fails after modifying registry data. For existing keys, prepare the effective merged descriptor before writing the value and reuse it for the ACL write. Add a regression test showing that an unsupported existing ACE leaves the value unchanged.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The security-sensitive Win32 rewrite needs Windows-focused human validation, particularly for inherited-permission previews.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
What-if omits inherited ACL entries for missing keys
lib/dsc-lib-registry/src/acl.rs:263
For a missing key under a parent with inheritable ACEs, _purge: false previews a different ACL from the one Set applies. Real Set creates the key first (lib.rs:310), then reads and merges its inherited entries through prepare (lib.rs:325). This preview starts from an empty ACL, omitting permissions that will remain after Set. Pass the target path into this helper and compute the new key's inherited ACL without mutation before merging. Add a regression test comparing what-if with subsequent Set/Get under a parent with inheritable entries.
Localize ACL error templates and diagnostic reasons
lib/lib-acl/src/error.rs:13
These error templates and the validation/resolution reasons are returned unchanged by both resources, so hard-coded English bypasses localization. The existing registry errors use t!-backed formats (lib/dsc-lib-registry/src/error.rs:10–38). Add rust-i18n initialization and an en-us.toml catalog to lib-acl, and localize both its error templates and diagnostic reasons.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Security-sensitive Win32 ACL writes, privilege handling, and inheritance simulation warrant final Windows-focused human review.
No open issues 🎉
Review effort: Balanced
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
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.
Windows ACL handling was duplicated across the filesystem and registry resources and exposed raw SDDL. This change introduces a shared typed model so both resources can manage DACLs and SACLs consistently through structured ACE objects.
Changes
lib-aclwith Win32-backed security descriptor, SID resolution, privilege, DACL, and SACL management.Microsoft.Filesystem/AccessControlListand replace raw SDDL inputs withaccessControlList.aclproperty with the same typedaccessControlListshape._purge, defaulting totrue;_purge: falsemerges ACL entries, removes semantic duplicates, and canonicalizes DACLs with deny ACEs first.This intentionally changes the existing public ACL schema and filesystem resource type name. Reviewers should pay particular attention to permission mappings, SACL privilege handling, and merge/canonicalization semantics.
Validation
./build.ps1 -Project lib-acl,dsc-lib-registry,file_dsc,registry -Clippy -Test