vscode-extension-telemetry icon indicating copy to clipboard operation
vscode-extension-telemetry copied to clipboard

Mask out username from events

Open bwateratmsft opened this issue 4 years ago • 4 comments

The username (i.e. literally the OS username) could be considered PII, and should be masked out.

In addition to #80, this would allow us to remove our custom masking logic from https://github.com/microsoft/vscode-azuretools/blob/main/ui/src/masking.ts.

We currently have issues in the above file (https://github.com/microsoft/vscode-azuretools/issues/1024), so it's not quite right to filter out the username unconditionally--maybe, /\bMyUsername\b/ig?

bwateratmsft avatar Nov 17 '21 18:11 bwateratmsft

This should be in theory be being done by https://github.com/microsoft/vscode-extension-telemetry/blob/main/src/common/baseTelemetryReporter.ts#L180-L261 can you give an example of a property value that is avoiding this?

lramos15 avatar Nov 17 '21 21:11 lramos15

@nturinski / @alexweininger / @wwlorey Do you have an example of usernames leaking through the above linked code? In Docker's case, that code would have caught the items that got through (we didn't have that a high enough version of vscode-extension-telemetry), so I don't have a concrete example.

@lramos15 It's a contrived example but I could see an error message that says something like "User bwateratmsft does not have permission to access foo", which isn't a file path, email, or secret so I think it gets through the above code, unless I'm missing something.

The function of the code here and here is to mask that "bwateratmsft" (however it's being to aggressive).

bwateratmsft avatar Nov 17 '21 22:11 bwateratmsft

This is a tough one because that user string could be anywhere and as you saw with smaller user strings it can even be in common strings within the data.

lramos15 avatar Nov 19 '21 16:11 lramos15

I agree. In https://github.com/microsoft/vscode-azuretools/pull/1025 our plan was basically to not mask usernames either 3 or 4 (haven't decided which yet) or less characters. It's definitely possible to still mask something we don't need to, even with that in place, but it should become exponentially less common.

Otherwise, /\bMyUsername\b/ig should probably work as well. Or, a combination of the two.

bwateratmsft avatar Nov 29 '21 15:11 bwateratmsft