
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Monitor one-off tasks on your servers using Redis.
npm install -g kwikemon
$ kwikemond &
$ curl -s localhost/nginx_status | grep Active | kwikemon write nginx-connections
$ curl localhost:1111/nignx-connections
Active connections: 316
$ kwikemon set foo bar
$ curl localhost:1111/
foo: bar
nginx-connections: Active connections: 316
Here's how it works:
kwikemon set thing status
to set the text for the monitor named "thing"kwikemond
, that serves up these monitors in a big list or individuallyAlternatively:
kwikemon write <name of thing you are watching>
on stdinTo see everything kwikemon
can do run kwikemon help
.
$ kwikemon help
This is very much a work in progress.
You can use kwikemon as a library.
var kwikemon = require('kiwkemon');
kwikemon.set('foo', 'bar', function(err) {
kwikemon.get('foo', function(err, text) {
console.log('foo = ' + text);
});
});
kwikemon.getAll(function(err, monitors) {
Object.keys(monitors).forEach(function (name) {
console.log(name + ' = ' + monitors[name]);
});
});
Monitors expire 1 day after the last time they were set by default. You can pass in any ttl
you
want though.
// never expire
kwikemon.set('foo', 'bar', { ttl: 0 });
All kwikemon does is shove things into Redis in a standard way and read them out later.
A monitor named nginx
stores its data in the hash kwikemon:monitor:nginx
. Hash fields
are:
The list of all monitors is a set stored at kwikemon:monitors
.
exists = redis.exists("kwikemon:monitor:nginx")
if exists:
redis.hmset("kwikemon:monitor:nginx", {
text: "Active connections: 583"
modified: 1370668341943
})
redis.hincrby("kwikemon:monitor:nginx", "updates", 1)
else:
redis.hmset("kwikemon:monitor:nginx", {
text: "Active connections: 316"
updates: 1
created: 1370668301943
modified: 1370668301943
})
redis.sadd("kwikemon:monitors", "nginx")
# optional
redis.expire("kwikemon:monitor:nginx", <ttl>)
redis.hgetall("kwikemon:monitor:nginx")
redis.del("kwikemon:monitor:nginx")
redis.srem("kwikemon:monitors", "nginx")
Clean out expired monitors. Call this before anything that relies on counting or iterating through all monitors.
for name in redis.smembers("kwikemon:monitors"):
if not redis.exists("kwikemon:monitor:$name"):
remove(name)
Sweep before running a count.
sweep()
redis.scard("kwikemon:monitors")
Sweep before listing.
sweep()
redis.smembers("kwikemon:monitors")
Sweep before geting all.
sweep()
monitors = {}
for name in list():
if redis.exists("kwikemon:monitor:$name"):
monitors[name] = get(name)
return monitors
Copyright 2013 Sami Samhuri sami@samhuri.net
FAQs
monitor one-off things on your servers
The npm package kwikemon receives a total of 5 weekly downloads. As such, kwikemon popularity was classified as not popular.
We found that kwikemon 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
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.