dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.19k stars 1.35k forks source link

Consider redacting username in binlogs #8493

Open rainersigwald opened 1 year ago

rainersigwald commented 1 year ago

Idea from @grendello on Discord:

however, @rainersigwald it would be nice if binlog masked the user's home directory path it reveals login name it's especially important on servers it gives you a known existing account name $HOME should be replaced with ~ or something like that

JanKrivanek commented 1 year ago

Related to https://github.com/dotnet/msbuild/issues/8400 Though removing the home folder from logs via events redacting would very likely be significantly impacting performance. The ideal solution would emit the replacement log at the places where we know the home folder is being introduced or used - there are however far too many and many of those are simple properties assignments - e.g.:

JanKrivanek commented 8 months ago

@grendello - while not built-in, you can achieve this now with the binlog viewer: https://github.com/KirillOsenkov/MSBuildStructuredLog/pull/711#issuecomment-1803054792