Skip to content

Commit 53a52e3

Browse files
ghiculescubyroot
authored andcommitted
Add cvv and cvc as default parameters to filter out in new apps
In general you should not be posting credit card details to your server, you should be using a processor like Stripe or Braintree. But if you make a mistake in your form and *do* post a user's credit card number, those details will get logged by default, even if your server doesn't use them. Now you're potentially "storing card data" and so you have a whole bunch more legal requirements to do it securely. This PR adds `cvv` and `cvc` to the defaults for [`ActiveSupport::ParameterFilter`](https://api.rubyonrails.org/v7.1.3.4/classes/ActiveSupport/ParameterFilter.html) for new apps. This means that params with those names will not get logged by default. This just changes the template for new apps; there's no changes made to existing apps.
1 parent e0a9ef1 commit 53a52e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# Use this to limit dissemination of sensitive information.
55
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
66
Rails.application.config.filter_parameters += [
7-
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
7+
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
88
]

0 commit comments

Comments
 (0)