The policy engine lets you define rules that your audit trail must satisfy, then check them automatically.
Built-in policies
Five policies are included and run with a single command:
Custom policies (YAML)
Define custom policies in a YAML file:
Rule types
The policy engine supports 7 rule types:
Sequence
If event X occurs, event Y must follow within a duration:
Absence
If event X occurs, event Y must NOT follow:
Boundary
Restrict an agent to a set of allowed actions:
Presence
A scope must contain at least one matching event:
Rate
No more than X events of type Y per scope:
Pattern
Field values must match (or not match) a regex:
Use match_pattern to require a field value matches a regex, or deny_pattern to require it does not.
Temporal
Events must fall within a time window:
The hours field takes [start, end) in 24-hour format. The days field uses 0=Sunday through 6=Saturday.
Common rule fields
All rule types support these optional fields:
Dry run
Test policies against existing events without affecting anything:
plog policy test requires --file — it is designed for validating custom policy definitions.
Policy result schema