Commit Graph
163 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
Josh Patterson 1e86be11b2 FIX: install /usr/sbin management scripts as root
Salt installed the so-* scripts into /usr/sbin owned by unprivileged service
UIDs (939/socore, plus 930-960 per service) at mode 755, while root executes
those same files from cron, systemd and state cmd.run. Any file-write
primitive as one of those UIDs was therefore root.

Two mechanisms behind this are not visible in the diff:

file.recurse also manages the destination directory, so /usr/sbin itself was
chowned to whichever service UID ran last. A directory's owner may always
chmod it, so that UID could replace even the scripts already declared
user: root -- so-config-backup, so-suricata-eve-clean, so-nsm-mount-nvme.
usr_sbin_perms now pins the directory to root:root 555, the mode the
filesystem RPM ships.

Omitting user:/group: is a no-op on files that already exist, because
check_perms only chowns when a user is named. Explicit user: root is what
lets upgraded grids self-heal on the next highstate, and what makes a
revert chown back rather than silently do nothing.
2026-09-16 10:34:20 -04:00
Mike Reeves a0cf0489d6 reduce highstate frequency with active push for rules and pillars
- schedule highstate every 2 hours (was 15 minutes); interval lives in
  global:push:highstate_interval_hours so the SOC admin UI can tune it and
  so-salt-minion-check derives its threshold as (interval + 1) * 3600
- add inotify beacon on the manager + master reactor + orch.push_batch that
  writes per-app intent files, with a so-push-drainer schedule on the manager
  that debounces, dedupes, and dispatches a single orchestration
- pillar_push_map.yaml allowlists the apps whose pillar changes trigger an
  immediate targeted state.apply (targets verified against salt/top.sls);
  edits under pillar/minions/ trigger a state.highstate on that one minion
- host-batch every push orchestration (batch: 25%, batch_wait: 15) so rule
  changes don't thundering-herd large fleets
- new global:push:enabled kill-switch tears down the beacon, reactor config,
  and drainer schedule on the next highstate for operators who want to keep
  highstate-only behavior
- set restart_policy: unless-stopped on 23 container states so docker
  recovers crashes without waiting for the next highstate; leave registry
  (always), strelka/backend (on-failure), kratos, and hydra alone with
  inline comments explaining why
