Whisperers as Docker containers attached to other Dockers containers
Whisperers may be hooked into others running containers.
Setup
In this case, you need to have Docker (or an alternative) running in your server, and you launch a Gossiper attaching its network to the other container network.
By command line
You may attach the Gossiper to another container by command line:
docker run -d \
--network container:container-to-capture \
-e "CONFIG=$(cat ./whisperer-config.json)" \
--restart unless-stopped \
registry.gitlab.com/spider-analyzer/public-images/gossiper
The network option tells Docker to share the network stack of container-to-capture with the Gossiper.
The -e loads the Whisperer config file from a local file ./whisperer-config.json (adjust it to your needs) into the CONFIG environment variable.
Refer to official Docker run reference documentation for more options.
You may include this command in a shell script and have it restart
The Gossiper ignores its own traffic to the Spider server. If the container to capture talks to Spider itself, that traffic is not captured, unless you set CAPTURE_OWN_COMS=true.
From within the docker-compose file
You may also do it straight from the docker-compose.yml file
gossiper:
image: registry.gitlab.com/spider-analyzer/public-images/gossiper
volumes: #or use the CONFIG environment variable
- ./whisperer-config.json:/app/config.json:ro
network_mode: "service:container-to-capture"
Check Docker compose reference from more options.
Gossiper options
Options may be defined from environment variables:
| Name (*: mandatory) | Description | Default |
|---|---|---|
| CONFIG * | JSON configuration value for the Whisperer. May also be mounted as /app/config.json in the container. | |
| LOG_LEVEL | Define the log level. May be DEBUG, INFO, WARN, ERROR | INFO |
| HOSTNAME or PARENT_HOSTNAME | Sent back to the server in the hostname field of status.Used for proper identification in the UI. | |
| INSTANCE_ID | Used to differentiate replicas of a same Whisperer. Must be unique by Whisperer. | hostname |
| CONTAINER_NAME | Sent back to the server in the containerName field of status.Used for proper identification in the UI. | |
| DNSCACHE_HOST | Used to force a DNS server. Even to connect to Spider server. Specifies its hostname or IP. | |
| DNSCACHE_PORT | Used to force a DNS server. Even to connect to Spider server. Specifies its port. | 53 |
| CAPTURE_OWN_COMS | If true, the Gossiper will also capture its communications to Spider. DANGEROUS! |