
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
etcd-service-registry
Advanced tools
A node.js library to manage service discovery and registration on top of etcd
A library to manage service registry and discover over etcd.
You will need a connection to etcd. If you're registering services, you will additionally need the public ip of your host.
In the common use case where your service is a docker container on top of CoreOS/Fleet, you will need to connect to the etcd endpoint at 172.17.42.1. You will determine your own ip/port by passing them as parameters in your fleet service definition.
var Registry = require('etcd-service-registry');
var registry = new Registry();
var registry = new Registry('127.0.0.1', '4001');
registry.Register('MyServiceName', // Name that will be used by your clients
'10.244.1.105', // IP that the service is bound to
'8080', // Port that the service is bound to
['Testing', 'V1.1']) // Some metadata tags
.then(...);
A call to Discover will not fulfill until the required service has been registered into etcd.
registry.Discover('MyServiceName')
.then(function(service) {
console.log(util.inspect(service))
})
.then(...);
// {
// name: 'MyServiceName',
// ip: '10.244.1.105',
// port: '8080'
// tags: ['Testing', 'V1.1']
// }
A call to DiscoverAll will not fulfill until all the services specified have been registered into etcd.
registry.DiscoverAll(['ServiceA', 'ServiceB'])
.then(function(services) {
console.log(util.inspect(services));
})
.then(...);
// {
// ServiceA:
// {
// name: 'ServiceA',
// ip: '192.168.1.1',
// port: '80',
// tags: [ 'Production', 'Version-1.12.3' ]
// },
// ServiceB:
// {
// name: 'ServiceB',
// ip: '192.168.1.2',
// port: '81',
// tags: [ 'Production', 'Version-1.12.4' ]
// }
// }
A sidekick is a component external to your service that monitors its health and based on this health check registers your service into etcd.
Sidekick-CLI under example/sidekick-cli is a CLI implementation of a sidekick service that you can instantly consume with very little effort. It offers inbuilt health check by polling the TCP socket of your service.
Why TCP instead of HTTP? TCP is more generic so it supports a broader array of services. What you lose by doing TCP polling is the ability to monitor a specific path such as /health - since the TCP poll only checks if the socket is open and is accepting connections.
Sidekick.js: Register and monitor a service on etcd via CLI.
Options:
-n, --name Name of the service you wish to register [required]
-i, --ip Publicly accesible ip of your service [required]
-p, --port Port of your service [required]
-e, --expiry Expiry interval for registration on etcd [default: 15]
-t, --poll Polling interval for health check [default: 5]
--ei, --etcdip Etcd service ip [default: "localhost"]
--ep, --etcdport Etcd service port [default: 4001]
FAQs
A node.js library to manage service discovery and registration on top of etcd
The npm package etcd-service-registry receives a total of 0 weekly downloads. As such, etcd-service-registry popularity was classified as not popular.
We found that etcd-service-registry 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 researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.