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