4 ms·
Not that hard [1]: Rails.application.config.filter_parameters += [ :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :s
by nomilk 2y ago
Not that hard [1]:
Rails.application.config.filter_parameters += [
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp,
:ssn, :cvv, :cvc
]
[1] https://github.com/rails/rails/blob/8a2e28d7451d5ae4cb194fccc125a6b9554bb38b/railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt#L6-L8 https://github.com/rails/rails/blob/8a2e28d7451d5ae4cb194fcc...
- vidarh 2y agoAssuming, of course, that the data is logged as a parameter rather than as a raw string, or as an instance variable in another object, or any number of other ways. Developers thinking it is "not that hard" is a big red flag to me, suggesting odds are high your logs are full of things that should not be there. Using filters is a first step only.