trace2receiver icon indicating copy to clipboard operation
trace2receiver copied to clipboard

On Windows capture and log the username of named pipe client peer

Open jeffhostetler opened this issue 2 years ago • 1 comments

On Windows the collector (usually) runs as a Control Panel Service process and therefore inherits whatever system identity (LOCAL SERVICE). Logging the username of the collector in the OTLP data stream is not very useful.

We should use the feature of named pipes to get the (Windows) SID of the client process upon receiving an incoming named pipe connection and map that to a username and log that.

This is PII-sensitive, so it should only be done if requested in the pii.yml.

On Linux/Mac Unix domain sockets have a similar feature and IIRC is already being used.

jeffhostetler avatar Jan 17 '24 15:01 jeffhostetler

To get the client peer data you need the OS handle to the pipe (rather than just the GO wrapper). This wasn't available at the time, so I couldn't do it then. But now that I've forked the relevant parts of the go-winio libraries to handle the multi-threaded problems, we can hack it a little further to get the peer data.

jeffhostetler avatar Jan 17 '24 16:01 jeffhostetler