Javascript sensitive data not removed

tomsterritt

Posted on
Apr 16 2015

I'm trying to filter passwords from info sent to Raygun using the following as per the docs:

Raygun.init('...').attach().filterSensitiveData(['password']);

However I'm still seeing passwords in UserCustomData.requestData.

How do I properly ensure no passwords are sent in error logs?

Thanks


Callum

Posted on
Apr 16 2015

If I've correctly found the payload you're referring to, the value of requestData is an escaped JSON string, and not an Object that can be recursively filtered by filterSensitiveData() (it could also have been XML etc). In order to filter this you could call

filterSensitiveData(['requestData'])

instead, but the intended API which provides complete control over the final payload is the onBeforeSend function at https://github.com/MindscapeHQ/raygun4js#onbeforesend, and would be more appropriate for your scenario. In this way you can provide a callback which mutates the requestData key in the payload, replacing the password as needed with a regex for instance.


tomsterritt

Posted on
Apr 16 2015

Ok, I wasn't sure if that was just how it was displayed on the dashboard, thanks!


Reply