Windows 11 NTFS: SE_SACL_PROTECTED stays enabled after removing audit rule

מרסלו גלר 0 Reputation points
2026-11-16T10:39:44.58+00:00

Environment

Windows 11, build 26300, NTFS.

Elevated Windows PowerShell 5.1.

SeSecurityPrivilege available in the elevated session.

Security auditing enabled for File System.

Problem

I need to restore the original SACL inheritance protection state of an existing NTFS directory without modifying its existing security entries.

Originally, the directory had:

Zero conventional audit rules.

AreAuditRulesProtected = False.

I temporarily added a successful file-write auditing rule using PowerShell Set-Acl. The audit worked: Windows generated Security Event 4663.

I then removed that specific auditing rule. The audit rule count returned to zero, but:

AreAuditRulesProtected = True

Attempting to restore inheritance with:

$acl = Get-Acl -LiteralPath $path -Audit
$acl.SetAuditRuleProtection($false, $false)
Set-Acl -LiteralPath $path -AclObject $acl

did not persist the change. A fresh read still returned True.

Investigation and reproduction

We investigated this behavior in separate, disposable NTFS laboratory directories, without attempting further modifications to the operational directory.

An extended Win32 security descriptor query revealed a SYSTEM_RESOURCE_ATTRIBUTE ACE (type 0x12, 68 bytes, flags 0x13) in a laboratory parent/child fixture. Conventional PowerShell audit-rule enumeration did not expose this ACE.

We created a controlled synthetic fixture with:

Parent SACL inheritance protection: disabled.

Child SACL inheritance protection: enabled.

Identical resource-attribute ACE sequences in both directories.

Native descriptor backups and checks of existing descendants.

We then tested:

SetSecurityInfo(handle, SE_FILE_OBJECT, UNPROTECTED_SACL_SECURITY_INFORMATION, NULL, NULL, NULL, NULL)

The call returned ERROR_SUCCESS, but the child's SE_SACL_PROTECTED flag remained set.

A subsequent independent verification confirmed that:

The child descriptor remained byte-for-byte identical to its saved baseline.

The parent descriptor remained unchanged.

The existing descendants' security and content fingerprints remained unchanged.

The operation did not achieve the requested protection-state transition. The reverse transition was therefore not tested.

The resource-attribute entries in this example are synthetic. We are not claiming that the laboratory fixture reproduces every characteristic of the operational directory.

Questions for Windows security / Win32 specialists

What is the Microsoft-supported procedure for changing SE_SACL_PROTECTED from enabled to disabled on an existing NTFS directory?

Does this require SACL_SECURITY_INFORMATION together with UNPROTECTED_SACL_SECURITY_INFORMATION and a non-null pSacl?

How can we preserve existing SYSTEM_RESOURCE_ATTRIBUTE ACEs, mandatory labels and other SACL information during this operation?

Can inheritance recalculation modify the target SACL or existing descendants even when the API reports success?

Is there a supported administrative tool or documented API sequence that allows this state to be restored safely and verified independently?

Our priority is to avoid changing the owner, group, DACL, SACL ACE contents or existing descendants unintentionally.

We would appreciate a documented procedure or guidance from a Windows security specialist before making further changes to the operational directory.

Thank you.

Windows development | Windows API - Win32
0 comments No comments

2 answers

