Coder Social home page Coder Social logo

mrexox / sentry-sanitizer Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 3.0 142 KB

Sanitizing middleware for sentry-ruby gem

License: BSD 3-Clause "New" or "Revised" License

Ruby 99.51% Shell 0.49%
sentry-ruby sentry-sanitizer sentry sentry-plugin ruby sanitizer

sentry-sanitizer's Introduction

CI Gem Version Coverage Status

sentry-sanitizer: sanitizing extension for sentry-ruby

This gem aimed to add sanitizing support to sentry-ruby gem.

sentry-raven gem had this apportunity but it is no longer supported. Moving from sentry-raven to sentry-ruby can surprise you with missing this ability. But you can still use sentry-sanitizer (with a little change to configuration).

Currently this gem provides following features

  • Sanitizing POST params
  • Sanitizing HTTP headers
  • Sanitizing cookies
  • Sanitizing query string
  • Sanitizing extras (see Sentry.set_extras)

Installation

โš ๏ธ Please, don't use 0.1.* version as it was experimental and not usable at all.

Add this line to your application's Gemfile:

gem 'sentry-sanitizer', '>= 0.2.0'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sentry-sanitizer

Usage

Add following lines to your Sentry configuration:

Sentry.init do |config|
  # ... your configuration

  # If using Rails
  config.sanitize.fields = Rails.application.config.filter_parameters

  # You can also pass custom array
  config.sanitize.fields = %w[password super_secret_token]

  # HTTP headers can be sanitized too (it is case insensitive)
  config.sanitize.http_headers = %w[Authorization X-Xsrf-Token]

  # You can sanitize all HTTP headers with setting `true` value
  config.sanitize.http_headers = true

  # You can sanitize all cookies with this setting
  config.sanitize.cookies = true

  # You can sanitize query string params for GET requests
  config.sanitize.query_string = true

  # ...
end

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mrexox/sentry-sanitizer.

License

The gem is available as open source under the terms of the BSD-3-Clause License.

sentry-sanitizer's People

Contributors

anderscarling avatar mrexox avatar sco11morgan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sentry-sanitizer's Issues

Cleaning of query params

It would be nice if sentry-sanitizer would be able to filter query params as well, as they obviously can contain sensitive data too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.