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.
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.
@gabriel-samfira had also created
getLocalListenerfor UNIX https://github.com/moby/buildkit/blob/master/cmd/buildkitd/main_unix.go#L51C1-L62 , which isn't being called...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.
Sadly, the current
getLocalListener()function is way to lax in terms of DACLs.We need to parse the
--groupflag, resolve that to a SID, and use that SID to create a proper SDDL. We need to resolve the SID every time, because on Windows, the SID will always be different for each machine that was sysprepped. Also, if the machine is joined to an active directory, the group may be one belonging to AD, which will have a different SID compared to local groups. ie: you can havelocalhost\Dockerand alsomydomain\Docker.The good news is that it should be easy to split the handling of the
--groupflag. If we omit it, we can default to none on Windows, and only allow the builtinAdministratorsgroup.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.
Just double checking; that's the implementation in BuildKit only, correct? Because that one's missing this part of the code (to apply the group); https://github.com/moby/moby/blob/faf84d7f0a1f2e6badff6f720a3e1e559c356fff/daemon/listeners/listeners_windows.go#L29-L35
Or is the code in Moby also incorrect, by applying the fixed SID as starting point?;
https://github.com/moby/moby/blob/faf84d7f0a1f2e6badff6f720a3e1e559c356fff/daemon/listeners/listeners_windows.go#L26-L27