impove rails logs for sensitive info in emails or delay jobs
can we work on this PR https://github.com/rails/rails/pull/33756 to improve the issue on devise to prevent password reset tokens leak? https://github.com/plataformatec/devise#password-reset-tokens-and-rails-logs
Hey, @reckerswartz thanks for mentioning this, I didn't know about that PR.
I might be wrong, but I don't think it will prevent the leak mentioned in your readme because that patch was added to ActiveRecord, to prevent a model to be printed out with that parameters. However, the issue mentioned in the readme is when logging emails sent or jobs, so that would probably have to be added to ActiveMailer and ActiveJob, but I'm not sure how that could be done.
@tegon Thanks for the reply, I am working rails community to get confirmation about the PR whether we can modify it for our need or need to generate fresh PR for the thing. if not I will close the issue soon.
@tegon before I start work on new PR can you please confirm that whether we can use filter_parameters method or not
Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:reset_token]
That config works for query and request parameter logs, but not for mailers and jobs. Either way, I'm going to close this because it's more related to the way Rails works than to Devise itself.
Thanks!