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.
hapi-ratelimiter
Advanced tools
A simple IP based rate limiting plugin for Hapi using Redis.
##Installation
npm install hapi-ratelimiter
In the Hapi init code:
const Hapi = require('hapi');
const Limiter = require('hapi-ratelimit');
const server = new Hapi.Server();
server.connection();
// Ratelimiter config
const options = {
redis: process.env.REDIS_URL, // Or any valid ioredis options
namespace: 'clhr', // Namespace for redis keys
global: {
limit: 200, // Set limit to -1 or leave out global to disable global limit
duration: 60
}
// Global limit is not given priority over local limits
};
connection.register({ register: Limiter, options: options }, (err) => {
if (err) {
throw err;
}
});
connection.route({
method: 'GET',
path: '/someImportantRoute',
handler: someHandler,
config: {
plugins: { // If you want to override the default values
'hapi-ratelimit': {
limit: 100,
duration: 60
} // Limits to one hundred hits per minute on a specific route
}
}
});
This module borrows heavily from creativelive/hapi-ratelimit, so credit for original implementation goes there. The rate-limiting logic in itself relies on tj/node-ratelimiter, which is another awesome project.
FAQs
A rate limiting plugin for Hapi.
The npm package hapi-ratelimiter receives a total of 9 weekly downloads. As such, hapi-ratelimiter popularity was classified as not popular.
We found that hapi-ratelimiter 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.