]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - config/snort/snort.conf
Merge remote-tracking branch 'origin/next' into kernel-update
[people/teissler/ipfire-2.x.git] / config / snort / snort.conf
CommitLineData
767cb737 1###################################################
89f3d66c 2# IPFire snort.conf
75a786b6 3#
89f3d66c 4# some parts of this file are changed/updated by the webif
cd1a2927 5###################################################
89f3d66c
AF
6# VERSIONS : 2.9.1.1
7
8include /etc/snort/vars
767cb737 9
75a786b6
CS
10###################################################
11# Step #1: Set the network variables. For more information, see README.variables
12###################################################
13
8dc25f04 14# taken from /etc/snort vars
89f3d66c 15#ipvar HOME_NET any
767cb737 16
89f3d66c
AF
17# Set up the external network addresses. Leave as "any" in most situations
18ipvar EXTERNAL_NET any
767cb737 19
767cb737 20# List of DNS servers on your network
89f3d66c 21#ipvar DNS_SERVERS $HOME_NET
767cb737
SS
22
23# List of SMTP servers on your network
89f3d66c 24ipvar SMTP_SERVERS $HOME_NET
767cb737
SS
25
26# List of web servers on your network
89f3d66c 27ipvar HTTP_SERVERS $HOME_NET
767cb737
SS
28
29# List of sql servers on your network
89f3d66c 30ipvar SQL_SERVERS $HOME_NET
767cb737
SS
31
32# List of telnet servers on your network
89f3d66c 33ipvar TELNET_SERVERS $HOME_NET
767cb737 34
c07e938e 35# List of ssh servers on your network
89f3d66c
AF
36ipvar SSH_SERVERS $HOME_NET
37
38# List of ftp servers on your network
39ipvar FTP_SERVERS $HOME_NET
40
41# List of sip servers on your network
42ipvar SIP_SERVERS $HOME_NET
767cb737 43
c07e938e 44# List of ports you run web servers on
89f3d66c 45portvar HTTP_PORTS [80,81,311,444,591,593,901,1220,1414,1830,2301,2381,2809,3128,3702,5250,7001,7777,7779,8000,8008,8028,8080,8088,8118,8123,8180,8181,8243,8280,8888,9090,9091,9443,9999,11371]
8dc25f04 46
75a786b6 47# List of ports you want to look for SHELLCODE on.
767cb737
SS
48portvar SHELLCODE_PORTS !80
49
75a786b6 50# List of ports you might see oracle attacks on
c07e938e 51portvar ORACLE_PORTS 1024:
89f3d66c
AF
52
53# List of ports you want to look for SSH connections on:
54portvar SSH_PORTS [22,222]
55
56# List of ports you run ftp servers on
57portvar FTP_PORTS [21,2100,3535]
58
59# List of ports you run SIP servers on
60portvar SIP_PORTS [5060,5061,5600]
61
75a786b6 62# other variables, these should not be modified
89f3d66c 63ipvar AIM_SERVERS [64.12.24.0/23,64.12.28.0/23,64.12.161.0/24,64.12.163.0/24,64.12.200.0/24,205.188.3.0/24,205.188.5.0/24,205.188.7.0/24,205.188.9.0/24,205.188.153.0/24,205.188.179.0/24,205.188.248.0/24]
767cb737
SS
64
65# Path to your rules files (this can be a relative path)
66# Note for Windows users: You are advised to make this an absolute path,
67# such as: c:\snort\rules
68var RULE_PATH /etc/snort/rules
75a786b6 69var SO_RULE_PATH /etc/snort/so_rules
767cb737
SS
70var PREPROC_RULE_PATH /etc/snort/preproc_rules
71
89f3d66c 72
75a786b6
CS
73###################################################
74# Step #2: Configure the decoder. For more information, see README.decode
75###################################################
76
767cb737 77# Stop generic decode events:
f9866a72 78config disable_decode_alerts
75a786b6 79
767cb737 80# Stop Alerts on experimental TCP options
75a786b6
CS
81config disable_tcpopt_experimental_alerts
82
767cb737 83# Stop Alerts on obsolete TCP options
75a786b6
CS
84config disable_tcpopt_obsolete_alerts
85
767cb737 86# Stop Alerts on T/TCP alerts
89f3d66c 87# config disable_tcpopt_ttcp_alerts
75a786b6 88
767cb737 89# Stop Alerts on all other TCPOption type events:
f9866a72 90config disable_tcpopt_alerts
75a786b6 91
767cb737 92# Stop Alerts on invalid ip options
89f3d66c 93# config disable_ipopt_alerts
75a786b6
CS
94
95# Alert if value in length field (IP, TCP, UDP) is greater th elength of the packet
767cb737 96# config enable_decode_oversized_alerts
75a786b6
CS
97
98# Same as above, but drop packet if in Inline mode (requires enable_decode_oversized_alerts)
767cb737 99# config enable_decode_oversized_drops
767cb737 100
75a786b6
CS
101# Configure IP / TCP checksum mode
102config checksum_mode: all
103
104# Configure maximum number of flowbit references. For more information, see README.flowbits
105# config flowbits_size: 64
106
107# Configure ports to ignore
108# config ignore_ports: tcp 21 6667:6671 1356
109# config ignore_ports: udp 1:17 53
110
c07e938e
CS
111# Configure active response for non inline operation. For more information, see REAMDE.active
112# config response: eth0 attempts 2
89f3d66c
AF
113
114# Configure DAQ related options for inline operation. For more information, see README.daq
115#
116# config daq: <type>
117# config daq_dir: <dir>
118# config daq_mode: <mode>
119# config daq_var: <var>
120#
121# <type> ::= pcap | afpacket | dump | nfq | ipq | ipfw
122# <mode> ::= read-file | passive | inline
123# <var> ::= arbitrary <name>=<value passed to DAQ
124# <dir> ::= path as to where to look for DAQ module so's
125
126# Configure specific UID and GID to run snort as after dropping privs. For more information see snort -h command line options
127#
128# config set_gid:
129# config set_uid:
130
131# Configure default snaplen. Snort defaults to MTU of in use interface. For more information see README
132#
133# config snaplen:
134#
135
136# Configure default bpf_file to use for filtering what traffic reaches snort. For more information see snort -h command line options (-F)
137#
138# config bpf_file:
139#
140
141# Configure default log directory for snort to log to. For more information see snort -h command line options (-l)
142#
143# config logdir:
144
145
75a786b6
CS
146###################################################
147# Step #3: Configure the base detection engine. For more information, see README.decode
148###################################################
149
150# Configure PCRE match limitations
c07e938e 151config pcre_match_limit: 3500
75a786b6
CS
152config pcre_match_limit_recursion: 1500
153
154# Configure the detection engine See the Snort Manual, Configuring Snort - Includes - Config
c07e938e 155config detection: search-method ac-split search-optimize max-pattern-len 20
75a786b6
CS
156
157# Configure the event queue. For more information, see README.event_queue
158config event_queue: max_queue 8 log 3 order_events content_length
159
c07e938e
CS
160###################################################
161# Per packet and rule latency enforcement
162# For more information see README.ppm
163###################################################
164
165# Per Packet latency configuration
166#config ppm: max-pkt-time 250, \
167# fastpath-expensive-packets, \
168# pkt-log
169
170# Per Rule latency configuration
171#config ppm: max-rule-time 200, \
172# threshold 3, \
173# suspend-expensive-rules, \
174# suspend-timeout 20, \
175# rule-log alert
767cb737 176
c07e938e
CS
177###################################################
178# Configure Perf Profiling for debugging
179# For more information see README.PerfProfiling
180###################################################
75a786b6 181
c07e938e
CS
182#config profile_rules: print all, sort avg_ticks
183#config profile_preprocs: print all, sort avg_ticks
89f3d66c 184
cd1a2927 185###################################################
75a786b6
CS
186# Step #4: Configure dynamic loaded libraries.
187# For more information, see Snort Manual, Configuring Snort - Dynamic Modules
188###################################################
189
190# path to dynamic preprocessor libraries
4fba936c 191dynamicpreprocessor directory /usr/lib/snort_dynamicpreprocessor/
75a786b6
CS
192
193# path to base preprocessor engine
767cb737 194dynamicengine /usr/lib/snort_dynamicengine/libsf_engine.so
cd1a2927 195
75a786b6 196# path to dynamic rules libraries
89f3d66c 197# dynamicdetection directory /usr/local/lib/snort_dynamicrules
767cb737 198
75a786b6
CS
199###################################################
200# Step #5: Configure preprocessors
201# For more information, see the Snort Manual, Configuring Snort - Preprocessors
202###################################################
203
c07e938e
CS
204# Inline packet normalization. For more information, see README.normalize
205# Does nothing in IDS mode
206preprocessor normalize_ip4
207preprocessor normalize_tcp: ips ecn stream
208preprocessor normalize_icmp4
89f3d66c
AF
209preprocessor normalize_ip6
210preprocessor normalize_icmp6
c07e938e 211
75a786b6
CS
212# Target-based IP defragmentation. For more inforation, see README.frag3
213preprocessor frag3_global: max_frags 65536
c07e938e 214preprocessor frag3_engine: policy windows detect_anomalies overlap_limit 10 min_fragment_length 100 timeout 180
767cb737 215
75a786b6 216# Target-Based stateful inspection/stream reassembly. For more inforation, see README.stream5
89f3d66c
AF
217preprocessor stream5_global: track_tcp yes, \
218 track_udp yes, \
219 track_icmp no, \
220 max_tcp 262144, \
221 max_udp 131072, \
222 max_active_responses 2, \
223 min_response_seconds 5
c07e938e
CS
224preprocessor stream5_tcp: policy windows, detect_anomalies, require_3whs 180, \
225 overlap_limit 10, small_segments 3 bytes 150, timeout 180, \
226 ports client 21 22 23 25 42 53 79 109 110 111 113 119 135 136 137 139 143 \
227 161 445 513 514 587 593 691 1433 1521 2100 3306 6070 6665 6666 6667 6668 6669 \
89f3d66c
AF
228 7000 8181 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779, \
229 ports both 80 81 311 443 465 563 591 593 636 901 989 992 993 994 995 1220 1414 1830 2301 2381 2809 3128 3702 5250 7907 7001 7802 7777 7779 \
c07e938e
CS
230 7801 7900 7901 7902 7903 7904 7905 7906 7908 7909 7910 7911 7912 7913 7914 7915 7916 \
231 7917 7918 7919 7920 8000 8008 8028 8080 8088 8118 8123 8180 8243 8280 8888 9090 9091 9443 9999 11371
232preprocessor stream5_udp: timeout 180
75a786b6
CS
233
234# performance statistics. For more information, see the Snort Manual, Configuring Snort - Preprocessors - Performance Monitor
235# preprocessor perfmonitor: time 300 file /var/snort/snort.stats pktcnt 10000
767cb737 236
75a786b6 237# HTTP normalization and anomaly detection. For more information, see README.http_inspect
89f3d66c 238preprocessor http_inspect: global iis_unicode_map unicode.map 1252 compress_depth 65535 decompress_depth 65535
75a786b6 239preprocessor http_inspect_server: server default \
c07e938e
CS
240 chunk_length 500000 \
241 server_flow_depth 0 \
242 client_flow_depth 0 \
243 post_depth 65495 \
244 oversize_dir_length 500 \
245 max_header_length 750 \
246 max_headers 100 \
89f3d66c 247 ports { 80 81 311 591 593 901 1220 1414 1830 2301 2381 2809 3128 3702 5250 7001 7777 7779 8000 8008 8028 8080 8088 8118 8123 8180 8181 8243 8280 8888 9090 9091 9443 9999 11371 } \
c07e938e
CS
248 non_rfc_char { 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 } \
249 enable_cookie \
250 extended_response_inspection \
251 inspect_gzip \
252 normalize_utf \
253 unlimited_decompress \
75a786b6
CS
254 apache_whitespace no \
255 ascii no \
c07e938e 256 bare_byte no \
c07e938e
CS
257 directory no \
258 double_decode no \
259 iis_backslash no \
260 iis_delimiter no \
261 iis_unicode no \
262 multi_slash no \
89f3d66c 263 utf_8 no \
c07e938e
CS
264 u_encode yes \
265 webroot no
75a786b6
CS
266
267# ONC-RPC normalization and anomaly detection. For more information, see the Snort Manual, Configuring Snort - Preprocessors - RPC Decode
268preprocessor rpc_decode: 111 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779 no_alert_multiple_requests no_alert_large_fragments no_alert_incomplete
269
270# Back Orifice detection.
271preprocessor bo
272
273# FTP / Telnet normalization and anomaly detection. For more information, see README.ftptelnet
c07e938e 274preprocessor ftp_telnet: global inspection_type stateful encrypted_traffic no
4fba936c 275preprocessor ftp_telnet_protocol: telnet \
75a786b6
CS
276 ayt_attack_thresh 20 \
277 normalize ports { 23 } \
278 detect_anomalies
4fba936c 279preprocessor ftp_telnet_protocol: ftp server default \
75a786b6 280 def_max_param_len 100 \
c07e938e
CS
281 ports { 21 2100 3535 } \
282 telnet_cmds yes \
283 ignore_telnet_erase_cmds yes \
284 ftp_cmds { ABOR ACCT ADAT ALLO APPE AUTH CCC CDUP } \
285 ftp_cmds { CEL CLNT CMD CONF CWD DELE ENC EPRT } \
286 ftp_cmds { EPSV ESTA ESTP FEAT HELP LANG LIST LPRT } \
287 ftp_cmds { LPSV MACB MAIL MDTM MIC MKD MLSD MLST } \
288 ftp_cmds { MODE NLST NOOP OPTS PASS PASV PBSZ PORT } \
289 ftp_cmds { PROT PWD QUIT REIN REST RETR RMD RNFR } \
290 ftp_cmds { RNTO SDUP SITE SIZE SMNT STAT STOR STOU } \
291 ftp_cmds { STRU SYST TEST TYPE USER XCUP XCRC XCWD } \
292 ftp_cmds { XMAS XMD5 XMKD XPWD XRCP XRMD XRSQ XSEM } \
293 ftp_cmds { XSEN XSHA1 XSHA256 } \
294 alt_max_param_len 0 { ABOR CCC CDUP ESTA FEAT LPSV NOOP PASV PWD QUIT REIN STOU SYST XCUP XPWD } \
295 alt_max_param_len 200 { ALLO APPE CMD HELP NLST RETR RNFR STOR STOU XMKD } \
296 alt_max_param_len 256 { CWD RNTO } \
75a786b6
CS
297 alt_max_param_len 400 { PORT } \
298 alt_max_param_len 512 { SIZE } \
c07e938e
CS
299 chk_str_fmt { ACCT ADAT ALLO APPE AUTH CEL CLNT CMD } \
300 chk_str_fmt { CONF CWD DELE ENC EPRT EPSV ESTP HELP } \
301 chk_str_fmt { LANG LIST LPRT MACB MAIL MDTM MIC MKD } \
302 chk_str_fmt { MLSD MLST MODE NLST OPTS PASS PBSZ PORT } \
303 chk_str_fmt { PROT REST RETR RMD RNFR RNTO SDUP SITE } \
304 chk_str_fmt { SIZE SMNT STAT STOR STRU TEST TYPE USER } \
305 chk_str_fmt { XCRC XCWD XMAS XMD5 XMKD XRCP XRMD XRSQ } \
306 chk_str_fmt { XSEM XSEN XSHA1 XSHA256 } \
307 cmd_validity ALLO < int [ char R int ] > \
308 cmd_validity EPSV < [ { char 12 | char A char L char L } ] > \
309 cmd_validity MACB < string > \
75a786b6 310 cmd_validity MDTM < [ date nnnnnnnnnnnnnn[.n[n[n]]] ] string > \
c07e938e
CS
311 cmd_validity MODE < char ASBCZ > \
312 cmd_validity PORT < host_port > \
313 cmd_validity PROT < char CSEP > \
314 cmd_validity STRU < char FRPO [ string ] > \
315 cmd_validity TYPE < { char AE [ char NTC ] | char I | char L [ number ] } >
4fba936c 316preprocessor ftp_telnet_protocol: ftp client default \
75a786b6
CS
317 max_resp_len 256 \
318 bounce yes \
c07e938e
CS
319 ignore_telnet_erase_cmds yes \
320 telnet_cmds yes
767cb737 321
89f3d66c 322
75a786b6 323# SMTP normalization and anomaly detection. For more information, see README.SMTP
14820894 324preprocessor smtp: ports { 25 465 587 691 } \
c07e938e 325 inspection_type stateful \
89f3d66c
AF
326 b64_decode_depth 0 \
327 qp_decode_depth 0 \
328 bitenc_decode_depth 0 \
329 uu_decode_depth 0 \
330 log_mailfrom \
331 log_rcptto \
332 log_filename \
333 log_email_hdrs \
c07e938e
CS
334 normalize cmds \
335 normalize_cmds { ATRN AUTH BDAT CHUNKING DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY } \
336 normalize_cmds { EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND SOML } \
337 normalize_cmds { STARTTLS TICK TIME TURN TURNME VERB VRFY X-ADAT X-DRCP X-ERCP X-EXCH50 } \
338 normalize_cmds { X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \
339 max_command_line_len 512 \
340 max_header_line_len 1000 \
341 max_response_line_len 512 \
342 alt_max_command_line_len 260 { MAIL } \
343 alt_max_command_line_len 300 { RCPT } \
344 alt_max_command_line_len 500 { HELP HELO ETRN EHLO } \
345 alt_max_command_line_len 255 { EXPN VRFY ATRN SIZE BDAT DEBUG EMAL ESAM ESND ESOM EVFY IDENT NOOP RSET } \
346 alt_max_command_line_len 246 { SEND SAML SOML AUTH TURN ETRN DATA RSET QUIT ONEX QUEU STARTTLS TICK TIME TURNME VERB X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \
347 valid_cmds { ATRN AUTH BDAT CHUNKING DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY } \
348 valid_cmds { EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND SOML } \
349 valid_cmds { STARTTLS TICK TIME TURN TURNME VERB VRFY X-ADAT X-DRCP X-ERCP X-EXCH50 } \
350 valid_cmds { X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \
351 xlink2state { enabled }
767cb737 352
75a786b6 353# Portscan detection. For more information, see README.sfportscan
14820894 354preprocessor sfportscan: proto { all } memcap { 10000000 } sense_level { medium }
767cb737 355
75a786b6
CS
356# ARP spoof detection. For more information, see the Snort Manual - Configuring Snort - Preprocessors - ARP Spoof Preprocessor
357# preprocessor arpspoof
358# preprocessor arpspoof_detect_host: 192.168.40.1 f0:0f:00:f0:0f:00
8581d1ef 359
75a786b6 360# SSH anomaly detection. For more information, see README.ssh
89f3d66c 361preprocessor ssh: server_ports { 22,222 } \
c07e938e 362 autodetect \
75a786b6
CS
363 max_client_bytes 19600 \
364 max_encrypted_packets 20 \
c07e938e 365 max_server_version_len 100 \
75a786b6
CS
366 enable_respoverflow enable_ssh1crc32 \
367 enable_srvoverflow enable_protomismatch
8581d1ef 368
75a786b6
CS
369# SMB / DCE-RPC normalization and anomaly detection. For more information, see README.dcerpc2
370preprocessor dcerpc2: memcap 102400, events [co ]
371preprocessor dcerpc2_server: default, policy WinXP, \
372 detect [smb [139,445], tcp 135, udp 135, rpc-over-http-server 593], \
373 autodetect [tcp 1025:, udp 1025:, rpc-over-http-server 1025:], \
89f3d66c 374 smb_max_chain 3, smb_invalid_shares ["C$", "D$", "ADMIN$"]
767cb737 375
75a786b6
CS
376# DNS anomaly detection. For more information, see README.dns
377preprocessor dns: ports { 53 } enable_rdata_overflow
767cb737 378
75a786b6 379# SSL anomaly detection and traffic bypass. For more information, see README.ssl
89f3d66c 380preprocessor ssl: ports { 443 444 465 563 636 989 992 993 994 995 7801 7802 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 }, trustservers, noinspect_encrypted
767cb737 381
c07e938e
CS
382# SDF sensitive data preprocessor. For more information see README.sensitive_data
383preprocessor sensitive_data: alert_threshold 25
767cb737 384
89f3d66c
AF
385# SIP Session Initiation Protocol preprocessor. For more information see README.sip
386preprocessor sip: max_sessions 10000, \
387 ports { 5060 5061 5600 }, \
388 methods { invite \
389 cancel \
390 ack \
391 bye \
392 register \
393 options \
394 refer \
395 subscribe \
396 update \
397 join \
398 info \
399 message \
400 notify \
401 benotify \
402 do \
403 qauth \
404 sprack \
405 publish \
406 service \
407 unsubscribe \
408 prack }, \
409 max_uri_len 512, \
410 max_call_id_len 80, \
411 max_requestName_len 20, \
412 max_from_len 256, \
413 max_to_len 256, \
414 max_via_len 1024, \
415 max_contact_len 512, \
416 max_content_len 1024
417
418# IMAP preprocessor. For more information see README.imap
419preprocessor imap: \
420 ports { 143 } \
421 b64_decode_depth 0 \
422 qp_decode_depth 0 \
423 bitenc_decode_depth 0 \
424 uu_decode_depth 0
425
426# POP preprocessor. For more information see README.pop
427preprocessor pop: \
428 ports { 110 } \
429 b64_decode_depth 0 \
430 qp_decode_depth 0 \
431 bitenc_decode_depth 0 \
432 uu_decode_depth 0
433
75a786b6
CS
434###################################################
435# Step #6: Configure output plugins
436# For more information, see Snort Manual, Configuring Snort - Output Modules
437###################################################
767cb737 438
c07e938e
CS
439# unified2
440# Recommended for most installs
441# output unified2: filename merged.log, limit 128, nostamp, mpls_event_types, vlan_event_types
442
443# Additional configuration for specific types of installs
444# output alert_unified2: filename snort.alert, limit 128, nostamp
445# output log_unified2: filename snort.log, limit 128, nostamp
89f3d66c 446
75a786b6 447# syslog
767cb737 448# output alert_syslog: LOG_AUTH LOG_ALERT
767cb737 449
75a786b6 450# pcap
767cb737
SS
451# output log_tcpdump: tcpdump.log
452
75a786b6
CS
453# database
454# output database: alert, <db_type>, user=<username> password=<password> test dbname=<name> host=<hostname>
455# output database: log, <db_type>, user=<username> password=<password> test dbname=<name> host=<hostname>
456
75a786b6 457# prelude
767cb737 458# output alert_prelude
767cb737 459
75a786b6 460# metadata reference data. do not modify these lines
767cb737 461include /etc/snort/rules/classification.config
767cb737
SS
462include /etc/snort/rules/reference.config
463
767cb737 464
75a786b6
CS
465###################################################
466# Step #7: Customize your rule set
467# For more information, see Snort Manual, Writing Snort Rules
468###################################################
767cb737 469
89f3d66c 470#
75a786b6 471# site specific rules
89f3d66c 472#