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

Aperta
#7,263 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rails, ruby
Ambito
backend, security

Direzione di ricerca

Start with config/initializers/filter_parameter_logging.rb and config/initializers/bugsnag.rb, then inspect the existing parameter filtering specs and SECURITY.md. Add filtering coverage for the listed keys, review how set_user and Bugsnag request URLs are handled, and document the vendor data policy. Done means the requested sensitive values are filtered or redacted, the behavior is covered by specs, and the policy is documented.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

⛓️ Security Difficulty: Intermediate Help Wanted

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 #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).

Lingua principale
Ruby
Stelle
382
Fork
547
Merge medio
3g 3h
PR unite (30g)
39

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rubyforgood/casa

Tutte le issue di rubyforgood/casa

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.