[confignet] Allow setting security descriptors for npipes#15212
[confignet] Allow setting security descriptors for npipes#15212swiatekm wants to merge 8 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15212 +/- ##
=======================================
Coverage 91.03% 91.03%
=======================================
Files 729 729
Lines 48491 48499 +8
=======================================
+ Hits 44144 44152 +8
Misses 3020 3020
Partials 1327 1327 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
426cd68 to
5a83e39
Compare
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
e2d7b28 to
aad6cd5
Compare
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Merging this PR will not alter performance
|
Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
callegarimattia
left a comment
There was a problem hiding this comment.
First time reviewing here, so bear with me. I went through the confignet npipe changes and have a couple of suggestions below, feel free to discard if you've already considered them.
| var cfg *winio.PipeConfig | ||
| if securityDescriptor != "" { | ||
| cfg = &winio.PipeConfig{SecurityDescriptor: securityDescriptor} | ||
| } |
There was a problem hiding this comment.
winio.ListenPipe already normalises a nil config to &PipeConfig{} internally (pipe.go:515), so the nil-guard branch isn't needed. Passing &winio.PipeConfig{SecurityDescriptor: securityDescriptor} directly is equivalent.
If a second field is added to NpipeConfig, the guard would silently drop it when securityDescriptor is empty.
There was a problem hiding this comment.
Good catch, simplified this down to a single line.
There was a problem hiding this comment.
Should the security descriptor be part of the validation? Right now, if the SDDL is invalid, it fails when Listen is called, but it could be caught here beforehand. go-winio already exposes a conversion method that could be used to validate. It's the same one used in the Listen flow.
There was a problem hiding this comment.
Added the validation.
Description
Add
dialer.security_descriptorfield to set an SDDL security descriptor on Windows named pipe (npipe) listeners in confignet.Link to tracking issue
Fixes #15211
Testing
Added unit tests which actually create the named pipe with specified descriptors.
Documentation
Documented the field in the struct definition, the schema, and the readme.