Skip to content

Salt-minion fails with "Access is denied" on Windows when run under domain account with specific privileges #52577

Closed

Description

@lukasraska

Description of Issue/Question

Salt-minion can sometimes fail on Windows with error message pywintypes.error: (5, 'NetUserGetLocalGroups' , 'Access is denied.') when executed under domain account with special permissions set up.

image001

We found this issue when we tried to run the service under account in AD in Object List Mode, when the account doesn't have full visibility over the domain. During debugging how the NetUserGetLocalGroups function actually works, we found out it tries to resolve all indirect groups the user is member of and it tries to resolve domain accounts as well, if the user is domain user (see NetUserGetLocalGroups returns ERROR_ACCESS_DENIED for reference). It's because of flag LG_INCLUDE_INDIRECT, which is set by default.

The solution is explicitly disabling the LG_INCLUDE_INDIRECT flag, but it might be sometimes needed, so wrapping the call in try/except with call without the flag would be better.

Setup

Windows server joined to domain.

Steps to Reproduce Issue

Run salt-minion under domain account which doesn't have permissions to all groups it's indirectly member of.

Versions Report

2019.2, 2018.3, 2017.7 versions are affected.

Activity

  1. lukasraska commented on Apr 17, 2019

    @lukasraska
    ContributorAuthor

    I've proposed #52578 to fix this issue.

  2. lukasraska commented on Apr 18, 2019

    @lukasraska
    ContributorAuthor

    #52596 created which targets the 2018.3 branch

  3. s0undt3ch commented on Apr 18, 2019

    @s0undt3ch
    Contributor

    /cc @saltstack/team-windows

  4. added this to the Approved milestone on Apr 26, 2019
  5. stale commented on Jan 8, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions