Skip to content

transport: allow named pipe SecurityDescriptor to be set#538

Merged
djs55 merged 1 commit intomoby:masterfrom
djs55:securitydescriptor
May 10, 2021
Merged

transport: allow named pipe SecurityDescriptor to be set#538
djs55 merged 1 commit intomoby:masterfrom
djs55:securitydescriptor

Conversation

@djs55
Copy link
Copy Markdown
Collaborator

@djs55 djs55 commented May 7, 2021

This is needed on some Windows machines to set the ACLs on the named pipes to ensure we can connect to them.

Signed-off-by: David Scott dave.scott@docker.com

@djs55 djs55 force-pushed the securitydescriptor branch from afd3568 to 8bf9c7b Compare May 7, 2021 10:05
Listen(path string) (net.Listener, error)
String() string
// SetSecurityDescriptor for Windows named pipes.
SetSecurityDescriptor(sddl string)
Copy link
Copy Markdown
Collaborator

@fredericdalleau fredericdalleau May 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where you call this function?
Why not simply use a default security descriptor on Windows pipes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit of an awkward split but this library is vendored inside the Docker Desktop codebase and a Desktop-specific descriptor is set which references the group docker-users which is created by the installer. I was hoping to avoid adding a dependency on the Desktop installer here.

Perhaps we could change the API so the client provides a "listener factory" (not sure what would be idiomatic in Go) which would encapsulate this on the client-side.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, maybe you can add an exemple security descriptor as a comment, and also make sure it stills works as before if the sddl is not set

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks -- I've expanded the comment with a link and an example. I've added a simple unit test to demo that it still works without the descriptor being set.

This is needed on some Windows machines to set the ACLs on the named
pipes to ensure we can connect to them.

Signed-off-by: David Scott <dave@recoil.org>
@djs55 djs55 force-pushed the securitydescriptor branch from 8bf9c7b to e99fdfb Compare May 10, 2021 09:49
Copy link
Copy Markdown
Collaborator

@fredericdalleau fredericdalleau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@djs55 djs55 merged commit 8fbc619 into moby:master May 10, 2021
@djs55 djs55 deleted the securitydescriptor branch May 10, 2021 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants