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