51 Commits

Author SHA1 Message Date
Mike Reeves 3d11694d51 make so-yaml PG-canonical and add pillar-change reactor stack
Two coupled changes that together let so_pillar.* be the canonical
config store, with config edits driving service reloads automatically:

so-yaml PG-canonical mode
- Adds /opt/so/conf/so-yaml/mode (and SO_YAML_BACKEND env override) with
  three values: dual (legacy), postgres (PG-only for managed paths),
  disk (emergency rollback). Bootstrap files (secrets.sls, ca/init.sls,
  *.nodes.sls, top.sls, ...) stay disk-only regardless via the existing
  SkipPath allowlist in so_yaml_postgres.locate.
- loadYaml/writeYaml/purgeFile now route to so_pillar.* in postgres
  mode: replace/add/get all read+write the database with no disk file
  ever appearing. PG failure is fatal in postgres mode (no silent
  fallback); dual mode preserves the prior best-effort mirror.
- so_yaml_postgres gains read_yaml(path), is_pg_managed(path), and
  is_enabled() so so-yaml can answer "is this path PG-managed and is
  PG up" without reaching into private helpers.
- schema_pillar.sls writes /opt/so/conf/so-yaml/mode = postgres after
  the importer succeeds, so flipping postgres:so_pillar:enabled flips
  so-yaml's behavior in lockstep with the schema being live.

pg_notify-driven change fan-out
- 008_change_notify.sql adds so_pillar.change_queue + an AFTER trigger
  on pillar_entry that enqueues the locator and pg_notifies
  'so_pillar_change'. Queue is drained at-least-once so engine restarts
  don't lose events; pg_notify is just the wakeup signal.
- New salt-master engine pg_notify_pillar.py LISTENs on the channel,
  drains the queue with FOR UPDATE SKIP LOCKED, debounces bursts, and
  fires 'so/pillar/changed' events grouped by (scope, role, minion).
- Reactor so_pillar_changed.sls catches the tag and dispatches to
  orch.so_pillar_reload, which carries a DISPATCH map of pillar-path
  prefix -> (state sls, role grain set) so adding a new service to
  the auto-reload list is a one-line edit instead of a new reactor.
- Engine + reactor wiring is gated on the same postgres:so_pillar:enabled
  flag as the schema and ext_pillar config so the whole stack flips
  on/off together.

