the issue with filter_parameters

florian.w

Posted on
Dec 05 2014

hi,

we use raygun with rails.

is there any option for a whitelist? we cant add all fields to config.filter_parameters. we want that all params are filtered except a few.

this is a huge issue for us.


florian.w

Posted on
Dec 09 2014

some help(?):

 # config/initializers/parameter_whitelisting.rb
    WHITELISTED_KEYS_MATCHER = /((^|_)ids?|action|controller|code$)/.freeze
    SANITIZED_VALUE = '[FILTERED]'.freeze

    config.filter_parameters << lambda do |key, value|
      unless key.match(WHITELISTED_KEYS_MATCHER)
        value.replace(SANITIZED_VALUE)
      end
    end

nikz

Posted on
Dec 10 2014

Heya Florian!

Long time no chat! :)

Do you mind if I ask why you're looking for this? Looks like any solution will not only require a whitelist, but also some kind of regex/pattern matching (to allow for the _ids case). This is quite complicated, so I just want to dig in a bit to see if there's not something more simple we can do.

Cheers,

Nik


florian.w

Posted on
Dec 10 2014

hi nikz :)

that regex for ids was just a example (http://blog.appsignal.com/blog/2013/04/18/filter-sensitive-data-from-params.html)

we are dealing with high sensitive data and we dont want that any of this is send to raygun except a few.

thats why we need an whitelist.

or something like:

config.filter_parameters = :all, except: [:id, :date, :foo]

florian.w

Posted on
Dec 17 2014

hey nikz,

are you guys working on that issue or do we need to find a other solution?


nikz

Posted on
Dec 18 2014

Hey Florian,

I'm working on something :)

Cheers,

Nik


nikz

Posted on
Dec 20 2014

Hey Florian,

Could you try out https://github.com/MindscapeHQ/raygun4ruby/pull/56 for me?

Note that I've yielded the entire params hash rather than iterating through keys, as I thought this would give you more flexibility (i.e if you want to send absolutely nothing to Raygun, then just returning {} from that Proc will work).

Raygun.setup do |config|

  ...
   config.filter_parameters do
      # whatever you want :)
   end
  ...

end 

Nik


nikz

Posted on
Dec 24 2014

Hey Florian,

Wonder if you've had a chance to try this out? I'm looking to do a new release after Christmas and it would be great to get this in!

Happy holidays!

Nik


florian.w

Posted on
Dec 30 2014

Hi nikz,

i could test it next week, but our trial has expired. can you extend our trial version for a view days?

happy new year :)

florian


John-Daniel Trask

Raygun

Posted on
Dec 30 2014

Hi Florian,

I've extended your trial for you. Let me know if you have any issues.

Have a great new years :-)

John-Daniel Trask
Co-founder & CEO
Mindscape Limited


florian.w

Posted on
Jan 08 2015

Hi guys,

@john: thank you :)

@nikz: its working. Do you merge it into the trunk? i need this branch + the branch with the proxy settings :)

greetings florian


nikz

Posted on
Jan 08 2015

Hey Florian,

Good to hear! Planning to do a release this evening. Will drop a note in here once I've done that.

Cheers,

Nik


nikz

Posted on
Jan 08 2015

Hey Florian,

Version 1.1.5 is now live!

Cheers,

Nik


florian.w

Posted on
Jan 08 2015

hey nikz,

thank you for the great work.

greetings florian


nikz

Posted on
Jan 08 2015

No problems :) Let me know if you hit any other issues.


Reply