-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to keep your application insights connection string secret? #136
Comments
Haven't dug into it myself, but it does look like there's an authenticated option: "If you want to protect your Application Insights resource from misuse, the ingestion endpoint provides authenticated telemetry ingestion options based on Microsoft Entra ID." https://learn.microsoft.com/en-us/azure/azure-monitor/app/connection-strings You could also set custom endpoints for ingestion and set up a proxy that filters things before passing them on. |
This is a known issue, but generally as the connection string only grants any potential "bad actor" the ability to "submit" telemetry, it's generally not considered to be (specifically) a security issue. And while cost based attacks are possible they are rarely (even for huge internal Microsoft sites) performed as there are several ways to control costs if this scenario occurs
Other potential options (not fully supported) exist around the usage of an Entra Id, but this introduces a timing and/or security issue related to
Additionally, when ingestion traffic is authenticated, and the sender (the client) is not (doesn't have any token), then you won't receive any telemetry about what going on (because it's all rejected), so you actually wouldn't know if
I've worked on many front end systems and implemented many "verification" steps (simple CSRF to full authentication) and the anonymous flows are the trickiest to "restrict" as any determined bad actor can always work around anything you put in place, especially it they just want to spam you with some bogus / overloaded events -- ie. they don't have to use a browser and therefore they are not restricted to CORS or any other browser imposed constraints, they can just fire up a simple app that uses HTTP(S) requests to obtain your details and then send them at whatever endpoint exists as all "client" traffic should always be considered as untrusted. |
I'm new to application insights in frontend SPA applications. But I don't feel comfortable putting the application insights connection string for all to see in the react code as the samples suggests.
What's to prevent anyone from taking the connection string and use it to drive up my hosting costs or log lots of false errors and exceptions?
Is there another way to do this? Or am I overthinking things?
The text was updated successfully, but these errors were encountered: