What the binder does
The binder is an ordered list ofwhen/use rules. When a session starts — and again if the service on that session is later identified — Snort walks the list top to bottom and applies the first matching binding for network criteria and the first matching binding for service criteria.
binder.when specifies the matching criteria. binder.use specifies what to do: allow the traffic, load a config file, or assign an inspector.
Binding criteria (when)
| Field | Type | Description |
|---|---|---|
proto | string | Layer 4 protocol: tcp, udp, ip, icmp |
ports | string | Space-separated port list or range, e.g. '80 8080' or '1024:' |
nets | string | CIDR network, e.g. '192.168.0.0/16' |
vlans | string | VLAN ID(s) |
iface | string | Network interface name |
service | string | Service name identified by the wizard or appid |
role | string | 'server' or 'client' — constrains which side the port applies to |
Binding actions (use)
| Field | Description |
|---|---|
action | 'allow', 'block', or 'inspect' |
file | Path to a Lua config file to apply to matching sessions |
type | Name of an inspector module to assign |
name | Instance name of the inspector (for non-default instances) |
The full default binder
Thesnort.lua default configuration ships with a comprehensive binder:
Common binding patterns
Allow traffic on a port (ignore)
Allow traffic on a port (ignore)
Equivalent to Snort 2’s
config ignore_ports:Select a config file by VLAN
Select a config file by VLAN
Equivalent to Snort 2’s
config binding by vlan:Use a non-default inspector instance
Use a non-default inspector instance
Equivalent to a targeted preprocessor config in Snort 2:
Add a port binding with a tweak file
Add a port binding with a tweak file
The
balanced.lua tweak inserts an explicit HTTP port binding at position 1 for performance:The wizard and autodetection
The wizard is an inspector that identifies services by inspecting the initial payload of a session, without relying on port numbers. It is the catch-all binding at the bottom of the binder list:snort_defaults.lua:
| Pattern type | How it works | Example protocols |
|---|---|---|
| Spells | Case-insensitive text patterns with glob wildcards | HTTP, SMTP, FTP, SSH, SIP |
| Hexes | Hexadecimal byte patterns with single-byte wildcards (?) | DNP3, SSL/TLS, HTTP/2, Telnet |
| Curses | Internal C++ state-machine algorithms | DCE/RPC (UDP/TCP/SMB), MMS, OPCUA, SSLv2 |
Port bindings at the top of the binder list take priority over wizard identification. Use explicit port bindings for protocols like DNS (port 53) and Modbus (port 502) that do not have reliable text signatures.
Default binder
If the binder is not explicitly configured in any Lua file or--lua option, Snort instantiates a default binder that creates service bindings for all configured service inspectors. Some of those bindings may require the wizard to detect the service type.
Unlike Snort 2, where bindings could only be configured in the default policy, each Snort 3 policy can contain its own binder. This allows an arbitrary hierarchy of policies.