2026-04-10 15:43:16 -04:00
Josh Patterson 9ec4a26f97 define options in annotation files 2026-04-09 10:18:36 -04:00
Josh Patterson 1b1e602716 ensure bool sliders for influxdb 2026-03-19 14:16:37 -04:00
Josh Patterson c2c5aea244 ensure bool sliders for each state:enabled annotation 2026-03-19 12:35:38 -04:00
Josh Patterson 74ad2990a7 Merge remote-tracking branch 'origin/3/dev' into delta 2026-03-18 13:05:02 -04:00
Josh Patterson e19e83bebb allow user defined ulimits 2026-03-18 10:38:15 -04:00
Doug Burks 930985b770 update helpLink references for new documentation 2026-03-18 09:46:45 -04:00
Josh Patterson 2349750e13 DOCKER to DOCKERMERGED 2026-03-17 16:19:02 -04:00
Josh Patterson 00986dc2fd Merge remote-tracking branch 'origin/delta' into customulimit 2026-03-17 16:04:09 -04:00
Mike ReevesandClaude Opus 4.6 2d97dfc8a1 Add customizable ulimit settings for all Docker containers
Add ulimits as a configurable advanced setting for every container,
allowing customization through the web UI. Move hardcoded ulimits
from elasticsearch and zeek into defaults.yaml and fix elasticsearch
ulimits that were incorrectly nested under the environment key.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 15:10:42 -04:00
Josh Patterson 4dc377c99f DOCKER to DOCKERMERGED 2026-03-17 15:06:06 -04:00
Jason Ertel 71839bc87f remove steno 2026-03-06 15:45:36 -05:00
Josh Patterson 00fbc1c259 add back individual signing policies 2026-01-12 09:25:15 -05:00
Josh Patterson b9ff1704b0 the great ssl refactor 2025-12-11 17:30:06 -05:00
reyesj2 78c951cb70 add manager role to elastic ingest time spent 2025-10-30 11:15:58 -05:00
reyesj2 9e4c456eb9 fix nsm influxdb alert 2025-04-23 15:02:57 -05:00
Jason Ertel 0047246cf2 reduce stdout verbosity 2025-03-04 10:55:12 -05:00
Jason Ertel cce9e162d4 remove colon to avoid yaml parsing problems 2024-09-16 15:30:14 -04:00
Jason Ertel 217bb388a0 Clarify enabled settings 2024-09-16 10:05:17 -04:00
reyesj2 1b623c5c7a Show Kafka EPS for nodes with broker role only
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
2024-07-15 16:27:48 -04:00
reyesj2 77b5aa4369 Correct dashboard name
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
2024-05-28 11:34:35 -04:00
reyesj2 0d7c331ff0 only show specific fields when hovering over Kafka influxdb panels
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
2024-05-28 11:29:38 -04:00
reyesj2 47efcfd6e2 Add basic Kafka metrics to 'Security Onion Performance' influxdb dashboard
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
2024-05-28 10:55:11 -04:00
reyesj2 47373adad2 Specify config.yaml in config_path. Otherwise when no influxd.bolt exists influxdb will fail to read the config file and won't create a new db.
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
2023-10-26 13:15:40 -04:00
Jason Ertel bbef96ac25 use unique name 2023-09-18 12:12:57 -04:00
Jason Ertel f9cbde10a6 avoid volume sprawl 2023-09-18 11:19:21 -04:00
Mike Reeves d6f1bcfdf0 Merge branch '2.4/dev' of https://github.com/Security-Onion-Solutions/securityonion into airgaps 2023-05-24 11:42:44 -04:00
Jason Ertel d9a9c8738c fix malformed alert templates 2023-05-24 10:17:59 -04:00
Mike Reeves cace817c79 Merge branch '2.4/dev' of https://github.com/Security-Onion-Solutions/securityonion into airgaps 2023-05-24 08:43:03 -04:00
bryant-treacle 5b2d91b5b5 Update alarm_zeek_packet_loss.json 2023-05-19 10:32:53 -04:00
bryant-treacle a84322f9b7 Update alarm_suricata_packet_loss.json 2023-05-19 10:32:29 -04:00
bryant-treacle 2de95bcb63 Update alarm_steno_packet_loss.json 2023-05-19 10:32:13 -04:00
bryant-treacle 1e9e2facde Update alarm_low_monitor_traffic.json 2023-05-19 10:29:53 -04:00
bryant-treacle 592c67d1f2 Update alarm_pcap_retention.json 2023-05-19 10:29:15 -04:00
bryant-treacle e91dd29cb2 Update alarm_high_redis_memory_usage.json 2023-05-19 10:25:22 -04:00
bryant-treacle 13c9142814 Update alarm_low_monitor_traffic.json 2023-05-19 10:21:43 -04:00
bryant-treacle ef4f2491f3 Update alarm_high_redis_memory_usage.json 2023-05-19 10:12:44 -04:00
bryant-treacle 645555b990 Update alarm_zeek_packet_loss.json 2023-05-19 10:10:44 -04:00
bryant-treacle 9b973e07e2 Add files via upload 2023-05-19 08:49:43 -04:00
Mike Reeves 5315c51197 Allow additional docker parameters 2023-05-18 16:52:38 -04:00
Mike Reeves 0fd9fb9294 Allow additional docker parameters 2023-05-18 15:19:09 -04:00
m0duspwnens 7a4fea7a12 fix nginx merge conflicts 2023-05-15 11:40:12 -04:00
Jason Ertel 98c19e5934 handle duplicate telegraph data for elastic 2023-05-11 13:34:44 -04:00
m0duspwnens b80dd996cc fix import 2023-05-11 12:46:05 -04:00
m0duspwnens 63cea88c1d enable/disable influxdb in ui 2023-05-11 12:43:06 -04:00
Mike Reeves a5b1660778 Fix firewall changes 2023-05-03 14:12:32 -04:00
Mike Reeves 2d4f4791e0 Move files out of common 2023-05-01 15:21:31 -04:00
m0duspwnens 1047462898 add identifiers for all cron.present 2023-04-13 16:25:47 -04:00