Sort by: Most helpful
  1. AI answer

    2026-11-16T10:52:11.63+00:00

    Do not modify the operational directory further: the documented unprotect operation has already returned success without clearing SE_SACL_PROTECTED, and Windows does not provide a documented guarantee that enabling SACL inheritance will preserve the target SACL and every descendant byte-for-byte.

    Documented API contract

    UNPROTECTED_SACL_SECURITY_INFORMATION means that the SACL inherits ACEs from its parent and requires ACCESS_SYSTEM_SECURITY; PROTECTED_SACL_SECURITY_INFORMATION means that it cannot inherit ACEs. SYSTEM_RESOURCE_ATTRIBUTE_ACE entries are represented by ATTRIBUTE_SECURITY_INFORMATION, while mandatory labels use LABEL_SECURITY_INFORMATION.^1^

    The public documentation does not state that clearing SACL protection requires this combination:

    SACL_SECURITY_INFORMATION |
    UNPROTECTED_SACL_SECURITY_INFORMATION
    

    nor does it state that a non-null pSacl is required merely to request the protection-state transition. SetSecurityInfo permits pSacl == NULL when the SACL itself is not being set.^2^

    Therefore, your call was consistent with the documented meaning of UNPROTECTED_SACL_SECURITY_INFORMATION. ERROR_SUCCESS only establishes that the API accepted and completed the request; because the control bit remained set, it did not accomplish the required transition on that fixture.

    Controlled name-based experiment

    SetNamedSecurityInfoW is the documented name-based equivalent for NTFS objects and accepts SECURITY_INFORMATION flags.^3^ Public documentation says that some flags operate only with SetNamedSecurityInfo, but it does not identify UNPROTECTED_SACL_SECURITY_INFORMATION as one of them.^1^

    Consequently, treat this as a diagnostic experiment, not a proven workaround:

    DWORD rc = SetNamedSecurityInfoW(
        path, SE_FILE_OBJECT,
        UNPROTECTED_SACL_SECURITY_INFORMATION,
        nullptr, nullptr, nullptr, nullptr);
    
    wprintf(L"SetNamedSecurityInfoW: %lu\n", rc);
    
    PSECURITY_DESCRIPTOR sd = nullptr;
    DWORD qr = GetNamedSecurityInfoW(
        path, SE_FILE_OBJECT, SACL_SECURITY_INFORMATION,
        nullptr, nullptr, nullptr, nullptr, &sd);
    // Call GetSecurityDescriptorControl(sd, &control, &revision)
    // and test (control & SE_SACL_PROTECTED).
    

    Build as Unicode against Advapi32.lib, and run only in a disposable, production-equivalent fixture using the existing code path that enables SeSecurityPrivilege. Reading a SACL requires opening/querying with ACCESS_SYSTEM_SECURITY; Microsoft documents enabling SE_SECURITY_NAME for that operation.^4^

    Perform these checks:

    1. Capture the complete native security descriptor before the call—not only PowerShell audit rules or SDDL.
    2. Call SetNamedSecurityInfoW with only UNPROTECTED_SACL_SECURITY_INFORMATION.
    3. Re-read the descriptor through an independent native process.
    4. Compare:
      • SE_SACL_PROTECTED;
      • raw target descriptor and each SACL ACE;
      • parent descriptor;
      • descendant descriptors.
    5. If the flag again remains set, stop; switching APIs has not resolved the behavior.
    6. If it clears, repeat on multiple newly created production-equivalent fixtures before considering the operational object.

    Do not add SACL_SECURITY_INFORMATION with a non-null pSacl merely as an experiment on the operational directory. That changes the request from altering protection metadata to setting SACL content, increasing the possibility of reconstruction, normalization, or propagation.

    Preservation and propagation limits

    Resource-attribute and scoped-policy ACEs are special: the inheritance documentation expressly excludes SYSTEM_RESOURCE_ATTRIBUTE_ACE and SYSTEM_SCOPED_POLICY_ID_ACE from the normal ability to block inheritance through SE_SACL_PROTECTED.^5^ PowerShell’s conventional audit-rule collection is therefore not an adequate backup or equality check for the complete SACL.

    SetSecurityInfo and SetNamedSecurityInfo can automatically propagate inheritable SACL elements to existing children. The system may impose the current inheritance model on objects below the target and set auto-inheritance control bits.^6^ The API documentation also warns that propagation depends on child share access and handle-open semantics.^2^

    Accordingly:

    • A successful return does not prove byte-for-byte preservation.
    • Enabling inheritance can recalculate the target’s inherited SACL state.
    • Existing descendants can potentially change.
    • A guarantee that only one control bit changes, while all target and descendant bytes remain identical, is incompatible with the documented inheritance behavior.

    Avoid TreeSetNamedSecurityInfo and TreeResetNamedSecurityInfo; those APIs are explicitly intended to reset subtree security and are unsuitable for the stated preservation requirement.

    Escalation

    Because the handle-based documented request is a reproducible successful no-op on build 26300, open a Microsoft Support case for Windows/Win32 security before changing the operational directory. If build 26300 is from a Windows Insider channel, also submit the reproducer through Feedback Hub.

    Include:

    • exact build, edition, servicing/Insider channel, and NTFS volume details;
    • minimal native reproducer;
    • numeric SecurityInfo mask and requested handle access;
    • token privilege state showing SeSecurityPrivilege enabled;
    • raw before/after security descriptors and control values;
    • parent and descendant comparisons;
    • the synthetic SYSTEM_RESOURCE_ATTRIBUTE_ACE bytes and flags;
    • Process Monitor or equivalent filesystem/security-operation trace;
    • confirmation that both SetSecurityInfo and, if tested, SetNamedSecurityInfoW returned ERROR_SUCCESS without clearing the bit.

    Request confirmation of whether this is expected NTFS behavior for resource-attribute-bearing descriptors or a build-specific defect, and request a supported sequence that explicitly addresses propagation and preservation.


    References

    1. SECURITY_INFORMATION
    2. SetSecurityInfo function (aclapi.h)
    3. SetNamedSecurityInfoW function (aclapi.h)
    4. GetSecurityInfo function (aclapi.h)
    5. ACE Inheritance
    6. Automatic Propagation of Inheritable ACEs
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Taki Ly (WICLOUD CORPORATION) 5,805 Reputation points Microsoft External Staff Moderator
    2026-11-16T10:47:54.63+00:00

    Hi @מרסלו גלר ,

    Thanks for sharing such a detailed investigation and the results of your controlled tests.

    I understand that your main concern is restoring the original SACL inheritance protection state without unintentionally modifying existing security descriptors or affecting descendant objects.

    Something I would suggest checking in the meantime:

    Since SetSecurityInfo() returned ERROR_SUCCESS without clearing SE_SACL_PROTECTED, you could consider testing the equivalent operation using SetNamedSecurityInfoW() in a separate, disposable NTFS test directory.

    This would be a diagnostic step rather than a confirmed workaround. I would recommend capturing the complete security descriptors before and after the test and verifying whether the protection flag changes while the existing SACL entries and descendant descriptors remain intact.

    You can refer to the documentation here:

    SetNamedSecurityInfoW function

    For now, I would avoid making further changes to the operational directory until the behavior and potential effects on inheritance are better understood.

    I'll continue looking into the documented behavior and possible approaches, and I'll get back to you once I have more information to share.

    Thank you for your understanding.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.