Giter Site home page Giter Site logo

logrocket-fuzzy-search-sanitizer's Introduction

๐Ÿš€ LogRocket Fuzzy Search Sanitizer

Build Status

Optional LogRocket plugin to help sanitize data from network requests and responses.

Blog post


When initializing LogRocket's SDK you can optionally provide a requestSanitizer and responseSanitizer method within the network option, which are called on each network request within your app. This is useful when you need to prevent some requests/responses or sensitive data within headers, payloads, etc. being sent to LogRocket's servers and replays.

This plugin provides pre-configured requestSanitizer/responseSanitizer methods which sanitize network payloads by the field names within each payload. This allows you to still capture every network request within in your app, getting the monitoring benefits provided by LogRocket, while allowing an easy way to mask the sensitive data in your app.

Usage

Note: You must have LogRocket installed and an app ID ready to use. See the quickstart docs.

Steps

  1. Import this plugin along with LogRocket
  2. Call the setup method on this plugin, passing an array of the private field names
    • the setup method returns a hash with the 2 sanitizer methods
  3. Init LogRocket
  4. Specify a configuration with the network option and pass in the sanitizer methods

Example

import LogRocket from 'logrocket';
import LogrocketFuzzySanitizer from 'logrocket-fuzzy-search-sanitizer';

const { requestSanitizer, responseSanitizer } = LogrocketFuzzySanitizer.setup([...privateFieldNames]);

LogRocket.init('app/id', {
  network: {
    requestSanitizer,
    responseSanitizer
  }
});

Private Field Names

This is the first argument passed to the setup method, and should be an array of strings that represent the private field names that could potentially be found in any request/response within your app.

For example, if your app obtains user sensitive data such as social security numbers, first name, date of birth, etc.:

import LogRocket from 'logrocket';
import LogrocketFuzzySanitizer from 'logrocket-fuzzy-search-sanitizer';

const privateFieldNames = [
  'ssn',
  'firstName',
  'birthDate'
];

const { requestSanitizer, responseSanitizer } = LogrocketFuzzySanitizer.setup(privateFieldNames);
LogRocket.init('app/id', {
  network: {
    requestSanitizer,
    responseSanitizer
  }
});

Now when requests and responses get passed through the sanitizer methods, any field name containing "ssn", "firstName", or "birthDate" will be masked and hidden from LogRocket.

Running / Development

  • npm install
  • Make any changes, bug fixes, etc.
  • Run tests: npm run test && npm run lint

logrocket-fuzzy-search-sanitizer's People

Contributors

jbailey4 avatar paambaati avatar pkriete avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.