Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/99designs/docker-spy
Docker-spy provides a DNS service based on Docker container events. It keeps an in-memory database of records that map container hostnames to ip addresses. When containers are start/stopped/destroyed it keeps track of their location.
It is specifically targeted at small local development environments where you want an easy way to connect with your containers. Originally developed as part of my blog series on running a local Puppet dev stack with Docker.
The easiest way to run docker-spy is through Docker. The image is based on the scratch image (basically a zero sized image) and contains only the compiled Go executable.
Docker-spy can be configured through a number of environment variables:
Docker-spy will consider all DNS requests that end with the above configured DNS_DOMAIN to be internal requests that should be mapped to a container. All other DNS requests are forwarded to the recursor, so the DNS server should be relatively transparent.
Before starting docker-spy you should know the following things about your system:
ifconfig
and look for the Docker0 bridge entry. OSX users should first ssh into the boot2docker virtual machine with boot2docker ssh
boot2docker ip
to find out what it is.To run docker-spy you can issue the following command:
docker run --name docker_spy -p 53:53/udp -p 53:53 -v /var/run/docker.sock:/var/run/docker.sock iverberk/docker-spy
This maps the Docker socket as a volume in the container so that events may be tracked and it publishes port 53 on udp/tcp to the host. Add a -d
parameter to run the container in the background. You may then inspect the logs with docker logs docker_spy
To have seamless DNS resolution and access to your containers you should perform the following steps:
nameserver x.x.x.x
(x.x.x.x should be replaced with the Docker bridge IP address that you looked up earlier)sudo route -n add -net 172.17.0.0 192.168.59.104
To have automatic DNS resolution of your containers you should update your /etc/resolv.conf and add the Docker bridge IP address as a resolver (usually 172.17.42.1 but check it with ifconfig to be certain).
Docker-spy is really young and has a lot of rough edges. I wanted to have a basic, working solution before adding nice-to-haves. It is also my first Go program so there will probably be less then idiomatic constructs in the program. Fixes and enhancements are gladly accepted. Issues may be filed against the github repository.
To build docker-spy just install the go build environment and run go build -o docker-spy *.go
in the directory.
FAQs
Unknown package
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 malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.