mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-12-02 08:36:08 +01:00
A push dispatched while a node was being added ran a single state on a node where nothing else had been applied, and the drainer logged "push failed" as an ERROR, which fails so-log-check. Seen on a distributed 3.5.0 install: so-minion accepted the sensor's key at 03:22:37, after which it matched G@role:so-sensor, but orch.deploy_newnode did not highstate it until 03:32:31 because its manager steps queued behind the searchnode's elasticsearch,soc run. A suricata rules change drained at 03:31:29 and state.sls suricata ran on the sensor at 03:31:33. Three states failed with "file not found" for /opt/so/conf/so-status/so-status.conf: file.append touches a missing file without makedirs, and the directory is created by common, which had not run. The push also created the so-suricata container about a minute ahead of the highstate. Setup now writes a first_highstate_pending grain next to role, and salt.lasthighstate removes it at the end of a highstate. The drainer wraps each compound target as "( <tgt> ) and not G@first_highstate_pending:True", so a node is left alone until a highstate has completed on it, whichever one that is. The master matches on its cached grains, which grains.absent refreshes when it removes the grain. Nodes installed before this change never have the grain and are targeted as before. The grain is set for every node type, so a manager's pushes to itself are also skipped until its first full highstate finishes. A change that lands during a node's first highstate, after the state it affects has run, waits for the next scheduled highstate. Hypervisor VMs do not go through configure_minion and are not covered. On the same grid, with the grain set on the sensor by hand, the drainer skipped the suricata action and still dispatched to the other nodes; after grains.absent removed it the sensor was targeted again. That check was run before the grain was renamed from highstate_pending. A fresh node join has not been tested.