Tests: 21 new cases (112 total, all passing) covering mode resolution,
PG-managed detection, and PG-canonical read/write/purge routing with
the PG client stubbed.
2026-05-01 09:31:48 -04:00
Josh Patterson 21aeb68188 fix sominion_setup reactor 2026-04-27 14:30:41 -04:00
Josh Patterson 6d7066c381 add license 2025-07-02 16:20:30 -04:00
Josh Patterson d003e1380f ensure hypervisor is remove from salt cloud profiles when key is deleted 2025-07-02 16:14:43 -04:00
Josh Patterson 40531dd919 add LSHOSTNAME option to so-minion. use -L in sominion_setup reactor 2025-05-29 12:22:52 -04:00
Josh Patterson ef436026d5 info to debug. remove old reactors 2025-05-06 11:51:59 -04:00
Josh Patterson 6246e25fbe 640 for pubkey and empty pillar 2025-04-29 10:19:01 -04:00
Josh Patterson ae993c47c1 remove minion pillar files when a vm is destroyed 2025-03-11 11:12:45 -04:00
Josh Patterson 8047e196fe fix pipeline workers, zeek/suricata lbprocs, CPUCORES and CORECOUNT 2025-02-28 17:21:06 -05:00
Josh Patterson c6c979dc19 properly set memory and CPUCORES for minion pillars during vm setup 2025-02-28 16:12:28 -05:00
Josh Patterson fd9a4966ec move logic from reactor to orchestration 2025-02-23 14:07:51 -05:00
Josh Patterson 3246176c0a comments 2025-02-21 14:34:08 -05:00
Josh Patterson b68f561e6f progress and hw tracking for soc hypervisor dynamic annotations 2025-02-21 09:50:01 -05:00
m0duspwnens 6367aed62a reactor needs to match runner function parameter structure 2025-01-16 14:59:11 -05:00
m0duspwnens 0e0fb885d2 hypervisor highstate after image creation, not when key accepted 2025-01-16 11:13:36 -05:00
m0duspwnens 01ac1cdcca check features and allowed/states 2025-01-15 14:13:12 -05:00
m0duspwnens 2e3c1adc63 runner to setup manager for first hypervisor 2025-01-14 16:20:21 -05:00
m0duspwnens 776afa4a36 setup items on manager when hypervisor joins the grid 2025-01-09 16:32:41 -05:00
m0duspwnens 267d1a27ac use cron instead of schedule for vm init. ensure vm shutdown 2024-08-28 15:52:14 -04:00
m0duspwnens 9ddccba780 LSHEAP and pipeline workers for virt 2024-08-28 10:09:42 -04:00
m0duspwnens 21c3835322 salt3006.9, redo reactors, use virt.shutdown 2024-08-27 09:25:40 -04:00
m0duspwnens 205560cc95 updates 2024-08-20 08:31:46 -04:00
m0duspwnens 7698243caf fix reactors 2024-08-16 13:37:44 -04:00
m0duspwnens 810be2c9d2 virt start 2024-07-31 15:19:29 -04:00
Mike Reeves 2bd9dd80e2 Move In Day 2022-09-07 09:06:25 -04:00
Josh Brower d020f1d1a1 Fix Fleet Custom Hostname Reactor 2021-03-19 08:15:47 -04:00
Josh Brower e7a927188b Fleet Fixes - mysql race condition 2020-11-30 17:28:11 -05:00
m0duspwnens 0e19594c97 enable fleet in global pillars before running fleet state during setup https://github.com/Security-Onion-Solutions/securityonion/issues/1857 2020-11-09 15:25:11 -05:00
m0duspwnens 85969dc16d add quotes and remove quotes 2020-09-29 16:29:05 -04:00
m0duspwnens bf99bab6c0 add quotes and remove quotes 2020-09-29 16:26:45 -04:00
Mike Reeves 24ed92c9dc minio and change to global 2020-08-04 15:54:03 -04:00
Josh Brower ba8395fc11 Fleet reactor fix 2020-07-14 13:04:29 -04:00
Jason Ertel 8f66a27f07 Refactor image repository to a single variable 2020-07-13 18:26:43 -04:00
m0duspwnens 3cf31e2460 https://github.com/Security-Onion-Solutions/securityonion/issues/404 2020-07-09 11:27:06 -04:00
Josh Brower 3418f5748c Fleet custom hostname regex fix 2020-06-17 13:08:47 -04:00
Josh Brower 913c1a89bf Fleet setup fixes 2020-06-08 13:28:27 -04:00
Josh Brower 3f3990ac83 Merge remote-tracking branch 'remotes/origin/dev' into feature/fleet-setup 2020-06-08 08:30:37 -04:00
Josh Brower 3d92145bb9 Fleet standalone - custom hostnames 2020-06-03 15:52:18 -04:00
Josh Brower e53e891bd6 Fleet reactor - Typo fix 2020-05-28 11:36:38 -04:00
Josh Brower 11c641fd1b Initial support - integrated Fleet setup 2020-05-27 15:34:14 -04:00
m0duspwnens fafb469b5c change from default to local - https://github.com/Security-Onion-Solutions/securityonion-saltstack/issues/749 2020-05-26 11:59:00 -04:00
m0duspwnens d0242c1da6 update references of /opt/so/saltstack to /opt/so/saltstack/default. use var default_salt_dir where appropriate - https://github.com/Security-Onion-Solutions/securityonion-saltstack/issues/749 2020-05-21 10:54:47 -04:00
Josh Brower 3db67de27a osquery packages fix 2020-05-13 20:39:56 -04:00
m0duspwnens 766b56a944 update dockers to 1.2.2 2020-04-23 10:11:26 -04:00
Josh Brower fabec23b37 osquery package versioning bugfix 2020-04-14 16:42:25 -04:00
Josh Brower 29ebed3005 Fleet package fixes 2020-04-13 16:18:58 -04:00
Josh Brower 051f6d2310 Fleet pipeline fixes 2020-04-03 16:10:38 -04:00
m0duspwnens ec60b7a2d4 changing back from beacon to scheduled jobs for healthcheck 2020-04-02 15:22:20 -04:00
m0duspwnens 9acaa514cf monitoring zeek - https://github.com/Security-Onion-Solutions/securityonion-saltstack/issues/90 2020-04-01 13:06:37 -04:00
Josh Brower e5ecf0f4cb Fleet dedicated node - various fixes 2020-03-25 13:03:40 -04:00