Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What will happen if ApplicationInsights InstrumentationKey gets stolen?

I am working on Angular Application and I want to add Azure Application Insights in my Angular SPA.

I have added all required configuration and Everything works perfectly fine.

Application Insights will logs all required details like PageView and custom events with the Help of InstrumentationKey.

But I have one doubt, that What will happen if ApplicationInsights InstrumentationKey gets stolen? InstrumentationKey is exposed to external world and anyone can see it.

So my question is, Is there any problem if somebody gets this key? what are replications if InstrumentationKey gets stolen and how can we avoid it?

I have gone through this article already - https://blogs.msdn.microsoft.com/premier_developer/2017/12/14/alternative-way-to-protect-your-application-insights-instrumentation-key-in-javascript/

like image 609
sudarshan1933 Avatar asked Feb 05 '19 13:02

sudarshan1933


People also ask

What is the use of ApplicationInsights config?

By adjusting the configuration file, you can enable or disable Telemetry Modules and initializers, and set parameters for some of them. The configuration file is named ApplicationInsights. config or ApplicationInsights. xml , depending on the type of your application.

Which method does UseApplicationInsights use?

The extension method UseApplicationInsights() is still supported, but it's marked as obsolete in Application Insights SDK version 2.8. 0 and later. It will be removed in the next major version of the SDK.

What is instrumentation key in application insights?

The instrumentation key identifies the resource that you want to associate your telemetry data with. You will need to copy the instrumentation key and add it to your application's code.

What is application insights connection string?

Connection strings define where to send telemetry data. The key value pairs provide an easy way for users to define a prefix suffix combination for each Application Insights (AI) service/ product.

Can application insights instrumentation key be used on server side?

Application Insights instrumentation key can be used in both Server and client side. Using the instrumentation key in the server side is secured and no one can see it. The opposite happens on the client side “JavaScript” where the instrumentation key is exposed, and anyone could see the key whenever they use fiddler to trace the calls.

What happens to the instrumentation keys once the client is off?

The key point is that each client gets a unique short-duration instrumentation key, that's all you can control, you can't control what happens to the keys once's they are off your servers.

How to get the appinsights instrumentation key from the pipeline?

It receives the resource group name and the AppInsights name via pipeline variable. The instrumentation key gets written to the third pipeline variable appInsights_instrumentationkey.

How to get appinsights instrumentation key using PowerShell?

Regarding Microsoft’s documentation there is a PowerShell function to do this Called Get-AzureRmApplicationInsights. However this function did not return any value (and no error). appInsights_instrumentationkey receives the instrumentation key It receives the resource group name and the AppInsights name via pipeline variable.


1 Answers

As described in the blog,

Alternatively, the most secure way would be to send data from the browser to your custom API on your server then forward to Application Insights resource with the correct instrumentation key (see diagram below).

enter image description here

You should validate if the data makes sense in your custom API before sending it to the Application Insights instance.

Here are a couple of more threads on the same issue:

Application Insights security and spoofing

https://github.com/MicrosoftDocs/azure-docs/issues/24287

like image 178
AmanGarg-MSFT Avatar answered Dec 05 '22 00:12

AmanGarg-MSFT