Security
The server keeps the SSH keys encrypted and sends them only to collectors, through TLS.
The SSH keys
The server keeps the private key of each credential, encrypted with AES-256-GCM. The master key is in the variable SHELLGRAPH_KEY and never in the database. A stolen copy of the database does not give the SSH keys.
The UI never shows a key after you save it. Only the collector API sends a decrypted key, and only to a valid collector token. The server writes each of these requests to its log.
Why TLS is necessary
During a scan, the server sends the decrypted private key of the VLAN to the collector. Without TLS, any person who can read the network traffic gets the key. For this reason, the collector refuses an http:// server URL. The only exceptions are localhost and 127.0.0.1.
Collector tokens
A collector token can read the keys of all VLANs. The server keeps only the SHA-256 of each token, and the UI shows a token one time only. Make one token for each collector machine, so that you can revoke one machine without a change to the others.
The collector cannot run commands from the server
The collection script is in the collector binary. The server sends only data: the CIDR, the port and the credential. A person who takes control of the server still has no path to run a command on your servers through the collector.
Sessions
The session cookie is signed, HttpOnly and SameSite=Strict. It is Secure when the server uses HTTPS or when the proxy sends X-Forwarded-Proto: https. The UI API rejects requests from other sites.
For the security of the target hosts, see Collector security.