Install the collector
Build the collector, copy it to the collector machine and log it in to the server.
Select the collector machine
Install the collector on a machine that can:
- Connect to the target hosts with SSH, for example a jump host in the VLAN.
- Connect to the server with HTTPS.
The collector runs on Linux and macOS, on amd64 and arm64. One collector machine can scan many VLANs.
Build
Clone the repository and go to it.
git clone https://git.rda.run/shellgraph/collector.git cd collectorBuild the binaries.
make buildThe result is in
bin/:bin/shellgraph-linux-amd64 bin/shellgraph-linux-arm64 bin/shellgraph-darwin-amd64 bin/shellgraph-darwin-arm64Copy the binary for the collector machine to a directory in the
PATH, with the nameshellgraph.install -m 755 bin/shellgraph-linux-amd64 /usr/local/bin/shellgraph
To build for the current machine only, use make build-local. The result is bin/shellgraph.
To build the container image shellgraph:<version>, use make image. The image is for linux/amd64. For arm64, use make image ARCH=arm64. See Run in a container.
Log in to the server
In the server UI, create a collector token. See Prepare an Environment.
On the collector machine, run the login command that the UI shows.
shellgraph login --server https://shellgraph.example.net --token <token>
The collector tests the token and writes the server URL and the token to its configuration file. For the location of the file, see Command line.
Run in a container
The image has the binary and the public CA certificates. It runs as the user 10001. The collector gets the SSH keys from the server, so the container needs only the server URL and the token.
Put the server URL and the token in a file, for example
/etc/shellgraph/collector.env.SHELLGRAPH_SERVER=https://shellgraph.example.net SHELLGRAPH_TOKEN=<token>Make the file readable only by root.
chmod 600 /etc/shellgraph/collector.envRun a scan. The flags
-itare necessary for the menus. With--envand--vlan, the scan does not show menus.podman run -it --rm --env-file /etc/shellgraph/collector.env shellgraph:<version> scan
You can also use shellgraph login in the container. Then mount a volume on /home/shellgraph/.config/shellgraph to keep the configuration file.
Protect the collector machine
The token can read the SSH keys of all VLANs.
- Make the collector machine accessible only to the operators.
- Make one token for each collector machine.
- If a machine is lost, revoke its token in the server UI.
Check the version
shellgraph version