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.
diagnostic-channel-publishers
Advanced tools
A collection of pre-built module patches that enable existing npm modules to publish diagnostic data
The diagnostic-channel-publishers npm package provides a way to publish diagnostic data from various popular Node.js modules. It allows you to instrument your application to collect telemetry data, which can be useful for monitoring, debugging, and performance analysis.
HTTP Request Monitoring
This feature allows you to monitor HTTP requests made by your Node.js application. The code sample demonstrates how to enable HTTP request monitoring and subscribe to the 'http' channel to log the details of each request.
const { channel } = require('diagnostic-channel');
const { enable } = require('diagnostic-channel-publishers').http;
enable();
channel.subscribe('http', (message) => {
console.log('HTTP request:', message);
});
MongoDB Query Monitoring
This feature allows you to monitor MongoDB queries executed by your Node.js application. The code sample shows how to enable MongoDB query monitoring and subscribe to the 'mongodb' channel to log the details of each query.
const { channel } = require('diagnostic-channel');
const { enable } = require('diagnostic-channel-publishers').mongodb;
enable();
channel.subscribe('mongodb', (message) => {
console.log('MongoDB query:', message);
});
Redis Command Monitoring
This feature allows you to monitor Redis commands executed by your Node.js application. The code sample demonstrates how to enable Redis command monitoring and subscribe to the 'redis' channel to log the details of each command.
const { channel } = require('diagnostic-channel');
const { enable } = require('diagnostic-channel-publishers').redis;
enable();
channel.subscribe('redis', (message) => {
console.log('Redis command:', message);
});
Winston is a versatile logging library for Node.js that allows you to log messages to various transports (e.g., console, file, HTTP). While it does not provide the same level of automatic instrumentation as diagnostic-channel-publishers, it is highly configurable and can be used to log diagnostic data manually.
Bunyan is another logging library for Node.js that focuses on structured logging. It provides a simple API for logging messages and supports various output formats. Like Winston, it does not offer automatic instrumentation but can be used to log diagnostic data manually.
Provides a set of patches for common Node.js modules to publish instrumentation data to the diagnostic-channel channel.
@azure/*
latest, Currently Cognitive Search, Communication Common and Cosmos DB SDKs are not supported.redis
v2.x, v3.xmysql
v2.xmongodb
v2.x, v3.xpg
v6.x, v7.x, v8.xpg-pool
v1.x, v2.xbunyan
v1.xwinston
v2.x, v3.xThis project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement.
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
FAQs
A collection of pre-built module patches that enable existing npm modules to publish diagnostic data
We found that diagnostic-channel-publishers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 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.