]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - config/suricata/suricata.yaml
IDS: Redesign backend for used provider rulesfiles.
[people/pmueller/ipfire-2.x.git] / config / suricata / suricata.yaml
1 %YAML 1.1
2 ---
3
4 ##
5 ## IPFire specific configuration file - an untouched example configuration
6 ## can be found in suricata-example.yaml.
7 ##
8
9 vars:
10 address-groups:
11 # Include HOME_NET declaration from external file.
12 include: /var/ipfire/suricata/suricata-homenet.yaml
13
14 # Include DNS_SERVERS declaration from external file.
15 include: /var/ipfire/suricata/suricata-dns-servers.yaml
16
17 EXTERNAL_NET: "any"
18
19 HTTP_SERVERS: "$HOME_NET"
20 SMTP_SERVERS: "$HOME_NET"
21 SQL_SERVERS: "$HOME_NET"
22 TELNET_SERVERS: "$HOME_NET"
23 AIM_SERVERS: "$EXTERNAL_NET"
24 DC_SERVERS: "$HOME_NET"
25 DNP3_SERVER: "$HOME_NET"
26 DNP3_CLIENT: "$HOME_NET"
27 MODBUS_CLIENT: "$HOME_NET"
28 MODBUS_SERVER: "$HOME_NET"
29 ENIP_CLIENT: "$HOME_NET"
30 ENIP_SERVER: "$HOME_NET"
31
32 port-groups:
33 # Incluse HTTP_PORTS declaration from external file.
34 include: /var/ipfire/suricata/suricata-http-ports.yaml
35
36 SHELLCODE_PORTS: "!80"
37 ORACLE_PORTS: 1521
38 SSH_PORTS: "[22,222]"
39 DNP3_PORTS: 20000
40 MODBUS_PORTS: 502
41 FILE_DATA_PORTS: "[$HTTP_PORTS,110,143]"
42 FTP_PORTS: 21
43
44 ##
45 ## Ruleset specific options.
46 ##
47 default-rule-path: /var/lib/suricata
48 rule-files:
49 # Include enabled ruleset files from external file.
50 include: /var/ipfire/suricata/suricata-used-providers.yaml
51
52 # Include default rules.
53 include: /var/ipfire/suricata/suricata-default-rules.yaml
54
55 classification-file: /var/lib/suricata/classification.config
56 reference-config-file: /var/lib/suricata/reference.config
57 threshold-file: /var/lib/suricata/threshold.config
58
59
60 ##
61 ## Logging options.
62 ##
63 default-log-dir: /var/log/suricata/
64
65 # global stats configuration
66 stats:
67 enabled: yes
68 # The interval field (in seconds) controls at what interval
69 # the loggers are invoked.
70 interval: 8
71
72 # Add decode events as stats.
73 #decoder-events: true
74 # Decoder event prefix in stats. Has been 'decoder' before, but that leads
75 # to missing events in the eve.stats records. See issue #2225.
76 decoder-events-prefix: "decoder.event"
77 # Add stream events as stats.
78 #stream-events: false
79
80 # Configure the type of alert (and other) logging you would like.
81 outputs:
82 # a line based alerts log similar to Snort's fast.log
83 - fast:
84 enabled: yes
85 filename: fast.log
86 append: yes
87 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
88
89 # Stats.log contains data from various counters of the suricata engine.
90 - stats:
91 enabled: no
92 filename: stats.log
93 append: no # append to file (yes) or overwrite it (no)
94 totals: yes # stats for all threads merged together
95 threads: no # per thread stats
96 #null-values: yes # print counters that have value 0
97
98 # Extensible Event Format (nicknamed EVE) event log in JSON format
99 - eve-log:
100 enabled: no
101 filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
102 filename: eve.json
103 #prefix: "@cee: " # prefix to prepend to each log entry
104 # the following are valid when type: syslog above
105 #identity: "suricata"
106 #facility: local5
107 #level: Info ## possible levels: Emergency, Alert, Critical,
108 ## Error, Warning, Notice, Info, Debug
109 #redis:
110 # server: 127.0.0.1
111 # port: 6379
112 # async: true ## if redis replies are read asynchronously
113 # mode: list ## possible values: list|lpush (default), rpush, channel|publish
114 # ## lpush and rpush are using a Redis list. "list" is an alias for lpush
115 # ## publish is using a Redis channel. "channel" is an alias for publish
116 # key: suricata ## key or channel to use (default to suricata)
117 # Redis pipelining set up. This will enable to only do a query every
118 # 'batch-size' events. This should lower the latency induced by network
119 # connection at the cost of some memory. There is no flushing implemented
120 # so this setting as to be reserved to high traffic suricata.
121 # pipelining:
122 # enabled: yes ## set enable to yes to enable query pipelining
123 # batch-size: 10 ## number of entry to keep in buffer
124
125 # Include top level metadata. Default yes.
126 #metadata: no
127
128 # include the name of the input pcap file in pcap file processing mode
129 pcap-file: false
130
131 # Community Flow ID
132 # Adds a 'community_id' field to EVE records. These are meant to give
133 # a records a predictable flow id that can be used to match records to
134 # output of other tools such as Bro.
135 #
136 # Takes a 'seed' that needs to be same across sensors and tools
137 # to make the id less predictable.
138
139 # enable/disable the community id feature.
140 community-id: false
141 # Seed value for the ID output. Valid values are 0-65535.
142 community-id-seed: 0
143
144 # HTTP X-Forwarded-For support by adding an extra field or overwriting
145 # the source or destination IP address (depending on flow direction)
146 # with the one reported in the X-Forwarded-For HTTP header. This is
147 # helpful when reviewing alerts for traffic that is being reverse
148 # or forward proxied.
149 xff:
150 enabled: no
151 # Two operation modes are available, "extra-data" and "overwrite".
152 mode: extra-data
153 # Two proxy deployments are supported, "reverse" and "forward". In
154 # a "reverse" deployment the IP address used is the last one, in a
155 # "forward" deployment the first IP address is used.
156 deployment: reverse
157 # Header name where the actual IP address will be reported, if more
158 # than one IP address is present, the last IP address will be the
159 # one taken into consideration.
160 header: X-Forwarded-For
161
162 types:
163 - alert:
164 # payload: yes # enable dumping payload in Base64
165 # payload-buffer-size: 4kb # max size of payload buffer to output in eve-log
166 # payload-printable: yes # enable dumping payload in printable (lossy) format
167 # packet: yes # enable dumping of packet (without stream segments)
168 # metadata: no # enable inclusion of app layer metadata with alert. Default yes
169 # http-body: yes # Requires metadata; enable dumping of http body in Base64
170 # http-body-printable: yes # Requires metadata; enable dumping of http body in printable format
171
172 # Enable the logging of tagged packets for rules using the
173 # "tag" keyword.
174 tagged-packets: yes
175 - anomaly:
176 # Anomaly log records describe unexpected conditions such
177 # as truncated packets, packets with invalid IP/UDP/TCP
178 # length values, and other events that render the packet
179 # invalid for further processing or describe unexpected
180 # behavior on an established stream. Networks which
181 # experience high occurrences of anomalies may experience
182 # packet processing degradation.
183 #
184 # Anomalies are reported for the following:
185 # 1. Decode: Values and conditions that are detected while
186 # decoding individual packets. This includes invalid or
187 # unexpected values for low-level protocol lengths as well
188 # as stream related events (TCP 3-way handshake issues,
189 # unexpected sequence number, etc).
190 # 2. Stream: This includes stream related events (TCP
191 # 3-way handshake issues, unexpected sequence number,
192 # etc).
193 # 3. Application layer: These denote application layer
194 # specific conditions that are unexpected, invalid or are
195 # unexpected given the application monitoring state.
196 #
197 # By default, anomaly logging is disabled. When anomaly
198 # logging is enabled, applayer anomaly reporting is
199 # enabled.
200 enabled: yes
201 #
202 # Choose one or more types of anomaly logging and whether to enable
203 # logging of the packet header for packet anomalies.
204 types:
205 # decode: no
206 # stream: no
207 # applayer: yes
208 #packethdr: no
209 - http:
210 extended: yes # enable this for extended logging information
211 # custom allows additional http fields to be included in eve-log
212 # the example below adds three additional fields when uncommented
213 #custom: [Accept-Encoding, Accept-Language, Authorization]
214 # set this value to one and only one among {both, request, response}
215 # to dump all http headers for every http request and/or response
216 # dump-all-headers: none
217 - dns:
218 # This configuration uses the new DNS logging format,
219 # the old configuration is still available:
220 # https://suricata.readthedocs.io/en/latest/output/eve/eve-json-output.html#dns-v1-format
221
222 # As of Suricata 5.0, version 2 of the eve dns output
223 # format is the default.
224 #version: 2
225
226 # Enable/disable this logger. Default: enabled.
227 #enabled: yes
228
229 # Control logging of requests and responses:
230 # - requests: enable logging of DNS queries
231 # - responses: enable logging of DNS answers
232 # By default both requests and responses are logged.
233 #requests: no
234 #responses: no
235
236 # Format of answer logging:
237 # - detailed: array item per answer
238 # - grouped: answers aggregated by type
239 # Default: all
240 #formats: [detailed, grouped]
241
242 # Types to log, based on the query type.
243 # Default: all.
244 #types: [a, aaaa, cname, mx, ns, ptr, txt]
245 - tls:
246 extended: yes # enable this for extended logging information
247 # output TLS transaction where the session is resumed using a
248 # session id
249 #session-resumption: no
250 # custom allows to control which tls fields that are included
251 # in eve-log
252 #custom: [subject, issuer, session_resumed, serial, fingerprint, sni, version, not_before, not_after, certificate, chain, ja3, ja3s]
253 - files:
254 force-magic: no # force logging magic on all logged files
255 # force logging of checksums, available hash functions are md5,
256 # sha1 and sha256
257 #force-hash: [md5]
258 #- drop:
259 # alerts: yes # log alerts that caused drops
260 # flows: all # start or all: 'start' logs only a single drop
261 # # per flow direction. All logs each dropped pkt.
262 - smtp:
263 #extended: yes # enable this for extended logging information
264 # this includes: bcc, message-id, subject, x_mailer, user-agent
265 # custom fields logging from the list:
266 # reply-to, bcc, message-id, subject, x-mailer, user-agent, received,
267 # x-originating-ip, in-reply-to, references, importance, priority,
268 # sensitivity, organization, content-md5, date
269 #custom: [received, x-mailer, x-originating-ip, relays, reply-to, bcc]
270 # output md5 of fields: body, subject
271 # for the body you need to set app-layer.protocols.smtp.mime.body-md5
272 # to yes
273 #md5: [body, subject]
274
275 #- dnp3
276 - ftp
277 - rdp
278 - nfs
279 - smb
280 - tftp
281 - ikev2
282 - dcerpc
283 - krb5
284 - snmp
285 - rfb
286 - sip
287 - dhcp:
288 enabled: yes
289 # When extended mode is on, all DHCP messages are logged
290 # with full detail. When extended mode is off (the
291 # default), just enough information to map a MAC address
292 # to an IP address is logged.
293 extended: no
294 - ssh
295 - mqtt:
296 # passwords: yes # enable output of passwords
297 # HTTP2 logging. HTTP2 support is currently experimental and
298 # disabled by default. To enable, uncomment the following line
299 # and be sure to enable http2 in the app-layer section.
300 #- http2
301 - stats:
302 totals: yes # stats for all threads merged together
303 threads: no # per thread stats
304 deltas: no # include delta values
305 # bi-directional flows
306 - flow
307 # uni-directional flows
308 #- netflow
309
310 # Metadata event type. Triggered whenever a pktvar is saved
311 # and will include the pktvars, flowvars, flowbits and
312 # flowints.
313 #- metadata
314
315 logging:
316 # The default log level, can be overridden in an output section.
317 # Note that debug level logging will only be emitted if Suricata was
318 # compiled with the --enable-debug configure option.
319 #
320 # This value is overriden by the SC_LOG_LEVEL env var.
321 default-log-level: notice
322
323 # A regex to filter output. Can be overridden in an output section.
324 # Defaults to empty (no filter).
325 #
326 # This value is overriden by the SC_LOG_OP_FILTER env var.
327 default-output-filter:
328
329 # Define your logging outputs. If none are defined, or they are all
330 # disabled you will get the default - console output.
331 outputs:
332 - console:
333 enabled: no
334 # type: json
335 - file:
336 enabled: no
337 level: info
338 filename: /var/log/suricata/suricata.log
339 # type: json
340 - syslog:
341 enabled: yes
342 facility: local5
343 format: ""
344 # type: json
345
346 ##
347 ## Netfilter configuration
348 ##
349
350 nfq:
351 mode: repeat
352 repeat-mark: 2147483648
353 repeat-mask: 2147483648
354 bypass-mark: 1073741824
355 bypass-mask: 1073741824
356 # route-queue: 2
357 # batchcount: 20
358 fail-open: yes
359
360 ##
361 ## Step 5: App Layer Protocol Configuration
362 ##
363
364 # Configure the app-layer parsers. The protocols section details each
365 # protocol.
366 #
367 # The option "enabled" takes 3 values - "yes", "no", "detection-only".
368 # "yes" enables both detection and the parser, "no" disables both, and
369 # "detection-only" enables protocol detection only (parser disabled).
370 app-layer:
371 protocols:
372 rfb:
373 enabled: yes
374 detection-ports:
375 dp: 5900, 5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909
376 # MQTT, disabled by default.
377 mqtt:
378 # enabled: no
379 # max-msg-length: 1mb
380 krb5:
381 enabled: yes
382 snmp:
383 enabled: yes
384 ikev2:
385 enabled: yes
386 tls:
387 enabled: yes
388 detection-ports:
389 dp: "[443,444,465,853,993,995]"
390
391 # Generate JA3 fingerprint from client hello. If not specified it
392 # will be disabled by default, but enabled if rules require it.
393 ja3-fingerprints: auto
394
395 # What to do when the encrypted communications start:
396 # - default: keep tracking TLS session, check for protocol anomalies,
397 # inspect tls_* keywords. Disables inspection of unmodified
398 # 'content' signatures.
399 # - bypass: stop processing this flow as much as possible. No further
400 # TLS parsing and inspection. Offload flow bypass to kernel
401 # or hardware if possible.
402 # - full: keep tracking and inspection as normal. Unmodified content
403 # keyword signatures are inspected as well.
404 #
405 # For best performance, select 'bypass'.
406 #
407 encryption-handling: bypass
408 dcerpc:
409 enabled: yes
410 ftp:
411 enabled: yes
412 rdp:
413 enabled: yes
414 ssh:
415 enabled: yes
416 #hassh: yes
417 # HTTP2: Experimental HTTP 2 support. Disabled by default.
418 http2:
419 enabled: no
420 smtp:
421 enabled: yes
422 # Configure SMTP-MIME Decoder
423 mime:
424 # Decode MIME messages from SMTP transactions
425 # (may be resource intensive)
426 # This field supercedes all others because it turns the entire
427 # process on or off
428 decode-mime: yes
429
430 # Decode MIME entity bodies (ie. base64, quoted-printable, etc.)
431 decode-base64: yes
432 decode-quoted-printable: yes
433
434 # Maximum bytes per header data value stored in the data structure
435 # (default is 2000)
436 header-value-depth: 2000
437
438 # Extract URLs and save in state data structure
439 extract-urls: yes
440 # Set to yes to compute the md5 of the mail body. You will then
441 # be able to journalize it.
442 body-md5: no
443 # Configure inspected-tracker for file_data keyword
444 inspected-tracker:
445 content-limit: 100000
446 content-inspect-min-size: 32768
447 content-inspect-window: 4096
448 imap:
449 enabled: yes
450 msn:
451 enabled: yes
452 smb:
453 enabled: yes
454 detection-ports:
455 dp: 139, 445
456 nfs:
457 enabled: yes
458 tftp:
459 enabled: yes
460 dns:
461 # memcaps. Globally and per flow/state.
462 global-memcap: 32mb
463 state-memcap: 512kb
464
465 # How many unreplied DNS requests are considered a flood.
466 # If the limit is reached, app-layer-event:dns.flooded; will match.
467 #request-flood: 512
468
469 tcp:
470 enabled: yes
471 detection-ports:
472 dp: 53
473 udp:
474 enabled: yes
475 detection-ports:
476 dp: 53
477 http:
478 enabled: yes
479 memcap: 256mb
480
481 # default-config: Used when no server-config matches
482 # personality: List of personalities used by default
483 # request-body-limit: Limit reassembly of request body for inspection
484 # by http_client_body & pcre /P option.
485 # response-body-limit: Limit reassembly of response body for inspection
486 # by file_data, http_server_body & pcre /Q option.
487 # double-decode-path: Double decode path section of the URI
488 # double-decode-query: Double decode query section of the URI
489 # response-body-decompress-layer-limit:
490 # Limit to how many layers of compression will be
491 # decompressed. Defaults to 2.
492 #
493 # Currently Available Personalities:
494 # Minimal, Generic, IDS (default), IIS_4_0, IIS_5_0, IIS_5_1, IIS_6_0,
495 # IIS_7_0, IIS_7_5, Apache_2
496 libhtp:
497 default-config:
498 personality: IDS
499
500 # Can be specified in kb, mb, gb. Just a number indicates
501 # it's in bytes.
502 request-body-limit: 0
503 response-body-limit: 0
504
505 # response body decompression (0 disables)
506 response-body-decompress-layer-limit: 2
507
508 # auto will use http-body-inline mode in IPS mode, yes or no set it statically
509 http-body-inline: auto
510
511 # Take a random value for inspection sizes around the specified value.
512 # This lower the risk of some evasion technics but could lead
513 # detection change between runs. It is set to 'yes' by default.
514 randomize-inspection-sizes: yes
515 # If randomize-inspection-sizes is active, the value of various
516 # inspection size will be choosen in the [1 - range%, 1 + range%]
517 # range
518 # Default value of randomize-inspection-range is 10.
519 randomize-inspection-range: 10
520
521 # decoding
522 double-decode-path: no
523 double-decode-query: no
524
525 ntp:
526 enabled: yes
527 dhcp:
528 enabled: yes
529 sip:
530 enabled: yes
531
532 # Limit for the maximum number of asn1 frames to decode (default 256)
533 asn1-max-frames: 256
534
535
536 ##############################################################################
537 ##
538 ## Advanced settings below
539 ##
540 ##############################################################################
541
542 ##
543 ## Run Options
544 ##
545
546 # Run suricata as user and group.
547 run-as:
548 user: suricata
549 group: suricata
550
551 # Suricata core dump configuration. Limits the size of the core dump file to
552 # approximately max-dump. The actual core dump size will be a multiple of the
553 # page size. Core dumps that would be larger than max-dump are truncated. On
554 # Linux, the actual core dump size may be a few pages larger than max-dump.
555 # Setting max-dump to 0 disables core dumping.
556 # Setting max-dump to 'unlimited' will give the full core dump file.
557 # On 32-bit Linux, a max-dump value >= ULONG_MAX may cause the core dump size
558 # to be 'unlimited'.
559
560 coredump:
561 max-dump: unlimited
562
563 # If suricata box is a router for the sniffed networks, set it to 'router'. If
564 # it is a pure sniffing setup, set it to 'sniffer-only'.
565 # If set to auto, the variable is internally switch to 'router' in IPS mode
566 # and 'sniffer-only' in IDS mode.
567 # This feature is currently only used by the reject* keywords.
568 host-mode: auto
569
570 # Number of packets preallocated per thread. The default is 1024. A higher number
571 # will make sure each CPU will be more easily kept busy, but may negatively
572 # impact caching.
573 max-pending-packets: 1024
574
575 # Runmode the engine should use. Please check --list-runmodes to get the available
576 # runmodes for each packet acquisition method. Defaults to "autofp" (auto flow pinned
577 # load balancing).
578 runmode: workers
579
580 # Specifies the kind of flow load balancer used by the flow pinned autofp mode.
581 #
582 # Supported schedulers are:
583 #
584 # round-robin - Flows assigned to threads in a round robin fashion.
585 # active-packets - Flows assigned to threads that have the lowest number of
586 # unprocessed packets (default).
587 # hash - Flow alloted usihng the address hash. More of a random
588 # technique. Was the default in Suricata 1.2.1 and older.
589 #
590 #autofp-scheduler: active-packets
591
592 # Preallocated size for packet. Default is 1514 which is the classical
593 # size for pcap on ethernet. You should adjust this value to the highest
594 # packet size (MTU + hardware header) on your system.
595 default-packet-size: 1514
596
597 # Unix command socket can be used to pass commands to suricata.
598 # An external tool can then connect to get information from suricata
599 # or trigger some modifications of the engine. Set enabled to yes
600 # to activate the feature. In auto mode, the feature will only be
601 # activated in live capture mode. You can use the filename variable to set
602 # the file name of the socket.
603 unix-command:
604 enabled: no
605 #filename: custom.socket
606
607 # Magic file
608 magic-file: /usr/share/misc/magic.mgc
609
610 legacy:
611 uricontent: enabled
612
613 ##
614 ## Detection settings
615 ##
616
617 # Set the order of alerts bassed on actions
618 # The default order is pass, drop, reject, alert
619 # action-order:
620 # - pass
621 # - drop
622 # - reject
623 # - alert
624
625 # When run with the option --engine-analysis, the engine will read each of
626 # the parameters below, and print reports for each of the enabled sections
627 # and exit. The reports are printed to a file in the default log dir
628 # given by the parameter "default-log-dir", with engine reporting
629 # subsection below printing reports in its own report file.
630 engine-analysis:
631 # enables printing reports for fast-pattern for every rule.
632 rules-fast-pattern: yes
633 # enables printing reports for each rule
634 rules: yes
635
636 #recursion and match limits for PCRE where supported
637 pcre:
638 match-limit: 3500
639 match-limit-recursion: 1500
640
641 ##
642 ## Advanced Traffic Tracking and Reconstruction Settings
643 ##
644
645 # Host specific policies for defragmentation and TCP stream
646 # reassembly. The host OS lookup is done using a radix tree, just
647 # like a routing table so the most specific entry matches.
648 host-os-policy:
649 # Make the default policy windows.
650 windows: [0.0.0.0/0]
651 bsd: []
652 bsd-right: []
653 old-linux: []
654 linux: []
655 old-solaris: []
656 solaris: []
657 hpux10: []
658 hpux11: []
659 irix: []
660 macos: []
661 vista: []
662 windows2k3: []
663
664 # Defrag settings:
665
666 defrag:
667 memcap: 64mb
668 hash-size: 65536
669 trackers: 65535 # number of defragmented flows to follow
670 max-frags: 65535 # number of fragments to keep (higher than trackers)
671 prealloc: yes
672 timeout: 60
673
674 # Flow settings:
675 # By default, the reserved memory (memcap) for flows is 32MB. This is the limit
676 # for flow allocation inside the engine. You can change this value to allow
677 # more memory usage for flows.
678 # The hash-size determine the size of the hash used to identify flows inside
679 # the engine, and by default the value is 65536.
680 # At the startup, the engine can preallocate a number of flows, to get a better
681 # performance. The number of flows preallocated is 10000 by default.
682 # emergency-recovery is the percentage of flows that the engine need to
683 # prune before unsetting the emergency state. The emergency state is activated
684 # when the memcap limit is reached, allowing to create new flows, but
685 # prunning them with the emergency timeouts (they are defined below).
686 # If the memcap is reached, the engine will try to prune flows
687 # with the default timeouts. If it doens't find a flow to prune, it will set
688 # the emergency bit and it will try again with more agressive timeouts.
689 # If that doesn't work, then it will try to kill the last time seen flows
690 # not in use.
691 # The memcap can be specified in kb, mb, gb. Just a number indicates it's
692 # in bytes.
693
694 flow:
695 memcap: 256mb
696 hash-size: 65536
697 prealloc: 10000
698 emergency-recovery: 30
699 managers: 1
700 recyclers: 1
701
702 # This option controls the use of vlan ids in the flow (and defrag)
703 # hashing. Normally this should be enabled, but in some (broken)
704 # setups where both sides of a flow are not tagged with the same vlan
705 # tag, we can ignore the vlan id's in the flow hashing.
706 vlan:
707 use-for-tracking: true
708
709 # Specific timeouts for flows. Here you can specify the timeouts that the
710 # active flows will wait to transit from the current state to another, on each
711 # protocol. The value of "new" determine the seconds to wait after a hanshake or
712 # stream startup before the engine free the data of that flow it doesn't
713 # change the state to established (usually if we don't receive more packets
714 # of that flow). The value of "established" is the amount of
715 # seconds that the engine will wait to free the flow if it spend that amount
716 # without receiving new packets or closing the connection. "closed" is the
717 # amount of time to wait after a flow is closed (usually zero). "bypassed"
718 # timeout controls locally bypassed flows. For these flows we don't do any other
719 # tracking. If no packets have been seen after this timeout, the flow is discarded.
720 #
721 # There's an emergency mode that will become active under attack circumstances,
722 # making the engine to check flow status faster. This configuration variables
723 # use the prefix "emergency-" and work similar as the normal ones.
724 # Some timeouts doesn't apply to all the protocols, like "closed", for udp and
725 # icmp.
726
727 flow-timeouts:
728
729 default:
730 new: 30
731 established: 300
732 closed: 0
733 bypassed: 100
734 emergency-new: 10
735 emergency-established: 100
736 emergency-closed: 0
737 emergency-bypassed: 50
738 tcp:
739 new: 60
740 established: 600
741 closed: 60
742 bypassed: 100
743 emergency-new: 5
744 emergency-established: 100
745 emergency-closed: 10
746 emergency-bypassed: 50
747 udp:
748 new: 30
749 established: 300
750 bypassed: 100
751 emergency-new: 10
752 emergency-established: 100
753 emergency-bypassed: 50
754 icmp:
755 new: 30
756 established: 300
757 bypassed: 100
758 emergency-new: 10
759 emergency-established: 100
760 emergency-bypassed: 50
761
762 # Stream engine settings. Here the TCP stream tracking and reassembly
763 # engine is configured.
764 #
765 # stream:
766 # memcap: 32mb # Can be specified in kb, mb, gb. Just a
767 # # number indicates it's in bytes.
768 # checksum-validation: yes # To validate the checksum of received
769 # # packet. If csum validation is specified as
770 # # "yes", then packet with invalid csum will not
771 # # be processed by the engine stream/app layer.
772 # # Warning: locally generated trafic can be
773 # # generated without checksum due to hardware offload
774 # # of checksum. You can control the handling of checksum
775 # # on a per-interface basis via the 'checksum-checks'
776 # # option
777 # prealloc-sessions: 2k # 2k sessions prealloc'd per stream thread
778 # midstream: false # don't allow midstream session pickups
779 # async-oneside: false # don't enable async stream handling
780 # inline: no # stream inline mode
781 # drop-invalid: yes # in inline mode, drop packets that are invalid with regards to streaming engine
782 # max-synack-queued: 5 # Max different SYN/ACKs to queue
783 # bypass: no # Bypass packets when stream.depth is reached
784 #
785 # reassembly:
786 # memcap: 64mb # Can be specified in kb, mb, gb. Just a number
787 # # indicates it's in bytes.
788 # depth: 1mb # Can be specified in kb, mb, gb. Just a number
789 # # indicates it's in bytes.
790 # toserver-chunk-size: 2560 # inspect raw stream in chunks of at least
791 # # this size. Can be specified in kb, mb,
792 # # gb. Just a number indicates it's in bytes.
793 # toclient-chunk-size: 2560 # inspect raw stream in chunks of at least
794 # # this size. Can be specified in kb, mb,
795 # # gb. Just a number indicates it's in bytes.
796 # randomize-chunk-size: yes # Take a random value for chunk size around the specified value.
797 # # This lower the risk of some evasion technics but could lead
798 # # detection change between runs. It is set to 'yes' by default.
799 # randomize-chunk-range: 10 # If randomize-chunk-size is active, the value of chunk-size is
800 # # a random value between (1 - randomize-chunk-range/100)*toserver-chunk-size
801 # # and (1 + randomize-chunk-range/100)*toserver-chunk-size and the same
802 # # calculation for toclient-chunk-size.
803 # # Default value of randomize-chunk-range is 10.
804 #
805 # raw: yes # 'Raw' reassembly enabled or disabled.
806 # # raw is for content inspection by detection
807 # # engine.
808 #
809 # segment-prealloc: 2048 # number of segments preallocated per thread
810 #
811 # check-overlap-different-data: true|false
812 # # check if a segment contains different data
813 # # than what we've already seen for that
814 # # position in the stream.
815 # # This is enabled automatically if inline mode
816 # # is used or when stream-event:reassembly_overlap_different_data;
817 # # is used in a rule.
818 #
819 stream:
820 memcap: 256mb
821 prealloc-sessions: 4096
822 checksum-validation: yes # reject wrong csums
823 inline: auto # auto will use inline mode in IPS mode, yes or no set it statically
824 bypass: yes # Bypass packets when stream.reassembly.depth is reached.
825 reassembly:
826 memcap: 256mb
827 depth: 1mb # reassemble 1mb into a stream
828 toserver-chunk-size: 2560
829 toclient-chunk-size: 2560
830 randomize-chunk-size: yes
831 raw: yes
832 segment-prealloc: 2048
833 check-overlap-different-data: true
834
835 # Host table:
836 #
837 # Host table is used by tagging and per host thresholding subsystems.
838 #
839 host:
840 hash-size: 4096
841 prealloc: 1000
842 memcap: 32mb
843
844 # IP Pair table:
845 #
846 # Used by xbits 'ippair' tracking.
847 #
848 #ippair:
849 # hash-size: 4096
850 # prealloc: 1000
851 # memcap: 32mb
852
853 # Decoder settings
854
855 decoder:
856 # Teredo decoder is known to not be completely accurate
857 # it will sometimes detect non-teredo as teredo.
858 teredo:
859 enabled: false
860
861
862 ##
863 ## Performance tuning and profiling
864 ##
865
866 # The detection engine builds internal groups of signatures. The engine
867 # allow us to specify the profile to use for them, to manage memory on an
868 # efficient way keeping a good performance. For the profile keyword you
869 # can use the words "low", "medium", "high" or "custom". If you use custom
870 # make sure to define the values at "- custom-values" as your convenience.
871 # Usually you would prefer medium/high/low.
872 #
873 # "sgh mpm-context", indicates how the staging should allot mpm contexts for
874 # the signature groups. "single" indicates the use of a single context for
875 # all the signature group heads. "full" indicates a mpm-context for each
876 # group head. "auto" lets the engine decide the distribution of contexts
877 # based on the information the engine gathers on the patterns from each
878 # group head.
879 #
880 # The option inspection-recursion-limit is used to limit the recursive calls
881 # in the content inspection code. For certain payload-sig combinations, we
882 # might end up taking too much time in the content inspection code.
883 # If the argument specified is 0, the engine uses an internally defined
884 # default limit. On not specifying a value, we use no limits on the recursion.
885 detect:
886 profile: custom
887 custom-values:
888 toclient-groups: 200
889 toserver-groups: 200
890 sgh-mpm-context: auto
891 inspection-recursion-limit: 3000
892
893 # If set to yes, the loading of signatures will be made after the capture
894 # is started. This will limit the downtime in IPS mode.
895 delayed-detect: yes
896
897 prefilter:
898 # default prefiltering setting. "mpm" only creates MPM/fast_pattern
899 # engines. "auto" also sets up prefilter engines for other keywords.
900 # Use --list-keywords=all to see which keywords support prefiltering.
901 default: mpm
902
903 # the grouping values above control how many groups are created per
904 # direction. Port whitelisting forces that port to get it's own group.
905 # Very common ports will benefit, as well as ports with many expensive
906 # rules.
907 grouping:
908 #tcp-whitelist: 53, 80, 139, 443, 445, 1433, 3306, 3389, 6666, 6667, 8080
909 #udp-whitelist: 53, 135, 5060
910
911 profiling:
912 # Log the rules that made it past the prefilter stage, per packet
913 # default is off. The threshold setting determines how many rules
914 # must have made it past pre-filter for that rule to trigger the
915 # logging.
916 #inspect-logging-threshold: 200
917 grouping:
918 dump-to-disk: false
919 include-rules: false # very verbose
920 include-mpm-stats: false
921
922 # Select the multi pattern algorithm you want to run for scan/search the
923 # in the engine.
924 #
925 # The supported algorithms are:
926 # "ac" - Aho-Corasick, default implementation
927 # "ac-bs" - Aho-Corasick, reduced memory implementation
928 # "ac-cuda" - Aho-Corasick, CUDA implementation
929 # "ac-ks" - Aho-Corasick, "Ken Steele" variant
930 # "hs" - Hyperscan, available when built with Hyperscan support
931 #
932 # The default mpm-algo value of "auto" will use "hs" if Hyperscan is
933 # available, "ac" otherwise.
934 #
935 # The mpm you choose also decides the distribution of mpm contexts for
936 # signature groups, specified by the conf - "detect.sgh-mpm-context".
937 # Selecting "ac" as the mpm would require "detect.sgh-mpm-context"
938 # to be set to "single", because of ac's memory requirements, unless the
939 # ruleset is small enough to fit in one's memory, in which case one can
940 # use "full" with "ac". Rest of the mpms can be run in "full" mode.
941 #
942 # There is also a CUDA pattern matcher (only available if Suricata was
943 # compiled with --enable-cuda: b2g_cuda. Make sure to update your
944 # max-pending-packets setting above as well if you use b2g_cuda.
945
946 mpm-algo: auto
947
948 # Select the matching algorithm you want to use for single-pattern searches.
949 #
950 # Supported algorithms are "bm" (Boyer-Moore) and "hs" (Hyperscan, only
951 # available if Suricata has been built with Hyperscan support).
952 #
953 # The default of "auto" will use "hs" if available, otherwise "bm".
954
955 spm-algo: auto
956
957 # Suricata is multi-threaded. Here the threading can be influenced.
958 threading:
959 set-cpu-affinity: no
960 # Tune cpu affinity of threads. Each family of threads can be bound
961 # on specific CPUs.
962 #
963 # These 2 apply to the all runmodes:
964 # management-cpu-set is used for flow timeout handling, counters
965 # worker-cpu-set is used for 'worker' threads
966 #
967 # Additionally, for autofp these apply:
968 # receive-cpu-set is used for capture threads
969 # verdict-cpu-set is used for IPS verdict threads
970 #
971 cpu-affinity:
972 - management-cpu-set:
973 cpu: [ 0 ] # include only these cpus in affinity settings
974 - receive-cpu-set:
975 cpu: [ 0 ] # include only these cpus in affinity settings
976 - worker-cpu-set:
977 cpu: [ "all" ]
978 mode: "exclusive"
979 prio:
980 low: [ 0 ]
981 medium: [ "1-2" ]
982 high: [ 3 ]
983 default: "medium"
984 - verdict-cpu-set:
985 cpu: [ 0 ]
986 prio:
987 default: "high"
988 #
989 # By default Suricata creates one "detect" thread per available CPU/CPU core.
990 # This setting allows controlling this behaviour. A ratio setting of 2 will
991 # create 2 detect threads for each CPU/CPU core. So for a dual core CPU this
992 # will result in 4 detect threads. If values below 1 are used, less threads
993 # are created. So on a dual core CPU a setting of 0.5 results in 1 detect
994 # thread being created. Regardless of the setting at a minimum 1 detect
995 # thread will always be created.
996 #
997 detect-thread-ratio: 1.0