Skip to content

Filter youth/volunteer PII from logs and Bugsnag (notes, case_number, DOB, phone…) #7263

Open

Description

@compwron

Problem

CASA data is about foster youth, so anything we send to third parties (Bugsnag, Scout APM, Heroku/log drains) should be the minimum needed to debug.

config/initializers/filter_parameter_logging.rb filters only passw, email, secret, token, _key, crypt, salt, certificate, otp, ssn, cvv, cvc. These are permitted request params that aren't filtered, so they appear in Rails logs and in the request metadata Bugsnag attaches to errors:

Param Where Why it matters
notes, content case contacts, notes, court orders free-text narrative about a youth
case_number casa cases, imports juvenile court case number
birth_month_year_youth, date_of_birth casa cases, users DOB
display_name, phone_number, address users, volunteers volunteer PII

Also:

  • config/initializers/bugsnag.rb calls event.set_user(current_user&.id, current_user&.email). The user id is enough to look someone up. Consider sending only the id.
  • Case URLs contain the case-number slug (/casa_cases/cina-21-1234), so it ends up in router logs and Bugsnag App URL. That will matter more once Include the org in CASA case URLs and finish the switch away from database ids #7106 lands org + case number in the path. Look at Bugsnag's redacted_keys / an add_on_error callback that rewrites request.url, and Heroku log drains.

Tasks

  • Add :notes, :content, :case_number, :birth, :phone, :address, :display_name, :first_name, :last_name to filter_parameters (it's substring-matched, so check nothing we need in logs gets swallowed)
  • Add a spec asserting those keys are filtered (ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters).filter(...))
  • Decide on set_user email vs id only
  • Bugsnag callback that redacts case slugs from event.request[:url] / context
  • Note the policy in SECURITY.md: what we send to which vendor

Related: safe read-only observability access (see linked issue).

Activity

  1. muhammadsamad99 commented on Nov 4, 2026

    @muhammadsamad99

    Hi, I'd like to take this one. I'd start with the first two tasks: add the listed keys to filter_parameters (checking that the substring matches don't hide anything the logs need), and a spec that asserts they're filtered through ActiveSupport::ParameterFilter. Should set_user (id only), the Bugsnag URL callback and the SECURITY.md note go in the same PR or separate ones? #7333 is also editing config/initializers/bugsnag.rb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: IntermediateMulti-domain or moderate coding knowledgeHelp WantedLooking for contributors⛓️ SecurityRelated to data safety and security

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions