Repository navigation
Mask the filter list in Rollbar reports - #2064
Conversation
load_defaults 7.1 and later precompile filter_parameters into one Regexp, and rollbar 3.8.0 escapes that Regexp into a literal, so Rollbar's request scrubbing ignored the whole filter list. Sign-in tokens such as google_id_token, facebook_id_token and apple_refresh_token went to Rollbar in clear on any error. Copy the filter list's plain names into Rollbar's scrub_fields, in a new initializer that loads after filter_parameter_logging.rb (01_rollbar.rb loads before it, so a copy there is empty). Also mask the session cookie and the Referer header. The spec runs Rollbar's own request extraction on made-up values. All five examples failed before this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 agent-review · ✅ no blockers · risk HIGH BLOCKERS: fix or dismiss to pass✅ No blockers. OTHER FINDINGS (8)
🔧 Fix suggestions (0)No automated fixes for this review. 📦 Dependency impactIndex disabled. 📊 Review detail & statsGenerated: 2026-11-19 · Day: Thursday · Files changed this pass: 2 (+3 -0 lines; full PR +97 -0) Risk factors detected: config_security_change (full PR) Deterministic evidence:
Agent summary (bands: Critical 9-10 · High 7-8 · Important 5-6 · Suggestions 3-4):
Per-agent perspectives on blockers: none (no blockers). Engine: code-review (from config) · effort xhigh (from config) · model opus (from config)
Review quality:
💬 How to act on this reviewEvery finding above is numbered. Severity ≥ 7 findings carry a checkbox and must each be fixed or |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agent-review: the bot took back its approval of 2a55483 because the PR changed beyond merging in the default branch. Run /agent-review:re-review (or /agent-review:review) and post the report. The bot approves again when the report passes for the new head.
|
I see you added the "On Staging" label, I'll get this merged to the staging branch! |
What
Rollbar reports now mask every name on the app's filter list (
token,secret,passwand the rest), plus the session cookie and theRefererheader.Why
With
load_defaults7.1 or later, Rails turnsfilter_parametersinto one compiled Regexp. rollbar 3.8.0 escapes that Regexp into a literal string, so it matches nothing, and Rollbar's request scrubbing ignored the whole filter list. Only Rollbar's own short default list (password,access_tokenand a few more) was masked.In this app that means sign-in requests to
POST /authsentgoogle_id_token,facebook_id_tokenandapple_refresh_tokento Rollbar in clear whenever the request raised an error. The same gap affects most of the Rails fleet; cap#968 and global360#549 fix it the same way.How
config/initializers/rollbar_scrub_fields.rbcopies the filter list's plain names into Rollbar'sscrub_fields. It has to load afterfilter_parameter_logging.rb, and01_rollbar.rbloads before it (a copy there comes out empty), so it lives in its own file._mobile_content_api_sessiontoscrub_fieldsandReferertoscrub_headers(a Referer can repeat a token from the page URL).Authorizationis already masked by Rollbar's default.Tests
spec/initializers/rollbar_spec.rbruns Rollbar's own request extraction on made-up values: every filter-list name in a form post, the sign-in tokens in a JSON:API body (dashed and underscored names), the invite token, the session cookie, and theAuthorizationandRefererheaders. All 5 examples failed before the fix and pass after.CI=true):scrub_fieldsholds every filter-list name and the session cookie.🤖 Generated with Claude Code