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.
haraka-nosql
Advanced tools
Store stuff in memory-backed objects, smartly.
var NoSQL = require('haraka-nosql');
var nosql = new NoSQL('myindex', {
storage: 'redis', // or 'ram' or 'ssc'
expire: 10, // minutes
});
Exports the following functions:
nosql.set('foo', 'bar', function (err, result) {
if (err) {
// error handling code
return;
}
// do fun stuff with result
});
You're confident it'll work out? Skip the callback, it's optional. For all of these methods.
nosql.set('foo', 'bar'); // going commando
nosql.get('foo', function (err, result) {
if (err) { return; }
// result == 'bar' (because that's what we set it to)
});
nosql.del('foo', function (err, result) {
if (err) { return; }
// result == 1 (# of objects keys deleted)
});
nosql.incrby('my_counter', 1, function (err, result) {
if (err) { return; }
// result == 1 (it was undef, now it's initialized to 1)
});
nosql.incrby('my_counter', 2); // breezy!
// now my_counter == 3 (increment 1 with 2 and math!)
nosql.reset();
// all your keys are belong to /dev/null
nosql
attempts to load strong-store-cluster, which stores data in the master worker.config/nosql.ini [cluster]expire
to alter. This is great for features such
as concurrency or brute-force auth tracking.sed -i.bak -e 's/; backend=redis/backend=redis/' /my/haraka/config/nosql.ini
$EDITOR config/nosql.ini
Edit the settings in the [redis] section.
When Redis is configured, the redis connection is exported as nosql.redis
. Use it like so:
var nosql = require('haraka-nosql');
var redis = nosql.redis;
redis.multi()
.hget('something')
.get('else')
.exec(function (err, res) {
});
Refer to the excellent Redis command docs
Collisions are only possible within your namespace. Each caller of nosql
automatically gets its own namespace. In RAM, each namespace is a JS object, rather like this:
{
karma: {
key: val,
key2: val2,
},
limit: {
key: val,
key2: val2,
}
}
In Strong Store Cluster, each caller gets its own collection.
In Redis, get|del|incrby operations are mapped to their hash equivalents (hget, hdel, hincrby).
[0.4.5] - 2022-06-06
FAQs
Unified NoSQL API for RAM, SSC, or Redis
The npm package haraka-nosql receives a total of 3 weekly downloads. As such, haraka-nosql popularity was classified as not popular.
We found that haraka-nosql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.