Command overview
beacon rules diff compares what two rule packs say about the same events and lists every verdict that changed.
Command syntax
What is compared
Rules are evaluated asbeacon scan evaluates them. Each single-event rule, and each step of each correlation rule, is evaluated on every event on its own, and each correlation rule is matched over each fixture, and over the log, as a whole. For each one whose answer changed, the output lists the events (for a correlation rule, the findings, named by the fixture and the evidence events) it matches now and did not (+) and the ones it matched and no longer does (-). An evaluation that fails, most often an expression stopped at the cost limit, leaves the verdict unknown, and that is a change too: ! lists the events a rule can no longer be evaluated on, and ? those it can be again.
The events are the fixture events of both packs and the fixtures of their predicates. With --log-path, the events of that telemetry log are added, in the order a scan reads them, which shows what the change does on real activity.
Example output
--json, each event of a change carries its ID, which identifies it by its content.
A change to the rules
Give two pack directories, such as a checkout of the main branch and your working tree:Compare two packs
A change to Beacon
A change to how Beacon reads an event changes verdicts without changing a rule, so there are not two packs to compare. Record a snapshot with the old binary and compare it with the new one:Compare across two builds of Beacon
--log-path therefore holds the commands and paths of that log.
Two sides are compared on the events, and fixtures, both were asked about. Events only one side has are counted and not compared. A snapshot written by a Beacon before this one has no fixture findings and is compared on its events.
Flags
Related
beacon rules lint
Validate rule files and run embedded fixtures.
Rule YAML schema
Predicates and the definitions a pack ships.