| Main Archive Page > Month Archives > snort-users archives |
README.filters was accidentally missing from the packages.
It is attached for your reference when testing out the beta.
Snort Releases wrote: > A beta version of Snort 2.8.5 is now available on snort.org, at > http://www.snort.org/dl/ > > Snort 2.8.5 introduces: > > - Ability to specify multiple configurations (snort.conf and everything > it includes), bound either by Vlan ID or IP Address. This allows you > to run one instance of Snort with multiple snort.conf, rather than > having separate processes. > > - Continued inspection of traffic while reloading a configuration. > Add --enable-reload option to your configure script prior to building. > > - Rate Based Attack prevention for Connection Attempts, Concurrent > Connections, and improved rule/event filtering. See README.filters > for details. > > - SSH preprocessor (no longer experimental) > > - Performance improvements in various places > > Please see the Release Notes and ChangeLog for more details. > > Please submit bugs, questions, and feedback to snort-beta@sourcefire.com. > > Happy Snorting! > The Snort Release Team >
OVERVIEW OF FILTERS
This document describes the detection, rate, and event filtering in Snort 2.8.5 which control the generation, processing, and logging of events as follows:
Note: this README supercedes README.thresholding which is now deprecated.
DEPRECATED ITEMS
DETECTION FILTERS
detection_filter is a new rule option that replaces the current threshold keyword in a rule. It defines a rate which must be exceeded by a source or destination host before a rule can generate an event. detection_filter has the following format:
detection_filter: \
track <by_src|by_dst>, \
count <c>, seconds <s>;
Snort evaluates a detection_filter as part of the detection phase, just after pattern matching. At most one detection_filter is permitted per rule.
Example - this rule will fire on every failed login attempt from 10.1.2.100 during one sampling period of 60 seconds, after the first 30 failed login attempts:
drop tcp 10.1.2.100 any > 10.1.1.100 22 ( \
msg:”SSH Brute Force Attempt”;
flow:established,to_server; \
content:”SSH”; nocase; offset:0; depth:4; \
detection_filter: track by_src, count 30, seconds 60; \
sid:1000001; rev:1;)
Since potentially many events will be generated, a detection_filter would normally be used in conjunction with an event_filter to reduce the number of logged events.
RATE FILTERS
rate_filter provides rate based attack prevention by allowing users to configure a new action to take for a specified time when a given rate is exceeded. Multiple rate filters can be defined on the same rule, in which case they are evaluated in the order they appear in the configuration file, and the first applicable action is taken.
Rate filters are used as standalone commands (outside any rule) and have the following format:
rate filter \
gen_id <gid>, sig_id <sid>, \
track <by_src|by_dst|by_rule>, \
count <c>, seconds <s>, \
new_action alert|drop|pass|log|sdrop|reject, \
timeout <seconds>, \
apply_to <ip-list>;
This format has the following options - all are required except apply_to, which is optional:
event_filters (below) can be used to suppress excessive rate_filter alerts, however, the first new_action event of the timeout period is never suppressed. Such events indicate a change of state that are significant to the user monitoring the network.
Example 1 - allow a maximum of 100 connection attempts per second from any one IP address, and block further connection attempts from that IP address for 10 seconds:
rate_filter \
gen_id 135, sig_id 1, \
track by_src, \
count 100, seconds 1, \
new_action drop, timeout 10;
Example 2 - allow a maximum of 100 successful simultaneous connections from any one IP address, and block further connections from that IP address for 10 seconds:
rate_filter \
gen_id 135, sig_id 2, \
track by_src, \
count 100, seconds 0, \
new_action drop, timeout 10;
EVENT FILTERS
In Snort 2.8.5, a new command event_filter was added with the following format. It functions the same as the global threshold command does in Snort 2.8.4 and earlier, except that it is not permitted within a rule.
event_filter \
gen_id <gid>, sig_id <sid>, \
type <limit|threshold|both>, \
track <by_src|by_dst>, \
count <c>, seconds <s>
This format supports the following options - all are required:
Example 1 - rule event_filter - limit to logging 1 event per 60 seconds:
event_filter \
gen_id 1, sig_id 1851, \
type limit, track by_src, \
count 1, seconds 60
Example 2 - rule event_filter - limit to logging every 3rd event:
event_filter \
gen_id 1, sig_id 1852,
type threshold, track by_src, \
count 3, seconds 60
Example 3 - rule event_filter - limit to logging just 1 event per 60 seconds, but only if we exceed 30 events in 60 seconds:
event_filter \
gen_id 1, sig_id 1853, \
type both, track by_src, \
count 30, seconds 60
Example 4 - global event_filter - limit to logging 1 event per 60 seconds per IP triggering each rule:
event_filter \
gen_id 1, sig_id 0, \
type limit, track by_src, \
count 1, seconds 60
Example 5 - global event_filter - limit to logging 1 event per 60 seconds per IP triggering each rule for each event generator:
event_filter \
gen_id 0, sig_id 0, \
type limit, track by_src, \
count 1, seconds 60
EVENT SUPPRESSION
Suppression commands are standalone commands that reference generators and SIDs and IP addresses via an IP list. This allows a rule to be completely suppressed, or suppressed when the causative traffic is going to or coming from a specific IP or group of IP addresses.
The suppress command has these formats:
suppress \
gen_id <gid>, sid_id <sid>
suppress \
gen_id <gid>, sid_id <sid>, \
track by_src|by_dst, \
ip <ip-list>
Example 1 - suppress this event completely:
suppress \
gen_id 1, sig_id 1852
Example 2 - suppress this event from this IP:
suppress \
gen_id 1, sig_id 1852, \
track by_src, ip 10.1.1.54
Example 3 - suppress this event to this CIDR block:
suppress \
gen_id 1, sig_id 1852, \
track by_dst, ip 10.1.1.0/24
MEMORY CAPS
Memory caps can be configured for maximum storage of run-time data (excludes configuration) as follows:
config rate_filter: memcap <bytes>
config event_filter: memcap <bytes>
If the rate_filter reaches its memcap, it will recycle memory by releasing the oldest tracker and using that memory for a new tracker. The event_filter works the same way.
The default in both cases is 1048576 bytes (1MB). (Internally, global event_ filters (sid_id = 0) are tracked separately from local event_filters (sid_id != 0) and the memcap limit is applied to each group separately, yielding 2*memcap total for event_filter.)