Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@titelmedia/scoped-sentry-reporter
Advanced tools
This package enables you to manage several sentry instances
In most cases, it is sufficient to initialize Sentry on a project level. Unfortunately, we needed a solution in which errors from different sources (javascript files) can be reported to different Sentry DSNs. We embed scripts from other projects that can also run on their own, directly into our main platform.
This repo deals with abovementioned errors and makes sure sourcemaps are working.
yarn add @titelmedia/scoped-sentry-reporter
npm install @titelmedia/scoped-sentry-reporter --save
import ReporterManager from '@titelmedia/scoped-sentry-reporter';
// const ReporterManager = require('@titelmedia/scoped-sentry-reporter/src/index.es5.js').default;
// instead of Sentry.init, you'd call
ReporterManager.initSentry('YOUR_DSN@sentry.io/GOES_HERE', [/.*/], {
/* REGULAR SENTRY OPTIONS */
});
The function initSentry
expects an array of regular expressions as the second argument. With these, you can define patterns so that stackTraces
will be picked up and logged into the defined Sentry account.
ReporterManager.initSentry('YOUR_DSN@sentry.io/GOES_HERE', [/.*\/path\/to\/a\/file\.js/]);
The conditional logic is based on the Boolean operator or
and will log the error to the respective DSN if one of the urls in the stackTraces
match one of the conditions.
ReporterManager.initSentry('YOUR_DSN@sentry.io/GOES_HERE', [
/.*\/a\.js/,
/.*\/b\.js/,
/.*\/c\.js/
]);
Use a default reporter when nothing matches your conditions.
// Let's say that you get an error d.js that will not be logged, because conditions do not match.
ReporterManager.initSentry('YOUR_DSN@sentry.io/GOES_HERE', [/.*\/(a|b|c)\.js/]);
// After setting a default reporter all errors that cannot be reported to any instance
// will end up in this project.
ReporterManager.setDefaultReporter('YOUR_DSN@sentry.io/GOES_HERE', {
/* REGULAR SENTRY OPTIONS */
});
One big culprit could be that you'd expect the manager to report one error to all instances. This is not intended to work. The error should be logged into the Sentry instance that is closer to the thrown error location - this saves some duplicates on different Sentry projects.
Aditionally, the reporter only works in browsers.
FAQs
This package enables you to manage several sentry instances
We found that @titelmedia/scoped-sentry-reporter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.