Create reusable components to keep your rules clean and maintainable
Lists and Macros are reusable components defined at the file level (before rules) that can be used by multiple rules in the same file.
Important: lists and macros are NOT fields within a rule. They are separate components defined at the file level, before your rules. This allows them to be reused by multiple rules in the same file.
Lists are reusable address/value collections. Define them once at the top of your file, then reference them in any rule’s condition using the in operator:
Lists and Macros are defined outside of rules (at the file level), but in the same file as your rules
They must be defined before the rules that use them
Macros are expanded when rules are evaluated, allowing you to reuse condition logic
Lists used with the in operator are resolved at evaluation time
Multiple rules in the same file can reference the same list or macro
File Organization: While lists and macros can be shared across rules in the same file, it’s a best practice to group related rules together (e.g., same category, threat type, or protocol). This makes maintenance easier and keeps your rule base organized. See Rule Structure for more details.