
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
vip (very important process) is a module that uses a distributed lock module locked to ensure that only one copy of a function is running across a cluster
This is useful to avoid a split brain when running some kind of cluster wide co-ordination process
It uses etcd which uses the raft protocol
$ npm install vip
Create a new vip function that will run only once on the elected node:
var vip = require('vip')
// pass the etcd connection string
var vipcontroller = vip('127.0.0.1:4001,127.0.0.1:4002')
// this can also be an etcdjs object
var vipcontroller = vip(etcdjs('127.0.0.1:4001,127.0.0.1:4002'))
// create a candidate passing the key path and node name
var httpRouter = vipcontroller({
path:'/http_router',
id:'node1',
value:'apples',
ttl:10
}, function(){
// here we start the router
// this code will only ever have one copy running across the cluster
})
httpRouter.on('select', function(id, value){
// this is run only on the node that was elected
})
httpRouter.on('change', function(id, value){
// this is run across all nodes
})
httpRouter.start()
var vipcontroller = vip(etcdhosts)Create a controller that is connected to some etcd peers
var service = vipcontroller(opts, fn)Create a new candidate function - opts is an object with the following keys:
fn is executed once and only when the node is elected as the current leader for the service across the cluster
service.on('select', function(value){})This event is triggered when the node has been elected and it's value distributed to the cluster.
You can run logic in this function that should only be running on one server at a time.
service.on('change', function(value, nodeid){})This event is triggered when the lock value has changed regardless of which node was elected.
The nodeid is of the elected machine is passed as the second argument.
MIT
FAQs
very important process - use etcd to avoid a split brain across a cluster
We found that vip 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
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.