Commit Graph
99 Commits
Author SHA1 Message Date
Josh Patterson 72f60fcaa9 FIX: remove the docker socket from so-telegraf
so-telegraf mounted /var/run/docker.sock and joined the host docker group on
every node type. The :ro flag blocks write() to the inode, not connect() plus
HTTP over the socket, so any code execution inside the container could reach
POST /containers/create with Privileged:true and become root on the host.

No telegraf script used the socket; the only consumer was the native
[[inputs.docker]] plugin, and group_add 920 existed solely to feed it.
Container metrics now come from so-container-stats, a collector that runs on
the host from cron and writes influx line protocol to a file telegraf already
had mounted. This is the pattern so-status, so-raid-status and
so-elasticagent-status already use, so the privileged docker access stays on
the host side where root cron already ran it.

The collector runs as somon, a service account in the docker group with no
login shell and a locked password, rather than root. Docker group membership
is still root-equivalent on the host, so this is defense in depth rather than
a privilege boundary.

The telegraf scripts were root:939 mode 770, letting socore rewrite them for
code execution inside the container; they are now 750, which still allows the
read and execute telegraf needs. The container also ran with no group, giving
it gid 0, and now runs as 939:939. That alone would have broken
lasthighstate.sh, which reached /opt/so/log/salt only via the root group and
could not tell an unreadable file from a missing one, so it silently reported
a 56 year highstate age. Only the lasthighstate file is bind mounted now, and
the script tests readability instead of existence.

Everything inputs.docker collected beyond the five fields the shipped
dashboards query is available per stat under telegraf:container_stats,
annotated for SOC so an operator can enable it without editing files. Defaults
reproduce the previous output exactly. With every stat enabled the emitted
field set matches what inputs.docker wrote, verified by running the plugin
against the live socket and diffing: 53 fields, no type mismatches, no field
present on one side only.

Two deliberate differences: max_usage carries the real cgroup peak where the
daemon reports 0 on cgroup v2, and host-network containers emit no
docker_container_net row, matching inputs.docker. Docker label tags are not
restored, since nothing queries them and they cost significant cardinality.

so-status, the influxdb size cron, so-elasticagent-status, so-raid-status and
so-common-status-check truncated their output in place while telegraf read it,
so telegraf periodically saw an empty file and logged a parse error or emitted
empty values. They now write aside and rename. Measured on a live manager, the
old so-status cron left status.log empty for 215 of 10997 reads.

