question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AppInsights: PII is logged even if logPersonalInformation is false

See original GitHub issue

Version

4.11.0

Describe the bug

BBF always logs the user’s text.

To Reproduce

  1. Have bot with AppInsights integration. Configure the bot to not log the user’s personal information as per doc https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-telemetry?view=azure-bot-service-4.0&tabs=csharp.
  2. Talk to the bot
  3. Look into any event that logs the Recognizer telemetry, e.g. ValueRecognizerResult
  4. Check the customDimensions, you will find “Text” property there. Example:
{
    "conversationId": "0a9d58c0-3301-11eb-bf90-2102e829151f|livechat",
    "activityType": "message",
    "channelId": "emulator",
    "activityId": "2d360170-3301-11eb-98d6-891267dfc0ed",
    "TopIntentScore": "Microsoft.Bot.Builder.IntentScore",
    "Entities": {
        "instance": {
            "Ordinal": [
                {
                    "Name": "Ordinal",
                    "Value": 2,
                    "Start": 4,
                    "End": 9,
                    "Text": "second"
                }
            ]
        }
    },
    "TopIntent": "test2",
    "Intents": {
        "test2": { "score":0.989161491394043 }​
    },
    "Text": "the second test"
}

Expected behavior

User’s text should not be logged if logPersonalInformation == false

Additional context

  • The issue is that the LogPersonalInformation property is in TelemetryLoggerMiddleware. It should be a property in IBotTelemetryClient (it should be virtual on BotTelemetryClient).

  • FillRecognizerResultTelemetryProperties method should check the property on the logger and it shouldn’t log text or alteredtext if LogPersonalInformation == false.

  • Also, we need to do additional analysis to ensure that we don’t log PII in recognizerResult.Properties object.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Robulanecommented, Dec 8, 2020

@Zerryth, yes, TelemetryLoggerMiddleware handles PII as expected. This bug is about the fact that there other places in BBF that log PII data. Examples that I found:

  1. All recognizer results (ValueRecognizerResult, RegexRecognizerResult, RecognizerSetResult, etc.)
  2. GeneratorResult can log text that may contain PII data in “text” field
0reactions
Zerrythcommented, Dec 16, 2020

Update: still working on this.

I’ve spoken with Eric regarding best practices/design issue that arises around

  1. There being a lot of classes that derive from Recognizer
  2. Implementing the LogPersonalInformation flag
  3. LogPersonalInformation wanting to be a BoolExpression (which needs dependency on AdaptiveExpressions) for adaptive bits, but only a bool for non-adaptive

It goes deeper, however Eric said maybe we should discuss best practices with Gabo, since current solution we can think of isn’t that pretty

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add telemetry to your bot - Bot Service
Telemetry logging enables bot applications to send event data to telemetry services such as Application Insights. Telemetry offers insights ...
Read more >
Not all log levels are being logged in Application Insights
We had the same problem, and our solution was to set a filter to LogLevel.Trace , and match the filter category with the...
Read more >
Redacting sensitive information with Application Insights in C#
This article teaches you how to redact sensitive information in Application Insights when you send traces from your .NET applications.
Read more >
Azure Application Insights Tutorial | Amazing telemetry service
In this video I will show you why Azure Application Insights is the ... Querying application telemetry logs - Code-less monitoring Next ...
Read more >
How To Get The Orchestrator Jobs Logs In Azure ...
Follow the below steps,. Go to the Orchestrator App Service and under the Settings Option there is a Application Insights-> Click on Enable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found