-
We have a regular server application with a frontend. We've been using Sentry to capture events from the backend and would like to start capturing events from the browser as well. As far as I can tell we'll have to include the client key in the browser for this, which would expose it to the public. Now, we can (and will) specify which http origins we allow events from, but what about someone using this client key to just generate some server-side script and spam our project with events? I don't see any way in the settings to have a separate public key to use in browser context, while using a secret key for our server-side component. What's the recommended approach here? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
hi @pkruithof We are aware of this concern, but in truth I can't say that I recall ever hearing of this happening to someone. You could consider having 2 separate projects, 1 for your server app and one for your frontend. Then you would have a DSN and project per app. You have to sentry inits in your setup correct? You can also create additional DSNs in project settings: https://sentry.io/settings/projects/[your-project-slug]/keys/ What is your setup exactly? Is it a php laravel server app with vue for example? It is a user facing frontend, or an admin dashboard type thing? |
Beta Was this translation helpful? Give feedback.
-
Our setup is a Symfony backend with a vanilla-js, user faced frontend (well it uses Stimulus but that's about it). I asked around our organization and other teams did the 2-project setup like you mentioned. This seems a bit weird though since you have to setup and manage separate projects, and it gets harder to correlate certain events (maybe some backend change triggers issues in the frontend). So I'd rather have the single-project setup. While I don't think it's a security risk per se (although I'm not sure if you can read data with the client key?), and it's mainly an inconvenience should this key get used by others for spamming, all security-related experience/knowledge I have dictates a principle of least privilege. It would be great if you could have 2 types of client keys:
|
Beta Was this translation helpful? Give feedback.
Our setup is a Symfony backend with a vanilla-js, user faced frontend (well it uses Stimulus but that's about it). I asked around our organization and other teams did the 2-project setup like you mentioned. This seems a bit weird though since you have to setup and manage separate projects, and it gets harder to correlate certain events (maybe some backend change triggers issues in the frontend). So I'd rather have the single-project setup.
While I don't think it's a security risk per se (although I'm not sure if you can read data with the client key?), and it's mainly an inconvenience should this key get used by others for spamming, all security-related experience/knowledge I have dictate…