· 8 years ago · Oct 02, 2017, 09:06 PM
1%YAML 1.1
2---
3
4# Suricata configuration file. In addition to the comments describing all
5# options in this file, full documentation can be found at:
6# https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Suricatayaml
7
8##
9## Step 1: inform Suricata about your network
10##
11
12vars:
13 # more specifc is better for alert accuracy and performance
14 address-groups:
15 HOME_NET: "[192.168.0.0/16,10.0.0.0/8,172.16.0.0/12]"
16 #HOME_NET: "[192.168.0.0/16]"
17 #HOME_NET: "[10.0.0.0/8]"
18 #HOME_NET: "[172.16.0.0/12]"
19 #HOME_NET: "any"
20
21 EXTERNAL_NET: "!$HOME_NET"
22 #EXTERNAL_NET: "any"
23
24 HTTP_SERVERS: "$HOME_NET"
25 SMTP_SERVERS: "$HOME_NET"
26 SQL_SERVERS: "$HOME_NET"
27 DNS_SERVERS: "$HOME_NET"
28 TELNET_SERVERS: "$HOME_NET"
29 AIM_SERVERS: "$EXTERNAL_NET"
30 DNP3_SERVER: "$HOME_NET"
31 DNP3_CLIENT: "$HOME_NET"
32 MODBUS_CLIENT: "$HOME_NET"
33 MODBUS_SERVER: "$HOME_NET"
34 ENIP_CLIENT: "$HOME_NET"
35 ENIP_SERVER: "$HOME_NET"
36
37 port-groups:
38 HTTP_PORTS: "80"
39 SHELLCODE_PORTS: "!80"
40 ORACLE_PORTS: 1521
41 SSH_PORTS: 22
42 DNP3_PORTS: 20000
43 MODBUS_PORTS: 502
44 FILE_DATA_PORTS: "[$HTTP_PORTS,110,143]"
45 FTP_PORTS: 21
46
47
48##
49## Step 2: select the rules to enable or disable
50##
51
52default-rule-path: /usr/local/etc/suricata/rules
53rule-files:
54 - botcc.rules
55 # - botcc.portgrouped.rules
56 - ciarmy.rules
57 - compromised.rules
58 - drop.rules
59 - dshield.rules
60# - emerging-activex.rules
61 - emerging-attack_response.rules
62 - emerging-chat.rules
63 - emerging-current_events.rules
64 - emerging-dns.rules
65 - emerging-dos.rules
66 - emerging-exploit.rules
67 - emerging-ftp.rules
68# - emerging-games.rules
69# - emerging-icmp_info.rules
70# - emerging-icmp.rules
71 - emerging-imap.rules
72# - emerging-inappropriate.rules
73# - emerging-info.rules
74 - emerging-malware.rules
75 - emerging-misc.rules
76 - emerging-mobile_malware.rules
77 - emerging-netbios.rules
78 - emerging-p2p.rules
79 - emerging-policy.rules
80 - emerging-pop3.rules
81 - emerging-rpc.rules
82# - emerging-scada.rules
83# - emerging-scada_special.rules
84 - emerging-scan.rules
85# - emerging-shellcode.rules
86 - emerging-smtp.rules
87 - emerging-snmp.rules
88 - emerging-sql.rules
89 - emerging-telnet.rules
90 - emerging-tftp.rules
91 - emerging-trojan.rules
92 - emerging-user_agents.rules
93 - emerging-voip.rules
94 - emerging-web_client.rules
95 - emerging-web_server.rules
96# - emerging-web_specific_apps.rules
97 - emerging-worm.rules
98 - tor.rules
99# - decoder-events.rules # available in suricata sources under rules dir
100# - stream-events.rules # available in suricata sources under rules dir
101 - http-events.rules # available in suricata sources under rules dir
102 - smtp-events.rules # available in suricata sources under rules dir
103 - dns-events.rules # available in suricata sources under rules dir
104 - tls-events.rules # available in suricata sources under rules dir
105# - modbus-events.rules # available in suricata sources under rules dir
106# - app-layer-events.rules # available in suricata sources under rules dir
107# - dnp3-events.rules # available in suricata sources under rules dir
108# - ntp-events.rules # available in suricata sources under rules dir
109
110classification-file: /usr/local/etc/suricata/classification.config
111reference-config-file: /usr/local/etc/suricata/reference.config
112# threshold-file: /usr/local/etc/suricata/threshold.config
113
114
115##
116## Step 3: select outputs to enable
117##
118
119# The default logging directory. Any log or output file will be
120# placed here if its not specified with a full path name. This can be
121# overridden with the -l command line parameter.
122default-log-dir: /var/log/suricata/
123
124# global stats configuration
125stats:
126 enabled: yes
127 # The interval field (in seconds) controls at what interval
128 # the loggers are invoked.
129 interval: 8
130
131# Configure the type of alert (and other) logging you would like.
132outputs:
133 # a line based alerts log similar to Snort's fast.log
134 - fast:
135 enabled: yes
136 filename: fast.log
137 append: yes
138 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
139
140 # Extensible Event Format (nicknamed EVE) event log in JSON format
141 - eve-log:
142 enabled: yes
143 filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
144 filename: eve.json
145 #prefix: "@cee: " # prefix to prepend to each log entry
146 # the following are valid when type: syslog above
147 #identity: "suricata"
148 #facility: local5
149 #level: Info ## possible levels: Emergency, Alert, Critical,
150 ## Error, Warning, Notice, Info, Debug
151 #redis:
152 # server: 127.0.0.1
153 # port: 6379
154 # async: true ## if redis replies are read asynchronously
155 # mode: list ## possible values: list (default), channel
156 # key: suricata ## key or channel to use (default to suricata)
157 # Redis pipelining set up. This will enable to only do a query every
158 # 'batch-size' events. This should lower the latency induced by network
159 # connection at the cost of some memory. There is no flushing implemented
160 # so this setting as to be reserved to high traffic suricata.
161 # pipelining:
162 # enabled: yes ## set enable to yes to enable query pipelining
163 # batch-size: 10 ## number of entry to keep in buffer
164 types:
165 - alert:
166 # payload: yes # enable dumping payload in Base64
167 # payload-buffer-size: 4kb # max size of payload buffer to output in eve-log
168 # payload-printable: yes # enable dumping payload in printable (lossy) format
169 # packet: yes # enable dumping of packet (without stream segments)
170 # http-body: yes # enable dumping of http body in Base64
171 # http-body-printable: yes # enable dumping of http body in printable format
172 metadata: yes # add L7/applayer fields, flowbit and other vars to the alert
173
174 # Enable the logging of tagged packets for rules using the
175 # "tag" keyword.
176 tagged-packets: yes
177
178 # HTTP X-Forwarded-For support by adding an extra field or overwriting
179 # the source or destination IP address (depending on flow direction)
180 # with the one reported in the X-Forwarded-For HTTP header. This is
181 # helpful when reviewing alerts for traffic that is being reverse
182 # or forward proxied.
183 xff:
184 enabled: no
185 # Two operation modes are available, "extra-data" and "overwrite".
186 mode: extra-data
187 # Two proxy deployments are supported, "reverse" and "forward". In
188 # a "reverse" deployment the IP address used is the last one, in a
189 # "forward" deployment the first IP address is used.
190 deployment: reverse
191 # Header name where the actual IP address will be reported, if more
192 # than one IP address is present, the last IP address will be the
193 # one taken into consideration.
194 header: X-Forwarded-For
195 - http:
196 extended: yes # enable this for extended logging information
197 # custom allows additional http fields to be included in eve-log
198 # the example below adds three additional fields when uncommented
199 #custom: [Accept-Encoding, Accept-Language, Authorization]
200 - dns:
201 # control logging of queries and answers
202 # default yes, no to disable
203 query: yes # enable logging of DNS queries
204 answer: yes # enable logging of DNS answers
205 # control which RR types are logged
206 # all enabled if custom not specified
207 #custom: [a, aaaa, cname, mx, ns, ptr, txt]
208 - tls:
209 extended: yes # enable this for extended logging information
210 # output TLS transaction where the session is resumed using a
211 # session id
212 #session-resumption: no
213 # custom allows to control which tls fields that are included
214 # in eve-log
215 #custom: [subject, issuer, session_resumed, serial, fingerprint, sni, version, not_before, not_after, certificate, chain]
216 - files:
217 force-magic: no # force logging magic on all logged files
218 # force logging of checksums, available hash functions are md5,
219 # sha1 and sha256
220 #force-hash: [md5]
221 #- drop:
222 # alerts: yes # log alerts that caused drops
223 # flows: all # start or all: 'start' logs only a single drop
224 # # per flow direction. All logs each dropped pkt.
225 - smtp:
226 #extended: yes # enable this for extended logging information
227 # this includes: bcc, message-id, subject, x_mailer, user-agent
228 # custom fields logging from the list:
229 # reply-to, bcc, message-id, subject, x-mailer, user-agent, received,
230 # x-originating-ip, in-reply-to, references, importance, priority,
231 # sensitivity, organization, content-md5, date
232 #custom: [received, x-mailer, x-originating-ip, relays, reply-to, bcc]
233 # output md5 of fields: body, subject
234 # for the body you need to set app-layer.protocols.smtp.mime.body-md5
235 # to yes
236 #md5: [body, subject]
237
238 #- dnp3
239 #- nfs
240 - ssh
241 - stats:
242 totals: yes # stats for all threads merged together
243 threads: no # per thread stats
244 deltas: no # include delta values
245 # bi-directional flows
246 - flow
247 # uni-directional flows
248 #- netflow
249 # Vars log flowbits and other packet and flow vars
250 #- vars
251
252 # alert output for use with Barnyard2
253 - unified2-alert:
254 enabled: no
255 filename: unified2.alert
256
257 # File size limit. Can be specified in kb, mb, gb. Just a number
258 # is parsed as bytes.
259 #limit: 32mb
260
261 # By default unified2 log files have the file creation time (in
262 # unix epoch format) appended to the filename. Set this to yes to
263 # disable this behaviour.
264 #nostamp: no
265
266 # Sensor ID field of unified2 alerts.
267 #sensor-id: 0
268
269 # Include payload of packets related to alerts. Defaults to true, set to
270 # false if payload is not required.
271 #payload: yes
272
273 # HTTP X-Forwarded-For support by adding the unified2 extra header or
274 # overwriting the source or destination IP address (depending on flow
275 # direction) with the one reported in the X-Forwarded-For HTTP header.
276 # This is helpful when reviewing alerts for traffic that is being reverse
277 # or forward proxied.
278 xff:
279 enabled: no
280 # Two operation modes are available, "extra-data" and "overwrite". Note
281 # that in the "overwrite" mode, if the reported IP address in the HTTP
282 # X-Forwarded-For header is of a different version of the packet
283 # received, it will fall-back to "extra-data" mode.
284 mode: extra-data
285 # Two proxy deployments are supported, "reverse" and "forward". In
286 # a "reverse" deployment the IP address used is the last one, in a
287 # "forward" deployment the first IP address is used.
288 deployment: reverse
289 # Header name where the actual IP address will be reported, if more
290 # than one IP address is present, the last IP address will be the
291 # one taken into consideration.
292 header: X-Forwarded-For
293
294 # a line based log of HTTP requests (no alerts)
295 - http-log:
296 enabled: no
297 filename: http.log
298 append: yes
299 #extended: yes # enable this for extended logging information
300 #custom: yes # enabled the custom logging format (defined by customformat)
301 #customformat: "%{%D-%H:%M:%S}t.%z %{X-Forwarded-For}i %H %m %h %u %s %B %a:%p -> %A:%P"
302 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
303
304 # a line based log of TLS handshake parameters (no alerts)
305 - tls-log:
306 enabled: no # Log TLS connections.
307 filename: tls.log # File to store TLS logs.
308 append: yes
309 #extended: yes # Log extended information like fingerprint
310 #custom: yes # enabled the custom logging format (defined by customformat)
311 #customformat: "%{%D-%H:%M:%S}t.%z %a:%p -> %A:%P %v %n %d %D"
312 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
313 # output TLS transaction where the session is resumed using a
314 # session id
315 #session-resumption: no
316
317 # output module to store certificates chain to disk
318 - tls-store:
319 enabled: no
320 #certs-log-dir: certs # directory to store the certificates files
321
322 # a line based log of DNS requests and/or replies (no alerts)
323 - dns-log:
324 enabled: no
325 filename: dns.log
326 append: yes
327 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
328
329 # Packet log... log packets in pcap format. 3 modes of operation: "normal"
330 # "multi" and "sguil".
331 #
332 # In normal mode a pcap file "filename" is created in the default-log-dir,
333 # or are as specified by "dir".
334 # In multi mode, a file is created per thread. This will perform much
335 # better, but will create multiple files where 'normal' would create one.
336 # In multi mode the filename takes a few special variables:
337 # - %n -- thread number
338 # - %i -- thread id
339 # - %t -- timestamp (secs or secs.usecs based on 'ts-format'
340 # E.g. filename: pcap.%n.%t
341 #
342 # Note that it's possible to use directories, but the directories are not
343 # created by Suricata. E.g. filename: pcaps/%n/log.%s will log into the
344 # per thread directory.
345 #
346 # Also note that the limit and max-files settings are enforced per thread.
347 # So the size limit when using 8 threads with 1000mb files and 2000 files
348 # is: 8*1000*2000 ~ 16TiB.
349 #
350 # In Sguil mode "dir" indicates the base directory. In this base dir the
351 # pcaps are created in th directory structure Sguil expects:
352 #
353 # $sguil-base-dir/YYYY-MM-DD/$filename.<timestamp>
354 #
355 # By default all packets are logged except:
356 # - TCP streams beyond stream.reassembly.depth
357 # - encrypted streams after the key exchange
358 #
359 - pcap-log:
360 enabled: no
361 filename: log.pcap
362
363 # File size limit. Can be specified in kb, mb, gb. Just a number
364 # is parsed as bytes.
365 limit: 1000mb
366
367 # If set to a value will enable ring buffer mode. Will keep Maximum of "max-files" of size "limit"
368 max-files: 2000
369
370 mode: normal # normal, multi or sguil.
371
372 # Directory to place pcap files. If not provided the default log
373 # directory will be used. Required for "sguil" mode.
374 #dir: /nsm_data/
375
376 #ts-format: usec # sec or usec second format (default) is filename.sec usec is filename.sec.usec
377 use-stream-depth: no #If set to "yes" packets seen after reaching stream inspection depth are ignored. "no" logs all packets
378 honor-pass-rules: no # If set to "yes", flows in which a pass rule matched will stopped being logged.
379
380 # a full alerts log containing much information for signature writers
381 # or for investigating suspected false positives.
382 - alert-debug:
383 enabled: no
384 filename: alert-debug.log
385 append: yes
386 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
387
388 # alert output to prelude (http://www.prelude-technologies.com/) only
389 # available if Suricata has been compiled with --enable-prelude
390 - alert-prelude:
391 enabled: no
392 profile: suricata
393 log-packet-content: no
394 log-packet-header: yes
395
396 # Stats.log contains data from various counters of the suricata engine.
397 - stats:
398 enabled: yes
399 filename: stats.log
400 totals: yes # stats for all threads merged together
401 threads: no # per thread stats
402 #null-values: yes # print counters that have value 0
403
404 # a line based alerts log similar to fast.log into syslog
405 - syslog:
406 enabled: no
407 # reported identity to syslog. If ommited the program name (usually
408 # suricata) will be used.
409 #identity: "suricata"
410 facility: local5
411 #level: Info ## possible levels: Emergency, Alert, Critical,
412 ## Error, Warning, Notice, Info, Debug
413
414 # a line based information for dropped packets in IPS mode
415 - drop:
416 enabled: no
417 filename: drop.log
418 append: yes
419 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
420
421 # output module to store extracted files to disk
422 #
423 # The files are stored to the log-dir in a format "file.<id>" where <id> is
424 # an incrementing number starting at 1. For each file "file.<id>" a meta
425 # file "file.<id>.meta" is created.
426 #
427 # File extraction depends on a lot of things to be fully done:
428 # - file-store stream-depth. For optimal results, set this to 0 (unlimited)
429 # - http request / response body sizes. Again set to 0 for optimal results.
430 # - rules that contain the "filestore" keyword.
431 - file-store:
432 enabled: no # set to yes to enable
433 log-dir: files # directory to store the files
434 force-magic: no # force logging magic on all stored files
435 # force logging of checksums, available hash functions are md5,
436 # sha1 and sha256
437 #force-hash: [md5]
438 force-filestore: no # force storing of all files
439 # override global stream-depth for sessions in which we want to
440 # perform file extraction. Set to 0 for unlimited.
441 #stream-depth: 0
442 #waldo: file.waldo # waldo file to store the file_id across runs
443 # uncomment to disable meta file writing
444 #write-meta: no
445 # uncomment the following variable to define how many files can
446 # remain open for filestore by Suricata. Default value is 0 which
447 # means files get closed after each write
448 #max-open-files: 1000
449
450 # output module to log files tracked in a easily parsable json format
451 - file-log:
452 enabled: no
453 filename: files-json.log
454 append: yes
455 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
456
457 force-magic: no # force logging magic on all logged files
458 # force logging of checksums, available hash functions are md5,
459 # sha1 and sha256
460 #force-hash: [md5]
461
462 # Log TCP data after stream normalization
463 # 2 types: file or dir. File logs into a single logfile. Dir creates
464 # 2 files per TCP session and stores the raw TCP data into them.
465 # Using 'both' will enable both file and dir modes.
466 #
467 # Note: limited by stream.depth
468 - tcp-data:
469 enabled: no
470 type: file
471 filename: tcp-data.log
472
473 # Log HTTP body data after normalization, dechunking and unzipping.
474 # 2 types: file or dir. File logs into a single logfile. Dir creates
475 # 2 files per HTTP session and stores the normalized data into them.
476 # Using 'both' will enable both file and dir modes.
477 #
478 # Note: limited by the body limit settings
479 - http-body-data:
480 enabled: no
481 type: file
482 filename: http-data.log
483
484 # Lua Output Support - execute lua script to generate alert and event
485 # output.
486 # Documented at:
487 # https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Lua_Output
488 - lua:
489 enabled: no
490 #scripts-dir: /etc/suricata/lua-output/
491 scripts:
492 # - script1.lua
493
494# Logging configuration. This is not about logging IDS alerts/events, but
495# output about what Suricata is doing, like startup messages, errors, etc.
496logging:
497 # The default log level, can be overridden in an output section.
498 # Note that debug level logging will only be emitted if Suricata was
499 # compiled with the --enable-debug configure option.
500 #
501 # This value is overriden by the SC_LOG_LEVEL env var.
502 default-log-level: notice
503
504 # The default output format. Optional parameter, should default to
505 # something reasonable if not provided. Can be overriden in an
506 # output section. You can leave this out to get the default.
507 #
508 # This value is overriden by the SC_LOG_FORMAT env var.
509 #default-log-format: "[%i] %t - (%f:%l) <%d> (%n) -- "
510
511 # A regex to filter output. Can be overridden in an output section.
512 # Defaults to empty (no filter).
513 #
514 # This value is overriden by the SC_LOG_OP_FILTER env var.
515 default-output-filter:
516
517 # Define your logging outputs. If none are defined, or they are all
518 # disabled you will get the default - console output.
519 outputs:
520 - console:
521 enabled: yes
522 # type: json
523 - file:
524 enabled: yes
525 level: info
526 filename: /var/log/suricata/suricata.log
527 # type: json
528 - syslog:
529 enabled: no
530 facility: local5
531 format: "[%i] <%d> -- "
532 # type: json
533
534
535##
536## Step 4: configure common capture settings
537##
538## See "Advanced Capture Options" below for more options, including NETMAP
539## and PF_RING.
540##
541
542# Linux high speed capture support
543af-packet:
544 - interface: eth0
545 # Number of receive threads. "auto" uses the number of cores
546 #threads: auto
547 # Default clusterid. AF_PACKET will load balance packets based on flow.
548 cluster-id: 99
549 # Default AF_PACKET cluster type. AF_PACKET can load balance per flow or per hash.
550 # This is only supported for Linux kernel > 3.1
551 # possible value are:
552 # * cluster_round_robin: round robin load balancing
553 # * cluster_flow: all packets of a given flow are send to the same socket
554 # * cluster_cpu: all packets treated in kernel by a CPU are send to the same socket
555 # * cluster_qm: all packets linked by network card to a RSS queue are sent to the same
556 # socket. Requires at least Linux 3.14.
557 # * cluster_random: packets are sent randomly to sockets but with an equipartition.
558 # Requires at least Linux 3.14.
559 # * cluster_rollover: kernel rotates between sockets filling each socket before moving
560 # to the next. Requires at least Linux 3.10.
561 # Recommended modes are cluster_flow on most boxes and cluster_cpu or cluster_qm on system
562 # with capture card using RSS (require cpu affinity tuning and system irq tuning)
563 cluster-type: cluster_flow
564 # In some fragmentation case, the hash can not be computed. If "defrag" is set
565 # to yes, the kernel will do the needed defragmentation before sending the packets.
566 defrag: yes
567 # After Linux kernel 3.10 it is possible to activate the rollover option: if a socket is
568 # full then kernel will send the packet on the next socket with room available. This option
569 # can minimize packet drop and increase the treated bandwidth on single intensive flow.
570 #rollover: yes
571 # To use the ring feature of AF_PACKET, set 'use-mmap' to yes
572 #use-mmap: yes
573 # Lock memory map to avoid it goes to swap. Be careful that over suscribing could lock
574 # your system
575 #mmap-locked: yes
576 # Use tpacket_v3 capture mode, only active if use-mmap is true
577 # Don't use it in IPS or TAP mode as it causes severe latency
578 #tpacket-v3: yes
579 # Ring size will be computed with respect to max_pending_packets and number
580 # of threads. You can set manually the ring size in number of packets by setting
581 # the following value. If you are using flow cluster-type and have really network
582 # intensive single-flow you could want to set the ring-size independently of the number
583 # of threads:
584 #ring-size: 2048
585 # Block size is used by tpacket_v3 only. It should set to a value high enough to contain
586 # a decent number of packets. Size is in bytes so please consider your MTU. It should be
587 # a power of 2 and it must be multiple of page size (usually 4096).
588 #block-size: 32768
589 # tpacket_v3 block timeout: an open block is passed to userspace if it is not
590 # filled after block-timeout milliseconds.
591 #block-timeout: 10
592 # On busy system, this could help to set it to yes to recover from a packet drop
593 # phase. This will result in some packets (at max a ring flush) being non treated.
594 #use-emergency-flush: yes
595 # recv buffer size, increase value could improve performance
596 # buffer-size: 32768
597 # Set to yes to disable promiscuous mode
598 # disable-promisc: no
599 # Choose checksum verification mode for the interface. At the moment
600 # of the capture, some packets may be with an invalid checksum due to
601 # offloading to the network card of the checksum computation.
602 # Possible values are:
603 # - kernel: use indication sent by kernel for each packet (default)
604 # - yes: checksum validation is forced
605 # - no: checksum validation is disabled
606 # - auto: suricata uses a statistical approach to detect when
607 # checksum off-loading is used.
608 # Warning: 'checksum-validation' must be set to yes to have any validation
609 #checksum-checks: kernel
610 # BPF filter to apply to this interface. The pcap filter syntax apply here.
611 #bpf-filter: port 80 or udp
612 # You can use the following variables to activate AF_PACKET tap or IPS mode.
613 # If copy-mode is set to ips or tap, the traffic coming to the current
614 # interface will be copied to the copy-iface interface. If 'tap' is set, the
615 # copy is complete. If 'ips' is set, the packet matching a 'drop' action
616 # will not be copied.
617 #copy-mode: ips
618 #copy-iface: eth1
619
620 # Put default values here. These will be used for an interface that is not
621 # in the list above.
622 - interface: default
623 #threads: auto
624 #use-mmap: no
625 #rollover: yes
626 #tpacket-v3: yes
627
628# Cross platform libpcap capture support
629pcap:
630 - interface: eth0
631 # On Linux, pcap will try to use mmaped capture and will use buffer-size
632 # as total of memory used by the ring. So set this to something bigger
633 # than 1% of your bandwidth.
634 #buffer-size: 16777216
635 #bpf-filter: "tcp and port 25"
636 # Choose checksum verification mode for the interface. At the moment
637 # of the capture, some packets may be with an invalid checksum due to
638 # offloading to the network card of the checksum computation.
639 # Possible values are:
640 # - yes: checksum validation is forced
641 # - no: checksum validation is disabled
642 # - auto: suricata uses a statistical approach to detect when
643 # checksum off-loading is used. (default)
644 # Warning: 'checksum-validation' must be set to yes to have any validation
645 #checksum-checks: auto
646 # With some accelerator cards using a modified libpcap (like myricom), you
647 # may want to have the same number of capture threads as the number of capture
648 # rings. In this case, set up the threads variable to N to start N threads
649 # listening on the same interface.
650 #threads: 16
651 # set to no to disable promiscuous mode:
652 #promisc: no
653 # set snaplen, if not set it defaults to MTU if MTU can be known
654 # via ioctl call and to full capture if not.
655 #snaplen: 1518
656 # Put default values here
657 - interface: default
658 #checksum-checks: auto
659
660# Settings for reading pcap files
661pcap-file:
662 # Possible values are:
663 # - yes: checksum validation is forced
664 # - no: checksum validation is disabled
665 # - auto: suricata uses a statistical approach to detect when
666 # checksum off-loading is used. (default)
667 # Warning: 'checksum-validation' must be set to yes to have checksum tested
668 checksum-checks: auto
669
670# See "Advanced Capture Options" below for more options, including NETMAP
671# and PF_RING.
672
673
674##
675## Step 5: App Layer Protocol Configuration
676##
677
678# Configure the app-layer parsers. The protocols section details each
679# protocol.
680#
681# The option "enabled" takes 3 values - "yes", "no", "detection-only".
682# "yes" enables both detection and the parser, "no" disables both, and
683# "detection-only" enables protocol detection only (parser disabled).
684app-layer:
685 protocols:
686 tls:
687 enabled: yes
688 detection-ports:
689 dp: 443
690
691 # Completely stop processing TLS/SSL session after the handshake
692 # completed. If bypass is enabled this will also trigger flow
693 # bypass. If disabled (the default), TLS/SSL session is still
694 # tracked for Heartbleed and other anomalies.
695 #no-reassemble: yes
696 dcerpc:
697 enabled: yes
698 ftp:
699 enabled: yes
700 ssh:
701 enabled: yes
702 smtp:
703 enabled: yes
704 # Configure SMTP-MIME Decoder
705 mime:
706 # Decode MIME messages from SMTP transactions
707 # (may be resource intensive)
708 # This field supercedes all others because it turns the entire
709 # process on or off
710 decode-mime: yes
711
712 # Decode MIME entity bodies (ie. base64, quoted-printable, etc.)
713 decode-base64: yes
714 decode-quoted-printable: yes
715
716 # Maximum bytes per header data value stored in the data structure
717 # (default is 2000)
718 header-value-depth: 2000
719
720 # Extract URLs and save in state data structure
721 extract-urls: yes
722 # Set to yes to compute the md5 of the mail body. You will then
723 # be able to journalize it.
724 body-md5: no
725 # Configure inspected-tracker for file_data keyword
726 inspected-tracker:
727 content-limit: 100000
728 content-inspect-min-size: 32768
729 content-inspect-window: 4096
730 imap:
731 enabled: detection-only
732 msn:
733 enabled: detection-only
734 smb:
735 enabled: yes
736 detection-ports:
737 dp: 139, 445
738 # smb2 detection is disabled internally inside the engine.
739 #smb2:
740 # enabled: yes
741 # Note: NFS parser depends on Rust support: pass --enable-rust
742 # to configure.
743 nfs:
744 enabled: no
745 dns:
746 # memcaps. Globally and per flow/state.
747 #global-memcap: 16mb
748 #state-memcap: 512kb
749
750 # How many unreplied DNS requests are considered a flood.
751 # If the limit is reached, app-layer-event:dns.flooded; will match.
752 #request-flood: 500
753
754 tcp:
755 enabled: yes
756 detection-ports:
757 dp: 53
758 udp:
759 enabled: yes
760 detection-ports:
761 dp: 53
762 http:
763 enabled: yes
764 # memcap: 64mb
765
766 # default-config: Used when no server-config matches
767 # personality: List of personalities used by default
768 # request-body-limit: Limit reassembly of request body for inspection
769 # by http_client_body & pcre /P option.
770 # response-body-limit: Limit reassembly of response body for inspection
771 # by file_data, http_server_body & pcre /Q option.
772 # double-decode-path: Double decode path section of the URI
773 # double-decode-query: Double decode query section of the URI
774 # response-body-decompress-layer-limit:
775 # Limit to how many layers of compression will be
776 # decompressed. Defaults to 2.
777 #
778 # server-config: List of server configurations to use if address matches
779 # address: List of ip addresses or networks for this block
780 # personalitiy: List of personalities used by this block
781 # request-body-limit: Limit reassembly of request body for inspection
782 # by http_client_body & pcre /P option.
783 # response-body-limit: Limit reassembly of response body for inspection
784 # by file_data, http_server_body & pcre /Q option.
785 # double-decode-path: Double decode path section of the URI
786 # double-decode-query: Double decode query section of the URI
787 #
788 # uri-include-all: Include all parts of the URI. By default the
789 # 'scheme', username/password, hostname and port
790 # are excluded. Setting this option to true adds
791 # all of them to the normalized uri as inspected
792 # by http_uri, urilen, pcre with /U and the other
793 # keywords that inspect the normalized uri.
794 # Note that this does not affect http_raw_uri.
795 # Also, note that including all was the default in
796 # 1.4 and 2.0beta1.
797 #
798 # meta-field-limit: Hard size limit for request and response size
799 # limits. Applies to request line and headers,
800 # response line and headers. Does not apply to
801 # request or response bodies. Default is 18k.
802 # If this limit is reached an event is raised.
803 #
804 # Currently Available Personalities:
805 # Minimal, Generic, IDS (default), IIS_4_0, IIS_5_0, IIS_5_1, IIS_6_0,
806 # IIS_7_0, IIS_7_5, Apache_2
807 libhtp:
808 default-config:
809 personality: IDS
810
811 # Can be specified in kb, mb, gb. Just a number indicates
812 # it's in bytes.
813 request-body-limit: 100kb
814 response-body-limit: 100kb
815
816 # inspection limits
817 request-body-minimal-inspect-size: 32kb
818 request-body-inspect-window: 4kb
819 response-body-minimal-inspect-size: 40kb
820 response-body-inspect-window: 16kb
821
822 # response body decompression (0 disables)
823 response-body-decompress-layer-limit: 2
824
825 # auto will use http-body-inline mode in IPS mode, yes or no set it statically
826 http-body-inline: auto
827
828 # Take a random value for inspection sizes around the specified value.
829 # This lower the risk of some evasion technics but could lead
830 # detection change between runs. It is set to 'yes' by default.
831 #randomize-inspection-sizes: yes
832 # If randomize-inspection-sizes is active, the value of various
833 # inspection size will be choosen in the [1 - range%, 1 + range%]
834 # range
835 # Default value of randomize-inspection-range is 10.
836 #randomize-inspection-range: 10
837
838 # decoding
839 double-decode-path: no
840 double-decode-query: no
841
842 server-config:
843
844 #- apache:
845 # address: [192.168.1.0/24, 127.0.0.0/8, "::1"]
846 # personality: Apache_2
847 # # Can be specified in kb, mb, gb. Just a number indicates
848 # # it's in bytes.
849 # request-body-limit: 4096
850 # response-body-limit: 4096
851 # double-decode-path: no
852 # double-decode-query: no
853
854 #- iis7:
855 # address:
856 # - 192.168.0.0/24
857 # - 192.168.10.0/24
858 # personality: IIS_7_0
859 # # Can be specified in kb, mb, gb. Just a number indicates
860 # # it's in bytes.
861 # request-body-limit: 4096
862 # response-body-limit: 4096
863 # double-decode-path: no
864 # double-decode-query: no
865
866 # Note: Modbus probe parser is minimalist due to the poor significant field
867 # Only Modbus message length (greater than Modbus header length)
868 # And Protocol ID (equal to 0) are checked in probing parser
869 # It is important to enable detection port and define Modbus port
870 # to avoid false positive
871 modbus:
872 # How many unreplied Modbus requests are considered a flood.
873 # If the limit is reached, app-layer-event:modbus.flooded; will match.
874 #request-flood: 500
875
876 enabled: no
877 detection-ports:
878 dp: 502
879 # According to MODBUS Messaging on TCP/IP Implementation Guide V1.0b, it
880 # is recommended to keep the TCP connection opened with a remote device
881 # and not to open and close it for each MODBUS/TCP transaction. In that
882 # case, it is important to set the depth of the stream reassembling as
883 # unlimited (stream.reassembly.depth: 0)
884
885 # Stream reassembly size for modbus. By default track it completely.
886 stream-depth: 0
887
888 # DNP3
889 dnp3:
890 enabled: no
891 detection-ports:
892 dp: 20000
893
894 # SCADA EtherNet/IP and CIP protocol support
895 enip:
896 enabled: no
897 detection-ports:
898 dp: 44818
899 sp: 44818
900
901 # Note: parser depends on experimental Rust support
902 # with --enable-rust-experimental passed to configure
903 ntp:
904 enabled: no
905
906# Limit for the maximum number of asn1 frames to decode (default 256)
907asn1-max-frames: 256
908
909
910##############################################################################
911##
912## Advanced settings below
913##
914##############################################################################
915
916##
917## Run Options
918##
919
920# Run suricata as user and group.
921#run-as:
922# user: suri
923# group: suri
924
925# Some logging module will use that name in event as identifier. The default
926# value is the hostname
927#sensor-name: suricata
928
929# Default location of the pid file. The pid file is only used in
930# daemon mode (start Suricata with -D). If not running in daemon mode
931# the --pidfile command line option must be used to create a pid file.
932#pid-file: /var/run/suricata.pid
933
934# Daemon working directory
935# Suricata will change directory to this one if provided
936# Default: "/"
937#daemon-directory: "/"
938
939# Suricata core dump configuration. Limits the size of the core dump file to
940# approximately max-dump. The actual core dump size will be a multiple of the
941# page size. Core dumps that would be larger than max-dump are truncated. On
942# Linux, the actual core dump size may be a few pages larger than max-dump.
943# Setting max-dump to 0 disables core dumping.
944# Setting max-dump to 'unlimited' will give the full core dump file.
945# On 32-bit Linux, a max-dump value >= ULONG_MAX may cause the core dump size
946# to be 'unlimited'.
947
948coredump:
949 max-dump: unlimited
950
951# If suricata box is a router for the sniffed networks, set it to 'router'. If
952# it is a pure sniffing setup, set it to 'sniffer-only'.
953# If set to auto, the variable is internally switch to 'router' in IPS mode
954# and 'sniffer-only' in IDS mode.
955# This feature is currently only used by the reject* keywords.
956host-mode: auto
957
958# Number of packets preallocated per thread. The default is 1024. A higher number
959# will make sure each CPU will be more easily kept busy, but may negatively
960# impact caching.
961#
962# If you are using the CUDA pattern matcher (mpm-algo: ac-cuda), different rules
963# apply. In that case try something like 60000 or more. This is because the CUDA
964# pattern matcher buffers and scans as many packets as possible in parallel.
965#max-pending-packets: 1024
966
967# Runmode the engine should use. Please check --list-runmodes to get the available
968# runmodes for each packet acquisition method. Defaults to "autofp" (auto flow pinned
969# load balancing).
970#runmode: autofp
971
972# Specifies the kind of flow load balancer used by the flow pinned autofp mode.
973#
974# Supported schedulers are:
975#
976# round-robin - Flows assigned to threads in a round robin fashion.
977# active-packets - Flows assigned to threads that have the lowest number of
978# unprocessed packets (default).
979# hash - Flow alloted usihng the address hash. More of a random
980# technique. Was the default in Suricata 1.2.1 and older.
981#
982#autofp-scheduler: active-packets
983
984# Preallocated size for packet. Default is 1514 which is the classical
985# size for pcap on ethernet. You should adjust this value to the highest
986# packet size (MTU + hardware header) on your system.
987#default-packet-size: 1514
988
989# Unix command socket can be used to pass commands to suricata.
990# An external tool can then connect to get information from suricata
991# or trigger some modifications of the engine. Set enabled to yes
992# to activate the feature. In auto mode, the feature will only be
993# activated in live capture mode. You can use the filename variable to set
994# the file name of the socket.
995unix-command:
996 enabled: auto
997 #filename: custom.socket
998
999# Magic file. The extension .mgc is added to the value here.
1000#magic-file: /usr/share/file/magic
1001#magic-file:
1002
1003legacy:
1004 uricontent: enabled
1005
1006##
1007## Detection settings
1008##
1009
1010# Set the order of alerts bassed on actions
1011# The default order is pass, drop, reject, alert
1012# action-order:
1013# - pass
1014# - drop
1015# - reject
1016# - alert
1017
1018# IP Reputation
1019#reputation-categories-file: /usr/local/etc/suricata/iprep/categories.txt
1020#default-reputation-path: /usr/local/etc/suricata/iprep
1021#reputation-files:
1022# - reputation.list
1023
1024# When run with the option --engine-analysis, the engine will read each of
1025# the parameters below, and print reports for each of the enabled sections
1026# and exit. The reports are printed to a file in the default log dir
1027# given by the parameter "default-log-dir", with engine reporting
1028# subsection below printing reports in its own report file.
1029engine-analysis:
1030 # enables printing reports for fast-pattern for every rule.
1031 rules-fast-pattern: yes
1032 # enables printing reports for each rule
1033 rules: yes
1034
1035#recursion and match limits for PCRE where supported
1036pcre:
1037 match-limit: 3500
1038 match-limit-recursion: 1500
1039
1040##
1041## Advanced Traffic Tracking and Reconstruction Settings
1042##
1043
1044# Host specific policies for defragmentation and TCP stream
1045# reassembly. The host OS lookup is done using a radix tree, just
1046# like a routing table so the most specific entry matches.
1047host-os-policy:
1048 # Make the default policy windows.
1049 windows: [0.0.0.0/0]
1050 bsd: []
1051 bsd-right: []
1052 old-linux: []
1053 linux: []
1054 old-solaris: []
1055 solaris: []
1056 hpux10: []
1057 hpux11: []
1058 irix: []
1059 macos: []
1060 vista: []
1061 windows2k3: []
1062
1063# Defrag settings:
1064
1065defrag:
1066 memcap: 32mb
1067 hash-size: 65536
1068 trackers: 65535 # number of defragmented flows to follow
1069 max-frags: 65535 # number of fragments to keep (higher than trackers)
1070 prealloc: yes
1071 timeout: 60
1072
1073# Enable defrag per host settings
1074# host-config:
1075#
1076# - dmz:
1077# timeout: 30
1078# address: [192.168.1.0/24, 127.0.0.0/8, 1.1.1.0/24, 2.2.2.0/24, "1.1.1.1", "2.2.2.2", "::1"]
1079#
1080# - lan:
1081# timeout: 45
1082# address:
1083# - 192.168.0.0/24
1084# - 192.168.10.0/24
1085# - 172.16.14.0/24
1086
1087# Flow settings:
1088# By default, the reserved memory (memcap) for flows is 32MB. This is the limit
1089# for flow allocation inside the engine. You can change this value to allow
1090# more memory usage for flows.
1091# The hash-size determine the size of the hash used to identify flows inside
1092# the engine, and by default the value is 65536.
1093# At the startup, the engine can preallocate a number of flows, to get a better
1094# performance. The number of flows preallocated is 10000 by default.
1095# emergency-recovery is the percentage of flows that the engine need to
1096# prune before unsetting the emergency state. The emergency state is activated
1097# when the memcap limit is reached, allowing to create new flows, but
1098# prunning them with the emergency timeouts (they are defined below).
1099# If the memcap is reached, the engine will try to prune flows
1100# with the default timeouts. If it doens't find a flow to prune, it will set
1101# the emergency bit and it will try again with more agressive timeouts.
1102# If that doesn't work, then it will try to kill the last time seen flows
1103# not in use.
1104# The memcap can be specified in kb, mb, gb. Just a number indicates it's
1105# in bytes.
1106
1107flow:
1108 memcap: 128mb
1109 hash-size: 65536
1110 prealloc: 10000
1111 emergency-recovery: 30
1112 #managers: 1 # default to one flow manager
1113 #recyclers: 1 # default to one flow recycler thread
1114
1115# This option controls the use of vlan ids in the flow (and defrag)
1116# hashing. Normally this should be enabled, but in some (broken)
1117# setups where both sides of a flow are not tagged with the same vlan
1118# tag, we can ignore the vlan id's in the flow hashing.
1119vlan:
1120 use-for-tracking: true
1121
1122# Specific timeouts for flows. Here you can specify the timeouts that the
1123# active flows will wait to transit from the current state to another, on each
1124# protocol. The value of "new" determine the seconds to wait after a hanshake or
1125# stream startup before the engine free the data of that flow it doesn't
1126# change the state to established (usually if we don't receive more packets
1127# of that flow). The value of "established" is the amount of
1128# seconds that the engine will wait to free the flow if it spend that amount
1129# without receiving new packets or closing the connection. "closed" is the
1130# amount of time to wait after a flow is closed (usually zero). "bypassed"
1131# timeout controls locally bypassed flows. For these flows we don't do any other
1132# tracking. If no packets have been seen after this timeout, the flow is discarded.
1133#
1134# There's an emergency mode that will become active under attack circumstances,
1135# making the engine to check flow status faster. This configuration variables
1136# use the prefix "emergency-" and work similar as the normal ones.
1137# Some timeouts doesn't apply to all the protocols, like "closed", for udp and
1138# icmp.
1139
1140flow-timeouts:
1141
1142 default:
1143 new: 30
1144 established: 300
1145 closed: 0
1146 bypassed: 100
1147 emergency-new: 10
1148 emergency-established: 100
1149 emergency-closed: 0
1150 emergency-bypassed: 50
1151 tcp:
1152 new: 60
1153 established: 600
1154 closed: 60
1155 bypassed: 100
1156 emergency-new: 5
1157 emergency-established: 100
1158 emergency-closed: 10
1159 emergency-bypassed: 50
1160 udp:
1161 new: 30
1162 established: 300
1163 bypassed: 100
1164 emergency-new: 10
1165 emergency-established: 100
1166 emergency-bypassed: 50
1167 icmp:
1168 new: 30
1169 established: 300
1170 bypassed: 100
1171 emergency-new: 10
1172 emergency-established: 100
1173 emergency-bypassed: 50
1174
1175# Stream engine settings. Here the TCP stream tracking and reassembly
1176# engine is configured.
1177#
1178# stream:
1179# memcap: 32mb # Can be specified in kb, mb, gb. Just a
1180# # number indicates it's in bytes.
1181# checksum-validation: yes # To validate the checksum of received
1182# # packet. If csum validation is specified as
1183# # "yes", then packet with invalid csum will not
1184# # be processed by the engine stream/app layer.
1185# # Warning: locally generated trafic can be
1186# # generated without checksum due to hardware offload
1187# # of checksum. You can control the handling of checksum
1188# # on a per-interface basis via the 'checksum-checks'
1189# # option
1190# prealloc-sessions: 2k # 2k sessions prealloc'd per stream thread
1191# midstream: false # don't allow midstream session pickups
1192# async-oneside: false # don't enable async stream handling
1193# inline: no # stream inline mode
1194# drop-invalid: yes # in inline mode, drop packets that are invalid with regards to streaming engine
1195# max-synack-queued: 5 # Max different SYN/ACKs to queue
1196# bypass: no # Bypass packets when stream.depth is reached
1197#
1198# reassembly:
1199# memcap: 64mb # Can be specified in kb, mb, gb. Just a number
1200# # indicates it's in bytes.
1201# depth: 1mb # Can be specified in kb, mb, gb. Just a number
1202# # indicates it's in bytes.
1203# toserver-chunk-size: 2560 # inspect raw stream in chunks of at least
1204# # this size. Can be specified in kb, mb,
1205# # gb. Just a number indicates it's in bytes.
1206# toclient-chunk-size: 2560 # inspect raw stream in chunks of at least
1207# # this size. Can be specified in kb, mb,
1208# # gb. Just a number indicates it's in bytes.
1209# randomize-chunk-size: yes # Take a random value for chunk size around the specified value.
1210# # This lower the risk of some evasion technics but could lead
1211# # detection change between runs. It is set to 'yes' by default.
1212# randomize-chunk-range: 10 # If randomize-chunk-size is active, the value of chunk-size is
1213# # a random value between (1 - randomize-chunk-range/100)*toserver-chunk-size
1214# # and (1 + randomize-chunk-range/100)*toserver-chunk-size and the same
1215# # calculation for toclient-chunk-size.
1216# # Default value of randomize-chunk-range is 10.
1217#
1218# raw: yes # 'Raw' reassembly enabled or disabled.
1219# # raw is for content inspection by detection
1220# # engine.
1221#
1222# segment-prealloc: 2048 # number of segments preallocated per thread
1223#
1224# check-overlap-different-data: true|false
1225# # check if a segment contains different data
1226# # than what we've already seen for that
1227# # position in the stream.
1228# # This is enabled automatically if inline mode
1229# # is used or when stream-event:reassembly_overlap_different_data;
1230# # is used in a rule.
1231#
1232stream:
1233 memcap: 64mb
1234 checksum-validation: yes # reject wrong csums
1235 inline: auto # auto will use inline mode in IPS mode, yes or no set it statically
1236 reassembly:
1237 memcap: 256mb
1238 depth: 1mb # reassemble 1mb into a stream
1239 toserver-chunk-size: 2560
1240 toclient-chunk-size: 2560
1241 randomize-chunk-size: yes
1242 #randomize-chunk-range: 10
1243 #raw: yes
1244 #segment-prealloc: 2048
1245 #check-overlap-different-data: true
1246
1247# Host table:
1248#
1249# Host table is used by tagging and per host thresholding subsystems.
1250#
1251host:
1252 hash-size: 4096
1253 prealloc: 1000
1254 memcap: 32mb
1255
1256# IP Pair table:
1257#
1258# Used by xbits 'ippair' tracking.
1259#
1260#ippair:
1261# hash-size: 4096
1262# prealloc: 1000
1263# memcap: 32mb
1264
1265# Decoder settings
1266
1267decoder:
1268 # Teredo decoder is known to not be completely accurate
1269 # it will sometimes detect non-teredo as teredo.
1270 teredo:
1271 enabled: true
1272
1273
1274##
1275## Performance tuning and profiling
1276##
1277
1278# The detection engine builds internal groups of signatures. The engine
1279# allow us to specify the profile to use for them, to manage memory on an
1280# efficient way keeping a good performance. For the profile keyword you
1281# can use the words "low", "medium", "high" or "custom". If you use custom
1282# make sure to define the values at "- custom-values" as your convenience.
1283# Usually you would prefer medium/high/low.
1284#
1285# "sgh mpm-context", indicates how the staging should allot mpm contexts for
1286# the signature groups. "single" indicates the use of a single context for
1287# all the signature group heads. "full" indicates a mpm-context for each
1288# group head. "auto" lets the engine decide the distribution of contexts
1289# based on the information the engine gathers on the patterns from each
1290# group head.
1291#
1292# The option inspection-recursion-limit is used to limit the recursive calls
1293# in the content inspection code. For certain payload-sig combinations, we
1294# might end up taking too much time in the content inspection code.
1295# If the argument specified is 0, the engine uses an internally defined
1296# default limit. On not specifying a value, we use no limits on the recursion.
1297detect:
1298 profile: medium
1299 custom-values:
1300 toclient-groups: 3
1301 toserver-groups: 25
1302 sgh-mpm-context: auto
1303 inspection-recursion-limit: 3000
1304 # If set to yes, the loading of signatures will be made after the capture
1305 # is started. This will limit the downtime in IPS mode.
1306 #delayed-detect: yes
1307
1308 prefilter:
1309 # default prefiltering setting. "mpm" only creates MPM/fast_pattern
1310 # engines. "auto" also sets up prefilter engines for other keywords.
1311 # Use --list-keywords=all to see which keywords support prefiltering.
1312 default: mpm
1313
1314 # the grouping values above control how many groups are created per
1315 # direction. Port whitelisting forces that port to get it's own group.
1316 # Very common ports will benefit, as well as ports with many expensive
1317 # rules.
1318 grouping:
1319 #tcp-whitelist: 53, 80, 139, 443, 445, 1433, 3306, 3389, 6666, 6667, 8080
1320 #udp-whitelist: 53, 135, 5060
1321
1322 profiling:
1323 # Log the rules that made it past the prefilter stage, per packet
1324 # default is off. The threshold setting determines how many rules
1325 # must have made it past pre-filter for that rule to trigger the
1326 # logging.
1327 #inspect-logging-threshold: 200
1328 grouping:
1329 dump-to-disk: false
1330 include-rules: false # very verbose
1331 include-mpm-stats: false
1332
1333# Select the multi pattern algorithm you want to run for scan/search the
1334# in the engine.
1335#
1336# The supported algorithms are:
1337# "ac" - Aho-Corasick, default implementation
1338# "ac-bs" - Aho-Corasick, reduced memory implementation
1339# "ac-cuda" - Aho-Corasick, CUDA implementation
1340# "ac-ks" - Aho-Corasick, "Ken Steele" variant
1341# "hs" - Hyperscan, available when built with Hyperscan support
1342#
1343# The default mpm-algo value of "auto" will use "hs" if Hyperscan is
1344# available, "ac" otherwise.
1345#
1346# The mpm you choose also decides the distribution of mpm contexts for
1347# signature groups, specified by the conf - "detect.sgh-mpm-context".
1348# Selecting "ac" as the mpm would require "detect.sgh-mpm-context"
1349# to be set to "single", because of ac's memory requirements, unless the
1350# ruleset is small enough to fit in one's memory, in which case one can
1351# use "full" with "ac". Rest of the mpms can be run in "full" mode.
1352#
1353# There is also a CUDA pattern matcher (only available if Suricata was
1354# compiled with --enable-cuda: b2g_cuda. Make sure to update your
1355# max-pending-packets setting above as well if you use b2g_cuda.
1356
1357mpm-algo: auto
1358
1359# Select the matching algorithm you want to use for single-pattern searches.
1360#
1361# Supported algorithms are "bm" (Boyer-Moore) and "hs" (Hyperscan, only
1362# available if Suricata has been built with Hyperscan support).
1363#
1364# The default of "auto" will use "hs" if available, otherwise "bm".
1365
1366spm-algo: auto
1367
1368# Suricata is multi-threaded. Here the threading can be influenced.
1369threading:
1370 set-cpu-affinity: no
1371 # Tune cpu affinity of threads. Each family of threads can be bound
1372 # on specific CPUs.
1373 #
1374 # These 2 apply to the all runmodes:
1375 # management-cpu-set is used for flow timeout handling, counters
1376 # worker-cpu-set is used for 'worker' threads
1377 #
1378 # Additionally, for autofp these apply:
1379 # receive-cpu-set is used for capture threads
1380 # verdict-cpu-set is used for IPS verdict threads
1381 #
1382 cpu-affinity:
1383 - management-cpu-set:
1384 cpu: [ 0 ] # include only these cpus in affinity settings
1385 - receive-cpu-set:
1386 cpu: [ 0 ] # include only these cpus in affinity settings
1387 - worker-cpu-set:
1388 cpu: [ "all" ]
1389 mode: "exclusive"
1390 # Use explicitely 3 threads and don't compute number by using
1391 # detect-thread-ratio variable:
1392 # threads: 3
1393 prio:
1394 low: [ 0 ]
1395 medium: [ "1-2" ]
1396 high: [ 3 ]
1397 default: "medium"
1398 #- verdict-cpu-set:
1399 # cpu: [ 0 ]
1400 # prio:
1401 # default: "high"
1402 #
1403 # By default Suricata creates one "detect" thread per available CPU/CPU core.
1404 # This setting allows controlling this behaviour. A ratio setting of 2 will
1405 # create 2 detect threads for each CPU/CPU core. So for a dual core CPU this
1406 # will result in 4 detect threads. If values below 1 are used, less threads
1407 # are created. So on a dual core CPU a setting of 0.5 results in 1 detect
1408 # thread being created. Regardless of the setting at a minimum 1 detect
1409 # thread will always be created.
1410 #
1411 detect-thread-ratio: 1.0
1412
1413# Luajit has a strange memory requirement, it's 'states' need to be in the
1414# first 2G of the process' memory.
1415#
1416# 'luajit.states' is used to control how many states are preallocated.
1417# State use: per detect script: 1 per detect thread. Per output script: 1 per
1418# script.
1419luajit:
1420 states: 128
1421
1422# Profiling settings. Only effective if Suricata has been built with the
1423# the --enable-profiling configure flag.
1424#
1425profiling:
1426 # Run profiling for every xth packet. The default is 1, which means we
1427 # profile every packet. If set to 1000, one packet is profiled for every
1428 # 1000 received.
1429 #sample-rate: 1000
1430
1431 # rule profiling
1432 rules:
1433
1434 # Profiling can be disabled here, but it will still have a
1435 # performance impact if compiled in.
1436 enabled: yes
1437 filename: rule_perf.log
1438 append: yes
1439
1440 # Sort options: ticks, avgticks, checks, matches, maxticks
1441 # If commented out all the sort options will be used.
1442 #sort: avgticks
1443
1444 # Limit the number of sids for which stats are shown at exit (per sort).
1445 limit: 10
1446
1447 # output to json
1448 json: yes
1449
1450 # per keyword profiling
1451 keywords:
1452 enabled: yes
1453 filename: keyword_perf.log
1454 append: yes
1455
1456 # per rulegroup profiling
1457 rulegroups:
1458 enabled: yes
1459 filename: rule_group_perf.log
1460 append: yes
1461
1462 # packet profiling
1463 packets:
1464
1465 # Profiling can be disabled here, but it will still have a
1466 # performance impact if compiled in.
1467 enabled: yes
1468 filename: packet_stats.log
1469 append: yes
1470
1471 # per packet csv output
1472 csv:
1473
1474 # Output can be disabled here, but it will still have a
1475 # performance impact if compiled in.
1476 enabled: no
1477 filename: packet_stats.csv
1478
1479 # profiling of locking. Only available when Suricata was built with
1480 # --enable-profiling-locks.
1481 locks:
1482 enabled: no
1483 filename: lock_stats.log
1484 append: yes
1485
1486 pcap-log:
1487 enabled: no
1488 filename: pcaplog_stats.log
1489 append: yes
1490
1491##
1492## Netfilter integration
1493##
1494
1495# When running in NFQ inline mode, it is possible to use a simulated
1496# non-terminal NFQUEUE verdict.
1497# This permit to do send all needed packet to suricata via this a rule:
1498# iptables -I FORWARD -m mark ! --mark $MARK/$MASK -j NFQUEUE
1499# And below, you can have your standard filtering ruleset. To activate
1500# this mode, you need to set mode to 'repeat'
1501# If you want packet to be sent to another queue after an ACCEPT decision
1502# set mode to 'route' and set next-queue value.
1503# On linux >= 3.1, you can set batchcount to a value > 1 to improve performance
1504# by processing several packets before sending a verdict (worker runmode only).
1505# On linux >= 3.6, you can set the fail-open option to yes to have the kernel
1506# accept the packet if suricata is not able to keep pace.
1507# bypass mark and mask can be used to implement NFQ bypass. If bypass mark is
1508# set then the NFQ bypass is activated. Suricata will set the bypass mark/mask
1509# on packet of a flow that need to be bypassed. The Nefilter ruleset has to
1510# directly accept all packets of a flow once a packet has been marked.
1511nfq:
1512# mode: accept
1513# repeat-mark: 1
1514# repeat-mask: 1
1515# bypass-mark: 1
1516# bypass-mask: 1
1517# route-queue: 2
1518# batchcount: 20
1519# fail-open: yes
1520
1521#nflog support
1522nflog:
1523 # netlink multicast group
1524 # (the same as the iptables --nflog-group param)
1525 # Group 0 is used by the kernel, so you can't use it
1526 - group: 2
1527 # netlink buffer size
1528 buffer-size: 18432
1529 # put default value here
1530 - group: default
1531 # set number of packet to queue inside kernel
1532 qthreshold: 1
1533 # set the delay before flushing packet in the queue inside kernel
1534 qtimeout: 100
1535 # netlink max buffer size
1536 max-size: 20000
1537
1538##
1539## Advanced Capture Options
1540##
1541
1542# general settings affecting packet capture
1543capture:
1544 # disable NIC offloading. It's restored when Suricata exists.
1545 # Enabled by default
1546 #disable-offloading: false
1547 #
1548 # disable checksum validation. Same as setting '-k none' on the
1549 # commandline
1550 #checksum-validation: none
1551
1552# Netmap support
1553#
1554# Netmap operates with NIC directly in driver, so you need FreeBSD wich have
1555# built-in netmap support or compile and install netmap module and appropriate
1556# NIC driver on your Linux system.
1557# To reach maximum throughput disable all receive-, segmentation-,
1558# checksum- offloadings on NIC.
1559# Disabling Tx checksum offloading is *required* for connecting OS endpoint
1560# with NIC endpoint.
1561# You can find more information at https://github.com/luigirizzo/netmap
1562#
1563netmap:
1564 # To specify OS endpoint add plus sign at the end (e.g. "eth0+")
1565 - interface: eth2
1566 # Number of receive threads. "auto" uses number of RSS queues on interface.
1567 #threads: auto
1568 # You can use the following variables to activate netmap tap or IPS mode.
1569 # If copy-mode is set to ips or tap, the traffic coming to the current
1570 # interface will be copied to the copy-iface interface. If 'tap' is set, the
1571 # copy is complete. If 'ips' is set, the packet matching a 'drop' action
1572 # will not be copied.
1573 # To specify the OS as the copy-iface (so the OS can route packets, or forward
1574 # to a service running on the same machine) add a plus sign at the end
1575 # (e.g. "copy-iface: eth0+"). Don't forget to set up a symmetrical eth0+ -> eth0
1576 # for return packets. Hardware checksumming must be *off* on the interface if
1577 # using an OS endpoint (e.g. 'ifconfig eth0 -rxcsum -txcsum -rxcsum6 -txcsum6' for FreeBSD
1578 # or 'ethtool -K eth0 tx off rx off' for Linux).
1579 #copy-mode: tap
1580 #copy-iface: eth3
1581 # Set to yes to disable promiscuous mode
1582 # disable-promisc: no
1583 # Choose checksum verification mode for the interface. At the moment
1584 # of the capture, some packets may be with an invalid checksum due to
1585 # offloading to the network card of the checksum computation.
1586 # Possible values are:
1587 # - yes: checksum validation is forced
1588 # - no: checksum validation is disabled
1589 # - auto: suricata uses a statistical approach to detect when
1590 # checksum off-loading is used.
1591 # Warning: 'checksum-validation' must be set to yes to have any validation
1592 #checksum-checks: auto
1593 # BPF filter to apply to this interface. The pcap filter syntax apply here.
1594 #bpf-filter: port 80 or udp
1595 #- interface: eth3
1596 #threads: auto
1597 #copy-mode: tap
1598 #copy-iface: eth2
1599 # Put default values here
1600 - interface: default
1601
1602# PF_RING configuration. for use with native PF_RING support
1603# for more info see http://www.ntop.org/products/pf_ring/
1604pfring:
1605 - interface: eth0
1606 # Number of receive threads (>1 will enable experimental flow pinned
1607 # runmode)
1608 threads: 1
1609
1610 # Default clusterid. PF_RING will load balance packets based on flow.
1611 # All threads/processes that will participate need to have the same
1612 # clusterid.
1613 cluster-id: 99
1614
1615 # Default PF_RING cluster type. PF_RING can load balance per flow.
1616 # Possible values are cluster_flow or cluster_round_robin.
1617 cluster-type: cluster_flow
1618 # bpf filter for this interface
1619 #bpf-filter: tcp
1620 # Choose checksum verification mode for the interface. At the moment
1621 # of the capture, some packets may be with an invalid checksum due to
1622 # offloading to the network card of the checksum computation.
1623 # Possible values are:
1624 # - rxonly: only compute checksum for packets received by network card.
1625 # - yes: checksum validation is forced
1626 # - no: checksum validation is disabled
1627 # - auto: suricata uses a statistical approach to detect when
1628 # checksum off-loading is used. (default)
1629 # Warning: 'checksum-validation' must be set to yes to have any validation
1630 #checksum-checks: auto
1631 # Second interface
1632 #- interface: eth1
1633 # threads: 3
1634 # cluster-id: 93
1635 # cluster-type: cluster_flow
1636 # Put default values here
1637 - interface: default
1638 #threads: 2
1639
1640# For FreeBSD ipfw(8) divert(4) support.
1641# Please make sure you have ipfw_load="YES" and ipdivert_load="YES"
1642# in /etc/loader.conf or kldload'ing the appropriate kernel modules.
1643# Additionally, you need to have an ipfw rule for the engine to see
1644# the packets from ipfw. For Example:
1645#
1646# ipfw add 100 divert 8000 ip from any to any
1647#
1648# The 8000 above should be the same number you passed on the command
1649# line, i.e. -d 8000
1650#
1651ipfw:
1652
1653 # Reinject packets at the specified ipfw rule number. This config
1654 # option is the ipfw rule number AT WHICH rule processing continues
1655 # in the ipfw processing system after the engine has finished
1656 # inspecting the packet for acceptance. If no rule number is specified,
1657 # accepted packets are reinjected at the divert rule which they entered
1658 # and IPFW rule processing continues. No check is done to verify
1659 # this will rule makes sense so care must be taken to avoid loops in ipfw.
1660 #
1661 ## The following example tells the engine to reinject packets
1662 # back into the ipfw firewall AT rule number 5500:
1663 #
1664 # ipfw-reinjection-rule-number: 5500
1665
1666
1667napatech:
1668 # The Host Buffer Allowance for all streams
1669 # (-1 = OFF, 1 - 100 = percentage of the host buffer that can be held back)
1670 hba: -1
1671
1672 # use_all_streams set to "yes" will query the Napatech service for all configured
1673 # streams and listen on all of them. When set to "no" the streams config array
1674 # will be used.
1675 use-all-streams: yes
1676
1677 # The streams to listen on
1678 streams: [1, 2, 3]
1679
1680# Tilera mpipe configuration. for use on Tilera TILE-Gx.
1681mpipe:
1682
1683 # Load balancing modes: "static", "dynamic", "sticky", or "round-robin".
1684 load-balance: dynamic
1685
1686 # Number of Packets in each ingress packet queue. Must be 128, 512, 2028 or 65536
1687 iqueue-packets: 2048
1688
1689 # List of interfaces we will listen on.
1690 inputs:
1691 - interface: xgbe2
1692 - interface: xgbe3
1693 - interface: xgbe4
1694
1695
1696 # Relative weight of memory for packets of each mPipe buffer size.
1697 stack:
1698 size128: 0
1699 size256: 9
1700 size512: 0
1701 size1024: 0
1702 size1664: 7
1703 size4096: 0
1704 size10386: 0
1705 size16384: 0
1706
1707##
1708## Hardware accelaration
1709##
1710
1711# Cuda configuration.
1712cuda:
1713 # The "mpm" profile. On not specifying any of these parameters, the engine's
1714 # internal default values are used, which are same as the ones specified in
1715 # in the default conf file.
1716 mpm:
1717 # The minimum length required to buffer data to the gpu.
1718 # Anything below this is MPM'ed on the CPU.
1719 # Can be specified in kb, mb, gb. Just a number indicates it's in bytes.
1720 # A value of 0 indicates there's no limit.
1721 data-buffer-size-min-limit: 0
1722 # The maximum length for data that we would buffer to the gpu.
1723 # Anything over this is MPM'ed on the CPU.
1724 # Can be specified in kb, mb, gb. Just a number indicates it's in bytes.
1725 data-buffer-size-max-limit: 1500
1726 # The ring buffer size used by the CudaBuffer API to buffer data.
1727 cudabuffer-buffer-size: 500mb
1728 # The max chunk size that can be sent to the gpu in a single go.
1729 gpu-transfer-size: 50mb
1730 # The timeout limit for batching of packets in microseconds.
1731 batching-timeout: 2000
1732 # The device to use for the mpm. Currently we don't support load balancing
1733 # on multiple gpus. In case you have multiple devices on your system, you
1734 # can specify the device to use, using this conf. By default we hold 0, to
1735 # specify the first device cuda sees. To find out device-id associated with
1736 # the card(s) on the system run "suricata --list-cuda-cards".
1737 device-id: 0
1738 # No of Cuda streams used for asynchronous processing. All values > 0 are valid.
1739 # For this option you need a device with Compute Capability > 1.0.
1740 cuda-streams: 2
1741
1742##
1743## Include other configs
1744##
1745
1746# Includes. Files included here will be handled as if they were
1747# inlined in this configuration file.
1748#include: include1.yaml
1749#include: include2.yaml