Skip to content

Commit

Permalink
[vnet] fix: use authenticated users SID (#52765)
Browse files Browse the repository at this point in the history
  • Loading branch information
nklaassen authored Mar 4, 2025
1 parent c97b438 commit 252a6ae
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/vnet/install_service_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,20 @@ func grantServiceRights() error {
if err != nil {
return trace.Wrap(err, "getting current service DACL")
}
// This is the universal well-known SID for "Authenticated Users".
authenticatedUsersSID, err := windows.StringToSid("S-1-5-11")
if err != nil {
return trace.Wrap(err, "parsing authenticated users SID")
}
// Build an explicit access entry allowing authenticated users to start,
// stop, and query the service.
ea := []windows.EXPLICIT_ACCESS{{
AccessPermissions: windows.SERVICE_QUERY_STATUS | windows.SERVICE_START | windows.SERVICE_STOP,
AccessMode: windows.GRANT_ACCESS,
Trustee: windows.TRUSTEE{
TrusteeForm: windows.TRUSTEE_IS_NAME,
TrusteeForm: windows.TRUSTEE_IS_SID,
TrusteeType: windows.TRUSTEE_IS_WELL_KNOWN_GROUP,
TrusteeValue: windows.TrusteeValueFromString("Authenticated Users"),
TrusteeValue: windows.TrusteeValueFromSID(authenticatedUsersSID),
},
}}
// Merge the new explicit access entry with the existing DACL.
Expand Down

0 comments on commit 252a6ae

Please sign in to comment.