Deploy a sensor as a binary
Use the binary when containers are not an option. The release archive
contains only openctemio-sensor: the scanners it runs (nuclei, subfinder,
dnsx, naabu, httpx, katana, semgrep, trivy, betterleaks) must be installed on
the host separately. The container images bundle and pin them, so prefer
Docker where you can. The tool sandbox uses Linux
features (Landlock, seccomp); run long-lived daemons on Linux.
Download a release
Every sensor release
publishes archives for:
| OS |
Architectures |
| Linux |
amd64, arm64 |
macOS (darwin) |
amd64, arm64 |
| Windows |
amd64 |
Archives are named openctemio-sensor_<version>_<os>_<arch>.tar.gz (and
.zip), with the version without the leading v:
VERSION=0.42.0
curl -fsSLO "https://github.com/openctemio/sensor/releases/download/v${VERSION}/openctemio-sensor_${VERSION}_linux_amd64.tar.gz"
curl -fsSLO "https://github.com/openctemio/sensor/releases/download/v${VERSION}/checksums.txt"
curl -fsSLO "https://github.com/openctemio/sensor/releases/download/v${VERSION}/checksums.txt.sigstore.json"
Verify before installing. checksums.txt is signed keyless with cosign by
the sensor’s release workflow, and lists the SHA-256 of every archive. The
signature is a Sigstore bundle: use cosign v3 (cosign v2.4 and older fail with
bundle does not contain cert for verification):
cosign verify-blob checksums.txt --bundle checksums.txt.sigstore.json \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity "https://github.com/openctemio/sensor/.github/workflows/release.yml@refs/tags/v${VERSION}"
sha256sum -c checksums.txt --ignore-missing
tar xzf "openctemio-sensor_${VERSION}_linux_amd64.tar.gz" openctemio-sensor
sudo install -m 0755 openctemio-sensor /usr/local/bin/
openctemio-sensor -version
Install the scanners
openctemio-sensor -list-tools # each scanner and whether it is available here
openctemio-sensor -check-tools # what is missing, with installation instructions
The sensor detects the installed scanners itself and reports to the platform
only those whose binary passes its check. Install the ones you want this
sensor to run. To narrow the list further, use the local policy’s
tools.allow (Sensor-local policy);
SENSOR_TOOLS is deprecated.
Run as a systemd service
Create a dedicated user and let systemd create the state, outbox and content
directories with mode 0700. Everything the sensor keeps is under
/var/lib/openctem: back that directory up (content/ is a cache that is
downloaded again):
sudo useradd --system --home-dir /var/lib/openctem --shell /usr/sbin/nologin openctem
/etc/systemd/system/openctem-sensor.service:
[Unit]
Description=OpenCTEM sensor
Wants=network-online.target
After=network-online.target
[Service]
User=openctem
Group=openctem
StateDirectory=openctem/state openctem/outbox openctem/content
StateDirectoryMode=0700
Environment=SENSOR_API_URL=https://openctem.example.com
Environment=SENSOR_ALLOWED_RANGES=203.0.113.0/24,*.example.com
Environment=SENSOR_STATE_DIR=/var/lib/openctem/state
Environment=SENSOR_OUTBOX_DIR=/var/lib/openctem/outbox
Environment=SENSOR_CONTENT_DIR=/var/lib/openctem/content
# Optional: SENSOR_PAIRING_CODE=XXXX-XXXX, the code of the Add sensor command (first start only)
ExecStart=/usr/local/bin/openctemio-sensor -verbose
Restart=on-failure
TimeoutStopSec=45
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
Start the service. On its first start it has no identity, so it pairs:
sudo systemctl daemon-reload
sudo systemctl enable --now openctem-sensor
journalctl -u openctem-sensor -f # read the code and fingerprint here
Approve the sensor as described in Pairing, then check the
start-up lines:
journalctl -u openctem-sensor | grep -E 'Tool network:|Transport:|Preflight:'
Check that it works explains each line.
SENSOR_ALLOWED_RANGES limits what it may scan; a newly paired sensor without
it (or a policy file) refuses every job with network targets. A sensor-local
policy file goes in /etc/openctem/sensor-policy.yaml, owned by root and not
writable by the sensor’s user (see Network);
it replaces SENSOR_ALLOWED_RANGES, which must then be removed. Reload it with systemctl kill -s HUP openctem-sensor.
Pin the platform host
A sensor that scans internal networks should reach the platform without DNS.
An intrusive scan can block or knock over the DNS server. Add the platform host
to /etc/hosts, and keep the host name in SENSOR_API_URL (TLS checks the
certificate against it):
echo '192.0.2.10 openctem.example.com' | sudo tee -a /etc/hosts
See Platform name resolution.
Tool confinement on a host
A binary sensor confines each scan’s network with unprivileged user
namespaces. Check the host with:
unshare -Urn true && echo "user namespaces: allowed"
-
Ubuntu 23.10 and later restrict them for programs without an AppArmor
profile (kernel.apparmor_restrict_unprivileged_userns=1), and the sensor
logs Warning: tool network not confined. Give the sensor binary a profile
that allows them, as Ubuntu does for browsers, in
/etc/apparmor.d/openctemio-sensor:
abi <abi/4.0>,
include <tunables/global>
profile openctemio-sensor /usr/local/bin/openctemio-sensor flags=(unconfined) {
userns,
}
then sudo apparmor_parser -r /etc/apparmor.d/openctemio-sensor and restart
the service. Prefer this to turning the restriction off for the whole host.
-
Other distributions: kernel.unprivileged_userns_clone (Debian) or
user.max_user_namespaces must allow them.
An unconfined sensor still runs most scans; see
Tool confinement for what it cannot run.
macOS and Windows sensors never confine.
Upgrade and remove
Install the new release over the old binary (same verification), then
sudo systemctl restart openctem-sensor. /var/lib/openctem carries the
identity and the outbox over. Rollback and removal:
Upgrade, back up and remove.
Build from source
The sensor needs Go 1.27 (the toolchain pinned in its go.mod):
git clone https://github.com/openctemio/sensor.git
cd sensor
go build -trimpath -o openctemio-sensor .
make build builds bin/openctemio-sensor with the version stamped in;
make build-all builds for every release platform into bin/.