Tested on a fresh install, a converted grid and a 3.0 upgrade.
2026-09-24 14:30:25 -04:00
Jason Ertel 71839bc87f remove steno 2026-03-06 15:45:36 -05:00
reyesj2 12b3081a62 fix agentstatus script 2026-02-25 16:39:33 -06:00
DefensiveDepth 5ab6bda639 Fixup logic 2025-12-10 17:16:35 -05:00
DefensiveDepth 9304513ce8 Add support for suricata rules load status 2025-12-04 12:26:13 -05:00
reyesj2 044d230158 get 200 from es before collecting metrics 2025-04-30 13:05:36 -05:00
reyesj2 1ddc653a52 fix input error in agentstatus script 2025-04-29 13:40:39 -05:00
reyesj2 3cb3281cd5 add metrics for es index sizes 2025-04-29 12:38:41 -05:00
Mike Reeves 976ddd3982 add agentstatus to telegraf 2024-04-03 10:06:08 -04:00
Mike Reeves 64748b98ad add agentstatus to telegraf 2024-04-03 09:56:12 -04:00
Mike Reeves 3335612365 add agentstatus to telegraf 2024-04-03 09:54:16 -04:00
Mike Reeves 513273c8c3 add agentstatus to telegraf 2024-04-03 09:43:55 -04:00
Mike Reeves 283939b18a Gather metrics from elastic agent to influx 2024-04-02 15:36:01 -04:00
m0duspwnens 907cf9f992 transition pcap 2024-03-11 12:20:28 -04:00
Mike Reeves 58d222284e Merge pull request #12271 from Security-Onion-Solutions/suripcap
Suricata PCAP
2024-03-04 17:27:38 -05:00
Mike Reeves e7914fc5a1 Update stenoloss.sh 2024-02-22 12:49:06 -05:00
m0duspwnens f32cb1f115 fix find to work with steno and suri pcap 2024-01-30 15:48:10 -05:00
m0duspwnens d118ff4728 add GLOBALS.pcap_engine 2024-01-29 16:54:08 -05:00
Mike Reeves 88d2ddba8b add placeholder for telegraf 2024-01-29 15:53:54 -05:00
Jason Ertel 9f17bd2255 lks/fps 2024-01-24 11:17:32 -05:00
reyesj2 07602076f1 Update telegraf script
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
2024-01-18 16:48:16 -05:00
reyesj2 739feb25a4 Add telegraf script to import featuresdetected
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
2024-01-17 15:55:00 -05:00
m0duspwnens eeb249e00d look for needs_restarted file 2024-01-16 17:22:09 -05:00
m0duspwnens dff06cb085 changes for telegraf os.sh 2024-01-16 17:03:36 -05:00
Jason Ertel e075d07f5c show last highstate date/time on grid metrics screen; expose maxUploadSize and staleMetricsMs settings on config screen 2023-12-29 11:38:42 -05:00
Jason Ertel a732985351 grid page enhancements 2023-12-08 08:38:42 -05:00
Mike Reeves 039d5ae9aa Delete salt/telegraf/scripts/beatseps.sh 2023-09-27 16:09:27 -04:00
m0duspwnens 673b45af09 import ZEEKMERGED 2023-08-08 09:41:42 -04:00
m0duspwnens a06040c035 add WORKERS calculation back to zeekcaptureloss script 2023-08-08 09:37:37 -04:00
m0duspwnens e286b8f2ba Merge remote-tracking branch 'origin/2.4/dev' into fix/tgrafzeekcloss 2023-08-08 09:36:12 -04:00
m0duspwnens 69553f9017 removes spaces from zeekcaptureloss script 2023-08-08 09:34:59 -04:00
Doug Burks 90102b1148 Finish reverting yesterday's change to zeekcaptureloss.sh 2023-08-05 09:23:27 -04:00
Doug Burks ec81cbd70d Revert yesterday's change to zeekcaptureloss.sh 2023-08-05 09:11:58 -04:00
m0duspwnens 9af2a731ca fix count of WORKERS for zeekcaptureloss script for telegraf 2023-08-04 16:29:30 -04:00
Mike Reeves cb8faf7c5f Fix the rest of the analyst entries 2023-06-26 16:14:04 -04:00
bryant-treacle 839275814c Update redis.sh - Added percent of used memory. 2023-05-19 08:51:49 -04:00
Mike Reeves 275aead5b9 Allow auth for redis check for tgraf 2023-01-04 14:30:28 -05:00
Mike Reeves 48a3f4e261 Allow auth for redis check for tgraf 2023-01-04 14:14:10 -05:00
Jason Ertel ae6fbab45d refactor sostatus telegraf input script 2022-09-19 10:27:20 -04:00
Jason Ertel 9542a5ada2 complete rewrite of so-status 2022-09-16 17:46:52 -04:00
Mike Reeves 2bd9dd80e2 Move In Day 2022-09-07 09:06:25 -04:00
Doug Burks eda7a8d7ea FIX: Update telegraf influxdbsize.sh to collect influxdb size from influxdb_size.log #7468 2022-03-18 13:15:43 -04:00
Jason Ertel eefcc929c2 Update copyright pattern to match other repos 2022-01-24 10:09:23 -05:00
Jason Ertel 7c22f46a55 Update copyright year for 2022 2022-01-24 09:35:29 -05:00
m0duspwnens 0b28e89f3c change how telegraf script determine if there is already and instance of the script already running 2021-11-04 23:22:13 -04:00
Mike Reeves 64f25961b0 Fix Steno Math for PL 2021-10-19 11:15:58 -04:00
Mike Reeves b9a3d3a6a9 Fix Steno Math for PL 2021-10-19 11:14:02 -04:00
Mike Reeves 14557983e1 Update raid.sh 2021-04-28 10:24:39 -04:00
Mike Reeves be6933e8fb Change EPS for Telegraf 2021-04-19 14:20:00 -04:00
Mike Reeves 0c0edbaac8 Change EPS for Telegraf 2021-04-19 13:29:46 -04:00