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