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.
@ips-hosting/pino-sentry-stream
Advanced tools
A pino stream to automatically pass errors to Sentry.
# npm
npm install @ips-hosting/pino-sentry-stream
# yarn
yarn add @ips-hosting/pino-sentry-stream
The code is compiled to target Node.js 14.
import { pinoSentryStream } from '@ips-hosting/pino-sentry-stream'
import * as Sentry from '@sentry/node'
// ...
/**
* Available options:
* sentry (required): The Sentry SDK
* severityMap (optional): Maps pino levels to sentry severities. See index.ts for an example and the default mapping.
* callback (optional): (obj: { log: PinoLog; scope: Sentry.Scope; severity: Sentry.Severity }) => void | false
* Called for every pino log message. Use to assign custom properties to the sentry scope. Return false to prevent that message from being sent to sentry.
*/
const stream = pinoSentryStream({ sentry: Sentry });
// With pino
// All messages will directly go to Sentry.
// They won't be passed to stdout so you don't see them in your terminal.
const pinoOpts = { /* ... */ };
const pinoLogger = pino(pinoOpts, stream);
// With pino-multi-stream
// You can send log messages to multiple destination streams.
// In this example, log messages are sent both to stdout and Sentry, while being prettified in development.
const pinomsLogger = pinoms({
// ...
streams: [
// Log everything to stdout in production, prettify in dev environments.
{
level: 'debug',
stream: process.env.NODE_ENV === 'production'
? process.stdout
: pinoms.prettyStream(),
},
// In addition to logging to stdout, send everything starting from level info to sentry.
{
level: 'info',
stream,
},
],
})
FAQs
A pino stream to automatically pass errors to Sentry.
The npm package @ips-hosting/pino-sentry-stream receives a total of 34 weekly downloads. As such, @ips-hosting/pino-sentry-stream popularity was classified as not popular.
We found that @ips-hosting/pino-sentry-stream demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.