To keep a security monitoring environment high-performing and dependable, apply these guidelines while building rules and filters.
Rule Development
Start Simple: First create rules for narrow, high-fidelity patterns. Steer clear of excessively broad rules that introduce alert noise.
Limit Scope: Always specify
dataTypes. This keeps the engine from wasting CPU cycles on firewall rule checks against Windows event logs.Use Deduplication: Always define
deduplicateBy. This stops the system from producing hundreds of duplicate alerts for one ongoing attack.Document Intention: Use the
descriptionandreferencesfields. This allows SOC analysts to see why an alert fired and how to react.Optimize CEL: CEL expressions run quickly, but deeply nested logic can introduce delay. Keep the
whereKeep the clause as succinct as possible.
Filter & Pipeline Design
Standardize Naming: Always map raw fields to the Unified Security Stack Common Schema (e.g.,
origin.ip,target.user,action).Clean as you Go: Use the
deletestep to remove temporary metadata and unnecessarylog.*fields after normalization finishes. Concentrate on fields that rules or dashboards no longer need.Note: The
rawfield remains protected for auditing reasons and parsing steps cannot remove it.Handle Edge Cases: Use
whereclauses to ensure steps only run when fields exist (e.g.,where: exists("origin.ip")).Use Built-in Patterns: In
grok, favor built-in patterns like{{.ipv4}}instead of custom regex. They are already optimized and easier to read.Stage Logical Changes: Group renames together, then casts, then enrichment. This makes the YAML simpler for other developers to understand.
Performance Checklist
Are data types limited?
Are correlation windows (
withinIs the time in rules limited to the minimum required?are
correlationcounts reasonable? (Max recommended is 50).