shellgraph

Report format

The report that the collector sends to the server after a scan. The collector and the server follow this page.

The collector and the server each have a copy of the report types. If you change the format, change this page and the example first.

Transport

  • Method and path: POST /api/collector/vlans/{id}/reports
  • Headers: Authorization: Bearer <collector token>, Content-Type: application/json, Content-Encoding: gzip
  • Body: one JSON object, compressed with gzip.
  • Maximum size after decompression: 64 MiB.

Versions

schema_versionStatus
1Current

The server rejects a report with a schema version that it does not know. The error message tells which program to upgrade.

Top-level object

FieldTypeDescription
schema_versionintegerFormat version. Current value: 1.
collector_versionstringVersion of the collector that made the report.
vlan_idintegerID of the VLAN on the server.
cidrstringCIDR that the collector scanned. The server rejects the report if this is not the current CIDR of the VLAN.
started_atstringStart time of the scan, RFC 3339, UTC.
finished_atstringEnd time of the scan, RFC 3339, UTC.
resultsarray of ResultOne item for each IP that the collector scanned.

The report always contains the complete VLAN. The collector does not send a report for a scan that stopped before the end.

Result

FieldTypeDescription
ipstringIP address that the collector scanned.
statusstringOne of the values in the table below.
messagestringError text. Only for auth_failed, hostkey_changed and error. Optional.
hostkey_fpstringSHA-256 fingerprint of the SSH host key (SHA256:...). Present when the SSH handshake started. Optional.
hostHostCollected data. Only for ok and partial.
StatusMeaningServer action
no_sshNo answer on the SSH port.The host leaves this VLAN. A host with no VLAN left is deleted.
auth_failedThe SSH server refused the credential.The host keeps its data and becomes stale.
hostkey_changedThe host key is not the key that the server knows.The host keeps its data and becomes stale.
errorOther failure (timeout, script error).The host keeps its data and becomes stale.
okComplete collection.The server replaces the data of the host.
partialCollection without sudo. Some sockets have no process.The server replaces the data of the host and marks it partial.

Host

FieldTypeDescription
machine_idstringContent of /etc/machine-id. Can be empty.
hostnamestringOutput of hostname -f.
osstringPRETTY_NAME from /etc/os-release. Can be empty.
addressesarray of AddressAll IP addresses of the host, and the IP addresses of its containers.
servicesarray of ServiceServices that the collector found.

The server finds a known host with the pair (machine_id, hostname).

Address

FieldTypeDescription
ipstringIP address, without prefix length.
interfacestringInterface name. For a container address: container:<name>.
scopestringglobal: a routable address of the host. local: loopback or a bridge interface (docker0, br-*, cni*, virbr*, podman*, veth*). container: an address of a container network namespace.

Only global addresses identify a host for other hosts. The same local or container address can exist on many hosts.

Service

FieldTypeDescription
keystringStable key of the service in the host. See the formats below.
namestringName to show.
kindstringsystemd, process, container or unknown.
listensarray of ListenPorts where the service listens.
observationsarray of ObservationConnections of the service.

Key formats:

KindKeyName
containercontainer:<container name>container name
systemdunit:<unit name>unit name
processproc:<comm>:<hash>comm
unknownport:<port> for a listen without a process, unknown for other socketsunknown:<port> or unknown

<hash> is the first 8 hexadecimal characters of the SHA-256 of the process command line, after the collector removes all digits. The command line itself is never in the report, because it can contain passwords.

Listen

FieldTypeDescription
protostringtcp.
ipstringBind address. 0.0.0.0 or :: for all addresses. For a container, the container address.
portintegerPort.

A container port that is published on the host has one more Listen with the host bind address and the host port.

Observation

FieldTypeDescription
directionstringoutbound: the service calls the remote side. inbound: the remote side calls the service.
local_ipstringLocal address.
local_portintegerLocal port for inbound. 0 for outbound (the ephemeral port is removed).
remote_ipstringRemote address.
remote_portintegerRemote port for outbound. 0 for inbound.
samplesintegerNumber of samples in the scan that found this connection.
target_servicestringOnly for outbound to the same host: the key of the service that listens. Optional.

The collector does not report:

  • inbound connections from an address of the same host. The outbound side gives the same information.
  • Connections between two processes of the same service.
  • The SSH session of the collector.

Example

Download report-v1.json: a complete report of version 1.