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.
bunyan-sql-stream
Advanced tools
This package creates a Bunyan stream that can write to a number of different SQL databases.
Currently, it supports:
The stream maps the default Bunyan log fields to table columns and also stores the entire log message. Depending on your database's capabilities, it will attempt to store the message in a json
, jsonb
, or text column type.
npm install --save bunyan-sql-stream
First, create the table you want to store your logs in:
create table if not exists "public"."logs" (
"id" serial primary key,
"name" text,
"level" integer,
"hostname" text,
"msg" text,
"pid" integer,
"time" timestamptz,
"content" jsonb
)
Then, use the package as a Bunyan stream:
const logger = bunyan.createLogger({
name: 'sql stream',
level: 'info',
stream: bunyanSqlStream({
client: 'pg',
connection: {
host: 'localhost',
user: 'postgres',
password: 'password',
database: 'db'
},
tableName: 'logs'
})
})
This package uses the same client and connection options as Knex.js.
You'll also need to install a database client for each type of database you'll be logging to.
For example, if you're using PostgreSQL:
npm install --save pg
The package should issue an error message that will tell you which module to install once you set the client option.
This package depends on Knex.js. If want to minimize dependencies, you might prefer another module:
Pull requests welcome.
MIT © Forrest Desjardins
FAQs
Stream your Bunyan logs to your favorite SQL database
The npm package bunyan-sql-stream receives a total of 18 weekly downloads. As such, bunyan-sql-stream popularity was classified as not popular.
We found that bunyan-sql-stream 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.
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.