-
Notifications
You must be signed in to change notification settings - Fork 0
Filtering sensitive data
END OF SUPPORT WARNING: On November 24, 2016 Airbrake v4 won't be supported anymore and this wiki will be deleted. Read more & discuss: https://github.com/airbrake/airbrake/issues/596
DEPRECATION WARNING: The information presented on this page is related to Airbrake v4 only. If you seek for information for Airbrake v5, please refer to our README!
To replace sensitive information sent to the Airbrake service with [FILTERED]
use one of these approaches:
Data which is defined in blacklist filters will be replaced with [FILTERED]
##### Where will filters be applied?
Once set blacklist filters will filter matching keys in params
, sessions
and cgi_data
.
##### What is in the default list of blacklist filters? `["password", "password_confirmation"]`
These are in the config.params_filters
array in your Airbrake initialization file (airbrake.rb
).
##### Adding/Modifying the default filter list (In your `airbrake.rb` file)
config.params_filters << [:foo, /bar/, "credit_card"]
config.params_filters << "credit_card"
config.params_filters = ["credit_card"]
config.params_filters = []
All data which is not defined in whitelist filters will be replaced with [FILTERED]
##### Where will filters be applied?
Once set whitelist filters will be applied to params
, sessions
and cgi_data
.
##### Which are default?
By default, all params are whitelisted []
##### Using whitelist filters
(In your airbrake.rb
file)
config.params_whitelist_filters = ["username"]
config.params_whitelist_filters << "good_to_go"
config.params_whitelist_filters << [:foo, /bar/, "visible"]
Note that, when rescuing exceptions within an ActionController method, airbrake will reuse filters specified by #filter_parameter_logging.