Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
output-scrubber
Advanced tools
A tool to obscure sensitive output in stdout and stderr. Provide it a list of regular expressions and corresponding replacement strings, and when included in a program it will automatically do the replacement in stdout and stderr. The intent of this module is to make it easy to ensure certain types of sensitive info (such as SSNs or PINs) do not end up in log files.
npm i --save output-scrubber
First include the module:
const outputScrubber = require('output-scrubber');
Then create a list of filters, each of which is a list with 2 items, the regular expression pattern to be matched, and string to use for replacement:
const patterns = [
[/\d{3}-\d{2}-\d{4}/g, 'XXX-XX-XXXX'],
[/\$[0-9,.]+/g, '$XX.XX'],
[/\d{4}/g, 'XXXX'],
];
Finally activate the filtering, passing the list of patterns:
outputScrubber.activate(patterns);
Any standard out or standard error output after this point will be filtered. To turn off filtering, use the following call:
outputScrubber.deactivate();
To execute a simple test script, run the following:
npm test
Pull requests are welcomed. Please lint all changes with npm run lint
before submitting. Also review
the Contributing Guidelines and the Code of Conduct.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
FAQs
Automatically obscure sensitive output in stdout and stderr.
We found that output-scrubber demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.