nebulize
v0.9.6
Published
Nebulize Security-Sensitive Information
Downloads
6
Maintainers
Readme
Nebulize
Nebulize Security-Sensitive Information
About
Nebulize is a small JavaScript library, providing the capability to
nebulize security-sensitive information in data by anonymization
(replacing with random-based UUID version 4), pseudonymization
(replacing with hash-based UUID version 5), blacking (replacing with #
characters) or substitution (replacing with custom characters). This
nebulization approach is especially intended to support applications in
their filtering of log messages from sensitive information in order to
be compliant to the EU General Data Protection Regulation (GDPR).
Installation
$ npm install nebulize
Usage
const Nebulize = require("nebulize")
const expect = require("chai").expect
let ds = new Nebulize()
ds.filter("**", "foo", "bar")
expect(ds.nebulize("foo")).to.be.equal("bar")
let data = {
foo: "foo", bar: 42, baz: true,
quux: [ "foo", 42, true ],
username: "example",
password: "secret"
}
Application Programming Interface (API)
new Nebulize(): Nebulize
: Create a new Nebulize context.Nebulize#filter(pathMatch: string|function, dataMatch: RegExp|string|number|boolean|function, dataReplace: string|number|boolean|function): Nebulize
: Add a filter to the context, based on tree parameters:pathMatch
: either a Unix glob pattern string or a callback function of signature(path: string) => boolean
. The callback function receives the path from the root of thedata
object (as passed to methodnebulize()
) to the current nebulized leaf object as a dot-separated path and has to returntrue
when thedataMatch
anddataReplace
should be applied.dataMatch
: FIXMEdataReplace
: FIXME
Nebulize#nebulize(data: any): any
: Nebulize arbitrary data based on filters in context. Thedata
is recursively traversed and all filters applied to all leaf data.
License
Copyright (c) 2018-2021 Dr. Ralf S. Engelschall (http://engelschall.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.