- 
                Notifications
    You must be signed in to change notification settings 
- Fork 103
Use LSA to determine console users on Windows #2422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use LSA to determine console users on Windows #2422
Conversation
3fb37c8    to
    d673e3f      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should fork winlsa before merging
| activeUsernameList := make([]string, len(activeUsernames)) | ||
| i := 0 | ||
| for sid := range activeUsernames { | ||
| activeUsernameList[i] = sid | ||
| i += 1 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just map.Keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess thats an iter. Not sure if it would just work though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated!
| activeUsernameList[i] = sid | ||
| i += 1 | ||
| } | ||
| activeUsernameList := slices.Collect(maps.Keys(activeUsernames)) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could have changed the signature to iter, instead of bringing in slices.Collect, but sure.
Benchmarking our current implementation against
qusersand using LSA showed that using LSA is the most performant option for us:Requires kolide/go-winlsa#2.