Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check our parameter sanitisation and filtering for logging & sentry #529

Open
lukeify opened this issue Jan 25, 2024 · 2 comments
Open

Check our parameter sanitisation and filtering for logging & sentry #529

lukeify opened this issue Jan 25, 2024 · 2 comments
Assignees
Labels
discuss Discussion required

Comments

@lukeify
Copy link

lukeify commented Jan 25, 2024

We have these lines of code in our backend_base variant:

gsub_file "config/initializers/filter_parameter_logging.rb", /\[:password\]/ do
"%w[password secret session cookie csrf]"
end

These have not been touched in several years and now differs from what Rails provides. We should re-establish what our baseline is here compared to vanilla Rails. Some questions:

  • How many of our filter_parameters are valid in 2024?
  • How many of our filter_parameters are devise-related?
  • Do we want to append to the existing Rails configuration instead of performing a gsub?
  • What is the intent behind the ssn in the Rails vanilla config? (Social Security Number?)
  • Does Sentry look at this file to determine its own parameter filtering?
    • If no, should we align our Sentry and logging parameterization filtering?
@G-Rath
Copy link
Contributor

G-Rath commented Jan 25, 2024

This is what I currently have locally to address this:

gsub_file "config/initializers/filter_parameter_logging.rb", /\+= \[\n/ do
  "+= [:password, :secret, :session, :cookie, :csrf,\n"
end

@eoinkelly
Copy link
Contributor

Since our recent Rails 7.1 and 7.2 upgrades, we add 3 parameters:

gsub_file! "config/initializers/filter_parameter_logging.rb",
/:ssn/,
":ssn, :session, :cookie, :csrf"

I assume :ssn is the American Social Security Number.

I'm not sure what purpose our additions serve in 2024. Please add a comment if you have a use-case for them. I think we should 1) remove any we can't make a case for and 2) document those we can.

@eoinkelly eoinkelly added the discuss Discussion required label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Discussion required
Projects
None yet
Development

No branches or pull requests

3 participants