Sensitive data redacting PoC#711
Conversation
|
The CI is failing due the new test getting While for obtaining that test binlog (1.binlog) I use same as is already used in other tests - e.g.: MSBuildStructuredLog/src/StructuredLogger.Tests/BinaryLoggerTests.cs Lines 93 to 95 in ff5383d This works just fine locally. |
|
No quick idea, just noticing that in the path the GUID is mentioned twice: probably eyeball |
|
Some first notes as I read:
Otherwise all seems reasonable from a quick read. |
I'l work on these. As far as UI - if you have anything specific in mind, a quick non-functional markup mockup would be super helpful as I'm bit rusty with UI. But I can definitely find a way otherwise. I'd probably add the 'Replace In Place' checkbox (or something similar that would flip behavior similar to Save / Save As) - that way we wouldn't need to decide whether it's a in-place redact or separate file - it'd be up to user, with sensible default. Interfaces - I'd want to keep this as similar to MSBuild as possible - it'll make it easier to port changes both ways. But I'm definitely open to suggetions here |
94a8577 to
35cb1ba
Compare
0b0c10d to
bdfbafe
Compare
|
Finalized v1:
It feels ready for review ;-) |
9e7b498 to
0ac3e4c
Compare
| <PackageReference Include="Microsoft.Build.Framework" Version="$(MSBuildPackageVersion)" /> | ||
| <PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MSBuildPackageVersion)" /> | ||
| <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" /> | ||
| <PackageReference Include="MSBuild.BinlogRedactor.SensitiveDataDetector" Version="0.0.4-beta" /> |
There was a problem hiding this comment.
Same concern with adding another dependency here. Do you think it'd be possible to only have the StructuredLogViewer and BinlogTool projects depend on this one? So that people who only depend on StructuredLogger.dll do not inherit two more dependencies they probably don't need? This would mean that StructuredLogger.dll doesn't have the built-in ability to redact.
There was a problem hiding this comment.
I added a new indirection project (StructuredLogger.Utils) to separate the functionality from the StructuredLogger.
I wanted to avoid duplicating or linking the redaction work in both of the ui layers. (The existing StructuredLogViewer.Core is not suitable for binlogtool and referencing binlogtool from the viewer felt too unnecesary)
There was a problem hiding this comment.
Sounds good. Let's make sure all .dlls that need to ship with the viewer are mentioned here:
https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/main/src/StructuredLogViewer/MSBuildStructuredLogViewer.nuspec
For binlogtool, I think the packing is all automatic, so nothing should be done hopefully.
There was a problem hiding this comment.
So for binlogtool I installed it from local built package and verified it works as expected - good.
For the viewer I verified by building, extracting the lib folder from the created packages and verifying it works as expected - not sure if there is better way of testing.
|
Thank you for this gargantuan effort! Your hard work and patience are much appreciated! I think it looks really good already. I really didn't want to cause any unnecessary stop energy, but I'm paranoid about breaking people, so just wanted to iron out a couple of things before this goes in. Primarily:
The rest (including the UI) seems fine. Once the above is clarified, we could merge and continue iterating on it in separate PRs if needed. For the binlogtool, we should also later think about supporting a ".rsp" file, so that someone has a file with secrets somewhere (one per line), and we could just pass it to the tool instead of mentioning the secrets in the command line. Also clarify the in-place vs. a new file for command-line. |
|
Hmm, I just thought, for Stream utils, do you think you could publish a source-only package? DotUtils.StreamUtils.Source? You could build it from the same source using for example a custom .nuspec file: https://github.com/KirillOsenkov/MSBuildTools/blob/d8afc187fa7be3771743e223a31765a68248f4e5/src/PackNuspec/PackNuspec.csproj#L9-L37 or coerce the built-in MSBuild properties to produce a source-only package in addition to the default one. I think this would be ideal: doesn't add a runtime dependency, but also avoids forking the source. Wish we could do the same for Microsoft.NET.StringTools.dll, but that ship has sailed I'm afraid. |
I'm grateful for the detailed look and all the feedback! I definitely perceive it as helpful - no worries about interrupting the flow. I'm happy to iterate over things in this PR and not leaving them "for the future" (with few small exceptions - as my plan is to start integrating the 'forward compatibility reading support' after this one is merged and it has some of your concerns addressed - e.g. lazy ArchiveFiles. I'll call those explicitly out and point to the MSBuild PR what's the plan). As to the individual concerns:
Rest of comments are clear - I'll eaither right away address them or comment inline if any needs more context. Thank you!! 😊 |
|
@KirillOsenkov - it now feels ready for next round of review. Main changes:
Looking forward for the next round of feedback :-) |
KirillOsenkov
left a comment
There was a problem hiding this comment.
Awesome job! Thanks so much!
|
Oh - nice |







Context
Based on offline talks with @KirillOsenkov I'm spinning some experimentation with sensitive data redacting.
Currently the main effort was on:
The actual redacting is a very PoC thing - just to demonstrate the idea.
In next iteration I'd ideally ref the https://www.nuget.org/packages/MSBuild.BinlogRedactor/ and just inject the replay functionality into it. The package would take care about the redaction of data - as it already has some auto-detection of sensitive data (and more patterns are going to be added soon)
If all the stream utilities in
Postprocessingfolder feels as too much code to drag - I can reference https://www.nuget.org/packages/DotUtils.StreamUtils/, but viewer seeems to be very minimalistic in package refs - so I rather just used the code.UX
Updated: