Skip to content
Sensor configuration

Sensor configuration

The sensor is configured entirely through environment variables, set as KEY=VALUE lines in /etc/safetybits on the appliance. See Configure and start for how to edit that file and apply a change.

Core settings

VariableTypeDefaultRequiredEffect
AGENT_IDuuidnoneyesThe sensor ID assigned when you register a facility in the console.
CAPTURE_INTERFACEstringnoneyesThe interface receiving mirrored traffic.
ENDPOINTstringconnect.safetybits.ionoThe console address the sensor reports to.
PROMETHEUS_PORTint9110noPort for the sensor’s own metrics, scraped by the local monitoring stack.
RING_BUFFER_SIZEint1024000noSize, in packets, of the capture ring buffer. Raise this if the local dashboard shows dropped packets on a high traffic segment.

gRPC (GRPC_)

VariableTypeDefaultEffect
GRPC_TLSbooltrueEncrypts the connection to the console. Leave enabled outside of a lab setup.
GRPC_KEEPALIVE_TIMEduration1mInterval between keepalive pings.
GRPC_KEEPALIVE_TIMEOUTduration10sHow long to wait for a keepalive response before reconnecting.

Logging (LOG_)

VariableTypeDefaultEffect
LOG_LEVELstringinfoOne of debug, info, warn, error.
LOG_JSONboolfalseLog in JSON instead of plain text, useful if you forward the journal to a log pipeline.
LOG_ADD_SOURCEboolfalseInclude the source file and line in each log entry.

Discovery (DISCOVERY_)

VariableTypeDefaultRequiredEffect
DISCOVERY_INTERFACE_PREFIXstringnoneyesMatches every interface name starting with this prefix as an OT network connection. Used for active identification, see Discovery and the inventory.
DISCOVERY_STRATEGYstringarpnoHow the sensor finds active addresses. arp for the local segment, or icmp for broader reach.
DISCOVERY_RETRIESint4noRetries per target address.
DISCOVERY_DURATIONduration90snoMaximum time for one discovery cycle.
DISCOVERY_BUFFER_SIZEint2048noSize of the internal device buffer during discovery.

Port scanning (DISCOVERY_PORTSCAN_)

VariableTypeDefaultEffect
DISCOVERY_PORTSCAN_MAX_CONCURRENTint64Maximum hosts scanned at once.
DISCOVERY_PORTSCAN_DURATIONduration90sMaximum time for the port scanning phase.

Machine learning (ML_)

VariableTypeDefaultEffect
ML_INTERVALduration10mHow often baselines are recalculated.
ML_MIN_SAMPLESint288Samples needed before a baseline is usable, roughly two days at the default interval. See Baselines and anomaly detection.

Stormshield (STORMSHIELD_) and Fortinet (FORTINET_)

Set these only if you also configure the matching integration, see integrations/.

VariableTypeEffect
STORMSHIELD_SNSCLI_PATHstringPath to the snscli binary on the appliance.
STORMSHIELD_HOSTstringAddress of the Stormshield SNS appliance.
STORMSHIELD_USERstringUsername for that appliance.
STORMSHIELD_PASSWORDstringPassword for that appliance.
FORTINET_HOSTstringAddress of the FortiGate or FortiManager appliance.
FORTINET_TOKENstringAPI token for that appliance.

Port mirroring cookbook

The exact steps depend on your switch, but the shape is the same everywhere:

  1. Log in to the switch’s management interface.
  2. Identify the source ports or VLANs carrying the traffic you want visibility into.
  3. Set the port connected to the sensor’s port mirroring interface as the destination.
  4. Create the mirroring session, specifying the sources and the destination, and save it.
  5. Confirm traffic arrives by checking the switch’s own session counters, and then checking the sensor’s side, see Health checks.

For example, on a Cisco switch, mirroring two source ports to a third:

monitor session 1 source interface GigabitEthernet0/1 - 2
monitor session 1 destination interface GigabitEthernet0/3

VLAN access cookbook

The appliance’s network configuration is managed declaratively with systemd-networkd. If the sensor’s OT network connection needs to reach a tagged VLAN, add a VLAN sub interface for it. The sensor matches any interface starting with DISCOVERY_INTERFACE_PREFIX, so naming it <parent>.<vlan id> is enough for it to be picked up automatically.

Define the VLAN device, for example in /etc/systemd/network/25-ot-vlan.netdev:

[NetDev]
Name=enp5s0.100
Kind=vlan

[VLAN]
Id=100

Attach it to the parent interface, for example in /etc/systemd/network/20-enp5s0.network:

[Match]
Name=enp5s0

[Network]
VLAN=enp5s0.100

Give the new interface an address, for example in /etc/systemd/network/26-ot-vlan.network:

[Match]
Name=enp5s0.100

[Network]
Address=192.0.2.10/24

Apply the change and restart the sensor so it picks up the new interface:

sudo systemctl restart systemd-networkd
sudo systemctl restart safetybits