KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.45k stars 196 forks source link

[Feature suggestion] 'Search secrets' #823

Open JanKrivanek opened 1 week ago

JanKrivanek commented 1 week ago

Motivation

People are sometimes cautious about whether they can share their binlogs (rightfully)! They can reduct some secrets today (the set of patterns ideally to be expanded as part of this), but they cannot simply check if there is something to be worried about.

I'd want to add something for just searching secrets - but want to first drag it through discussion before spending time on it.

UX Proposal

Just a very rough idea :-) I want to collect feedback on what to avoid and what to try when trying to play with possible ux implementations.

image

Possible future iterations

KirillOsenkov commented 6 days ago

My only concern is adding yet another tab, otherwise it looks good! I think there should be a menu File -> Secrets or something, and it would then populate the search pane with what you're suggesting above. Or maybe a dialog.

My question is are there scenarios where we don't want everything enabled?

@nguerrera FYI if you haven't met @JanKrivanek he's on the MSBuild team and also passionate about redacting secrets among many other things.

KirillOsenkov commented 6 days ago

or for starters we could keep it simple and add search keywords such as $secret $token $aws and whatnot. It would work well as an ISearchExtension, like $nuget for example: https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/10b05586dc5522d2402937160b499de2fc332411/src/StructuredLogger.Utils/NuGetSearch.cs#L48

JanKrivanek commented 5 days ago

I like the ideas to simplify this - especially with search term. Though - I'm thinking how to capture searching (or rather displaying of those) within files and filenames as well - even though it might be little less of a concern - it'd be good to cover those as well. File menu/dialog would do, the search terms I'm not sure.

As for ability to not use some - it's mainly about perf an false positives. That being said for 'highly identifiable' patterns - we probably almost allways want all. For heuristics - it might depend.

KirillOsenkov commented 5 days ago

perhaps split the results into high confidence and low confidence

all the results should appear in the results tree like all other results, including files and file names