]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - config/suricata/suricata.yaml
IDS: Dynamically generate and import the HTTP ports.
[people/pmueller/ipfire-2.x.git] / config / suricata / suricata.yaml
CommitLineData
4c6d6c1e
SS
1%YAML 1.1
2---
3
4c6d6c1e 4##
335114b2
SS
5## IPFire specific configuration file - an untouched example configuration
6## can be found in suricata-example.yaml.
4c6d6c1e
SS
7##
8
9vars:
4c6d6c1e 10 address-groups:
42303055 11 # Include HOME_NET declaration from external file.
13d077fd 12 include: /var/ipfire/suricata/suricata-homenet.yaml
4c6d6c1e 13
961a27b5
SS
14 # Include DNS_SERVERS declaration from external file.
15 include: /var/ipfire/suricata/suricata-dns-servers.yaml
16
50612920 17 EXTERNAL_NET: "any"
4c6d6c1e
SS
18
19 HTTP_SERVERS: "$HOME_NET"
20 SMTP_SERVERS: "$HOME_NET"
21 SQL_SERVERS: "$HOME_NET"
4c6d6c1e
SS
22 TELNET_SERVERS: "$HOME_NET"
23 AIM_SERVERS: "$EXTERNAL_NET"
2bec60c3 24 DC_SERVERS: "$HOME_NET"
4c6d6c1e
SS
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:
e698090e
SS
33 # Incluse HTTP_PORTS declaration from external file.
34 include: /var/ipfire/suricata/suricata-http-ports.yaml
35
4c6d6c1e
SS
36 SHELLCODE_PORTS: "!80"
37 ORACLE_PORTS: 1521
067e1847 38 SSH_PORTS: "[22,222]"
4c6d6c1e
SS
39 DNP3_PORTS: 20000
40 MODBUS_PORTS: 502
41 FILE_DATA_PORTS: "[$HTTP_PORTS,110,143]"
42 FTP_PORTS: 21
43
4c6d6c1e 44##
335114b2 45## Ruleset specific options.
4c6d6c1e 46##
21cab141 47default-rule-path: /var/lib/suricata
cc60d3df 48rule-files:
335114b2 49 # Include enabled ruleset files from external file.
cc60d3df 50 include: /var/ipfire/suricata/suricata-used-rulefiles.yaml
4c6d6c1e 51
21cab141
SS
52classification-file: /var/lib/suricata/classification.config
53reference-config-file: /var/lib/suricata/reference.config
fd72c85e 54threshold-file: /var/lib/suricata/threshold.config
4c6d6c1e
SS
55
56
57##
335114b2 58## Logging options.
4c6d6c1e 59##
4c6d6c1e
SS
60default-log-dir: /var/log/suricata/
61
62# global stats configuration
63stats:
64 enabled: yes
65 # The interval field (in seconds) controls at what interval
66 # the loggers are invoked.
67 interval: 8
68
2bec60c3
SS
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
4c6d6c1e
SS
77# Configure the type of alert (and other) logging you would like.
78outputs:
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
4c6d6c1e
SS
86 # Stats.log contains data from various counters of the suricata engine.
87 - stats:
6e7c8a33 88 enabled: no
4c6d6c1e 89 filename: stats.log
335114b2 90 append: no # append to file (yes) or overwrite it (no)
4c6d6c1e
SS
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
6084e66e
SS
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 - krb5
280 - snmp
281 #- sip
282 - dhcp:
283 enabled: yes
284 # When extended mode is on, all DHCP messages are logged
285 # with full detail. When extended mode is off (the
286 # default), just enough information to map a MAC address
287 # to an IP address is logged.
288 extended: no
289 - ssh
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
4c6d6c1e
SS
304logging:
305 # The default log level, can be overridden in an output section.
306 # Note that debug level logging will only be emitted if Suricata was
307 # compiled with the --enable-debug configure option.
308 #
309 # This value is overriden by the SC_LOG_LEVEL env var.
310 default-log-level: notice
311
4c6d6c1e
SS
312 # A regex to filter output. Can be overridden in an output section.
313 # Defaults to empty (no filter).
314 #
315 # This value is overriden by the SC_LOG_OP_FILTER env var.
316 default-output-filter:
317
318 # Define your logging outputs. If none are defined, or they are all
319 # disabled you will get the default - console output.
320 outputs:
321 - console:
335114b2 322 enabled: no
4c6d6c1e
SS
323 # type: json
324 - file:
335114b2 325 enabled: no
4c6d6c1e
SS
326 level: info
327 filename: /var/log/suricata/suricata.log
328 # type: json
329 - syslog:
335114b2 330 enabled: yes
4c6d6c1e 331 facility: local5
ab1444b4 332 format: ""
4c6d6c1e
SS
333 # type: json
334
4c6d6c1e 335##
335114b2 336## Netfilter configuration
4c6d6c1e 337##
4c6d6c1e 338
335114b2
SS
339nfq:
340 mode: repeat
5d04cfe7
MT
341 repeat-mark: 1879048192
342 repeat-mask: 1879048192
f5ad510e
SS
343# bypass-mark: 1
344# bypass-mask: 1
335114b2
SS
345# route-queue: 2
346# batchcount: 20
347 fail-open: yes
4c6d6c1e
SS
348
349##
350## Step 5: App Layer Protocol Configuration
351##
352
353# Configure the app-layer parsers. The protocols section details each
354# protocol.
355#
356# The option "enabled" takes 3 values - "yes", "no", "detection-only".
357# "yes" enables both detection and the parser, "no" disables both, and
358# "detection-only" enables protocol detection only (parser disabled).
359app-layer:
360 protocols:
2bec60c3 361 krb5:
d6cc8710
SS
362 enabled: yes
363 snmp:
364 enabled: yes
2bec60c3
SS
365 ikev2:
366 enabled: yes
4c6d6c1e
SS
367 tls:
368 enabled: yes
369 detection-ports:
96495c9a 370 dp: "[443,444,465,853,993,995]"
4c6d6c1e 371
d6cc8710
SS
372 # Generate JA3 fingerprint from client hello. If not specified it
373 # will be disabled by default, but enabled if rules require it.
374 #ja3-fingerprints: auto
375 # Generate JA3 fingerprint from client hello
376 ja3-fingerprints: no
377
4c6d6c1e
SS
378 # Completely stop processing TLS/SSL session after the handshake
379 # completed. If bypass is enabled this will also trigger flow
380 # bypass. If disabled (the default), TLS/SSL session is still
381 # tracked for Heartbleed and other anomalies.
382 #no-reassemble: yes
383 dcerpc:
384 enabled: yes
385 ftp:
386 enabled: yes
d6cc8710 387 rdp:
2acc41c0 388 enabled: yes
4c6d6c1e
SS
389 ssh:
390 enabled: yes
391 smtp:
392 enabled: yes
393 # Configure SMTP-MIME Decoder
394 mime:
395 # Decode MIME messages from SMTP transactions
396 # (may be resource intensive)
397 # This field supercedes all others because it turns the entire
398 # process on or off
399 decode-mime: yes
400
401 # Decode MIME entity bodies (ie. base64, quoted-printable, etc.)
402 decode-base64: yes
403 decode-quoted-printable: yes
404
405 # Maximum bytes per header data value stored in the data structure
406 # (default is 2000)
407 header-value-depth: 2000
408
409 # Extract URLs and save in state data structure
410 extract-urls: yes
411 # Set to yes to compute the md5 of the mail body. You will then
412 # be able to journalize it.
413 body-md5: no
414 # Configure inspected-tracker for file_data keyword
415 inspected-tracker:
416 content-limit: 100000
417 content-inspect-min-size: 32768
418 content-inspect-window: 4096
419 imap:
8723bb91 420 enabled: yes
4c6d6c1e 421 msn:
8723bb91 422 enabled: yes
4c6d6c1e
SS
423 smb:
424 enabled: yes
425 detection-ports:
426 dp: 139, 445
d6cc8710
SS
427 nfs:
428 enabled: yes
429 tftp:
430 enabled: yes
4c6d6c1e
SS
431 dns:
432 # memcaps. Globally and per flow/state.
cf976e93
MT
433 global-memcap: 32mb
434 state-memcap: 512kb
4c6d6c1e
SS
435
436 # How many unreplied DNS requests are considered a flood.
437 # If the limit is reached, app-layer-event:dns.flooded; will match.
2f8a33e1 438 request-flood: 2048
4c6d6c1e
SS
439
440 tcp:
441 enabled: yes
442 detection-ports:
96495c9a 443 dp: 53
4c6d6c1e
SS
444 udp:
445 enabled: yes
446 detection-ports:
96495c9a 447 dp: 53
4c6d6c1e
SS
448 http:
449 enabled: yes
8efbd71c 450 memcap: 256mb
4c6d6c1e
SS
451
452 # default-config: Used when no server-config matches
453 # personality: List of personalities used by default
454 # request-body-limit: Limit reassembly of request body for inspection
455 # by http_client_body & pcre /P option.
456 # response-body-limit: Limit reassembly of response body for inspection
457 # by file_data, http_server_body & pcre /Q option.
458 # double-decode-path: Double decode path section of the URI
459 # double-decode-query: Double decode query section of the URI
460 # response-body-decompress-layer-limit:
461 # Limit to how many layers of compression will be
462 # decompressed. Defaults to 2.
463 #
4c6d6c1e
SS
464 # Currently Available Personalities:
465 # Minimal, Generic, IDS (default), IIS_4_0, IIS_5_0, IIS_5_1, IIS_6_0,
466 # IIS_7_0, IIS_7_5, Apache_2
467 libhtp:
468 default-config:
469 personality: IDS
470
471 # Can be specified in kb, mb, gb. Just a number indicates
472 # it's in bytes.
8efbd71c
MT
473 request-body-limit: 0
474 response-body-limit: 0
4c6d6c1e
SS
475
476 # response body decompression (0 disables)
477 response-body-decompress-layer-limit: 2
478
479 # auto will use http-body-inline mode in IPS mode, yes or no set it statically
480 http-body-inline: auto
481
482 # Take a random value for inspection sizes around the specified value.
483 # This lower the risk of some evasion technics but could lead
484 # detection change between runs. It is set to 'yes' by default.
8efbd71c 485 randomize-inspection-sizes: yes
4c6d6c1e
SS
486 # If randomize-inspection-sizes is active, the value of various
487 # inspection size will be choosen in the [1 - range%, 1 + range%]
488 # range
489 # Default value of randomize-inspection-range is 10.
8efbd71c 490 randomize-inspection-range: 10
4c6d6c1e
SS
491
492 # decoding
493 double-decode-path: no
494 double-decode-query: no
495
d6cc8710
SS
496 ntp:
497 enabled: yes
498 dhcp:
499 enabled: yes
500 sip:
501 enabled: yes
4c6d6c1e 502
4c6d6c1e
SS
503# Limit for the maximum number of asn1 frames to decode (default 256)
504asn1-max-frames: 256
505
506
507##############################################################################
508##
509## Advanced settings below
510##
511##############################################################################
512
38081b8b
MT
513##
514## Run Options
515##
516
517# Run suricata as user and group.
518run-as:
519 user: suricata
520 group: suricata
521
4c6d6c1e
SS
522# Suricata core dump configuration. Limits the size of the core dump file to
523# approximately max-dump. The actual core dump size will be a multiple of the
524# page size. Core dumps that would be larger than max-dump are truncated. On
525# Linux, the actual core dump size may be a few pages larger than max-dump.
526# Setting max-dump to 0 disables core dumping.
527# Setting max-dump to 'unlimited' will give the full core dump file.
528# On 32-bit Linux, a max-dump value >= ULONG_MAX may cause the core dump size
529# to be 'unlimited'.
530
531coredump:
532 max-dump: unlimited
533
534# If suricata box is a router for the sniffed networks, set it to 'router'. If
535# it is a pure sniffing setup, set it to 'sniffer-only'.
536# If set to auto, the variable is internally switch to 'router' in IPS mode
537# and 'sniffer-only' in IDS mode.
538# This feature is currently only used by the reject* keywords.
539host-mode: auto
540
541# Number of packets preallocated per thread. The default is 1024. A higher number
542# will make sure each CPU will be more easily kept busy, but may negatively
543# impact caching.
16446608 544max-pending-packets: 1024
4c6d6c1e
SS
545
546# Runmode the engine should use. Please check --list-runmodes to get the available
547# runmodes for each packet acquisition method. Defaults to "autofp" (auto flow pinned
548# load balancing).
64aed99d 549runmode: workers
4c6d6c1e
SS
550
551# Specifies the kind of flow load balancer used by the flow pinned autofp mode.
552#
553# Supported schedulers are:
554#
555# round-robin - Flows assigned to threads in a round robin fashion.
556# active-packets - Flows assigned to threads that have the lowest number of
557# unprocessed packets (default).
558# hash - Flow alloted usihng the address hash. More of a random
559# technique. Was the default in Suricata 1.2.1 and older.
560#
561#autofp-scheduler: active-packets
562
563# Preallocated size for packet. Default is 1514 which is the classical
564# size for pcap on ethernet. You should adjust this value to the highest
565# packet size (MTU + hardware header) on your system.
9f726f8f 566default-packet-size: 1514
4c6d6c1e
SS
567
568# Unix command socket can be used to pass commands to suricata.
569# An external tool can then connect to get information from suricata
570# or trigger some modifications of the engine. Set enabled to yes
571# to activate the feature. In auto mode, the feature will only be
572# activated in live capture mode. You can use the filename variable to set
573# the file name of the socket.
574unix-command:
335114b2 575 enabled: no
4c6d6c1e
SS
576 #filename: custom.socket
577
83b576c8
MT
578# Magic file
579magic-file: /usr/share/misc/magic.mgc
4c6d6c1e
SS
580
581legacy:
582 uricontent: enabled
583
584##
585## Detection settings
586##
587
588# Set the order of alerts bassed on actions
589# The default order is pass, drop, reject, alert
590# action-order:
591# - pass
592# - drop
593# - reject
594# - alert
595
4c6d6c1e
SS
596# When run with the option --engine-analysis, the engine will read each of
597# the parameters below, and print reports for each of the enabled sections
598# and exit. The reports are printed to a file in the default log dir
599# given by the parameter "default-log-dir", with engine reporting
600# subsection below printing reports in its own report file.
601engine-analysis:
602 # enables printing reports for fast-pattern for every rule.
603 rules-fast-pattern: yes
604 # enables printing reports for each rule
605 rules: yes
606
607#recursion and match limits for PCRE where supported
608pcre:
609 match-limit: 3500
610 match-limit-recursion: 1500
611
612##
613## Advanced Traffic Tracking and Reconstruction Settings
614##
615
616# Host specific policies for defragmentation and TCP stream
617# reassembly. The host OS lookup is done using a radix tree, just
618# like a routing table so the most specific entry matches.
619host-os-policy:
620 # Make the default policy windows.
621 windows: [0.0.0.0/0]
622 bsd: []
623 bsd-right: []
624 old-linux: []
625 linux: []
626 old-solaris: []
627 solaris: []
628 hpux10: []
629 hpux11: []
630 irix: []
631 macos: []
632 vista: []
633 windows2k3: []
634
635# Defrag settings:
636
637defrag:
7eed864c 638 memcap: 64mb
4c6d6c1e
SS
639 hash-size: 65536
640 trackers: 65535 # number of defragmented flows to follow
641 max-frags: 65535 # number of fragments to keep (higher than trackers)
642 prealloc: yes
643 timeout: 60
644
4c6d6c1e
SS
645# Flow settings:
646# By default, the reserved memory (memcap) for flows is 32MB. This is the limit
647# for flow allocation inside the engine. You can change this value to allow
648# more memory usage for flows.
649# The hash-size determine the size of the hash used to identify flows inside
650# the engine, and by default the value is 65536.
651# At the startup, the engine can preallocate a number of flows, to get a better
652# performance. The number of flows preallocated is 10000 by default.
653# emergency-recovery is the percentage of flows that the engine need to
654# prune before unsetting the emergency state. The emergency state is activated
655# when the memcap limit is reached, allowing to create new flows, but
656# prunning them with the emergency timeouts (they are defined below).
657# If the memcap is reached, the engine will try to prune flows
658# with the default timeouts. If it doens't find a flow to prune, it will set
659# the emergency bit and it will try again with more agressive timeouts.
660# If that doesn't work, then it will try to kill the last time seen flows
661# not in use.
662# The memcap can be specified in kb, mb, gb. Just a number indicates it's
663# in bytes.
664
665flow:
47cb0571 666 memcap: 256mb
4c6d6c1e
SS
667 hash-size: 65536
668 prealloc: 10000
669 emergency-recovery: 30
47cb0571
MT
670 managers: 1
671 recyclers: 1
4c6d6c1e
SS
672
673# This option controls the use of vlan ids in the flow (and defrag)
674# hashing. Normally this should be enabled, but in some (broken)
675# setups where both sides of a flow are not tagged with the same vlan
676# tag, we can ignore the vlan id's in the flow hashing.
677vlan:
678 use-for-tracking: true
679
680# Specific timeouts for flows. Here you can specify the timeouts that the
681# active flows will wait to transit from the current state to another, on each
682# protocol. The value of "new" determine the seconds to wait after a hanshake or
683# stream startup before the engine free the data of that flow it doesn't
684# change the state to established (usually if we don't receive more packets
685# of that flow). The value of "established" is the amount of
686# seconds that the engine will wait to free the flow if it spend that amount
687# without receiving new packets or closing the connection. "closed" is the
688# amount of time to wait after a flow is closed (usually zero). "bypassed"
689# timeout controls locally bypassed flows. For these flows we don't do any other
690# tracking. If no packets have been seen after this timeout, the flow is discarded.
691#
692# There's an emergency mode that will become active under attack circumstances,
693# making the engine to check flow status faster. This configuration variables
694# use the prefix "emergency-" and work similar as the normal ones.
695# Some timeouts doesn't apply to all the protocols, like "closed", for udp and
696# icmp.
697
698flow-timeouts:
699
700 default:
701 new: 30
702 established: 300
703 closed: 0
704 bypassed: 100
705 emergency-new: 10
706 emergency-established: 100
707 emergency-closed: 0
708 emergency-bypassed: 50
709 tcp:
710 new: 60
711 established: 600
712 closed: 60
713 bypassed: 100
714 emergency-new: 5
715 emergency-established: 100
716 emergency-closed: 10
717 emergency-bypassed: 50
718 udp:
719 new: 30
720 established: 300
721 bypassed: 100
722 emergency-new: 10
723 emergency-established: 100
724 emergency-bypassed: 50
725 icmp:
726 new: 30
727 established: 300
728 bypassed: 100
729 emergency-new: 10
730 emergency-established: 100
731 emergency-bypassed: 50
732
733# Stream engine settings. Here the TCP stream tracking and reassembly
734# engine is configured.
735#
736# stream:
737# memcap: 32mb # Can be specified in kb, mb, gb. Just a
738# # number indicates it's in bytes.
739# checksum-validation: yes # To validate the checksum of received
740# # packet. If csum validation is specified as
741# # "yes", then packet with invalid csum will not
742# # be processed by the engine stream/app layer.
743# # Warning: locally generated trafic can be
744# # generated without checksum due to hardware offload
745# # of checksum. You can control the handling of checksum
746# # on a per-interface basis via the 'checksum-checks'
747# # option
748# prealloc-sessions: 2k # 2k sessions prealloc'd per stream thread
749# midstream: false # don't allow midstream session pickups
750# async-oneside: false # don't enable async stream handling
751# inline: no # stream inline mode
752# drop-invalid: yes # in inline mode, drop packets that are invalid with regards to streaming engine
753# max-synack-queued: 5 # Max different SYN/ACKs to queue
754# bypass: no # Bypass packets when stream.depth is reached
755#
756# reassembly:
757# memcap: 64mb # Can be specified in kb, mb, gb. Just a number
758# # indicates it's in bytes.
759# depth: 1mb # Can be specified in kb, mb, gb. Just a number
760# # indicates it's in bytes.
761# toserver-chunk-size: 2560 # inspect raw stream in chunks of at least
762# # this size. Can be specified in kb, mb,
763# # gb. Just a number indicates it's in bytes.
764# toclient-chunk-size: 2560 # inspect raw stream in chunks of at least
765# # this size. Can be specified in kb, mb,
766# # gb. Just a number indicates it's in bytes.
767# randomize-chunk-size: yes # Take a random value for chunk size around the specified value.
768# # This lower the risk of some evasion technics but could lead
769# # detection change between runs. It is set to 'yes' by default.
770# randomize-chunk-range: 10 # If randomize-chunk-size is active, the value of chunk-size is
771# # a random value between (1 - randomize-chunk-range/100)*toserver-chunk-size
772# # and (1 + randomize-chunk-range/100)*toserver-chunk-size and the same
773# # calculation for toclient-chunk-size.
774# # Default value of randomize-chunk-range is 10.
775#
776# raw: yes # 'Raw' reassembly enabled or disabled.
777# # raw is for content inspection by detection
778# # engine.
779#
780# segment-prealloc: 2048 # number of segments preallocated per thread
781#
782# check-overlap-different-data: true|false
783# # check if a segment contains different data
784# # than what we've already seen for that
785# # position in the stream.
786# # This is enabled automatically if inline mode
787# # is used or when stream-event:reassembly_overlap_different_data;
788# # is used in a rule.
789#
790stream:
0b340f09 791 memcap: 256mb
c9ee3592 792 prealloc-sessions: 4096
4c6d6c1e
SS
793 checksum-validation: yes # reject wrong csums
794 inline: auto # auto will use inline mode in IPS mode, yes or no set it statically
795 reassembly:
796 memcap: 256mb
797 depth: 1mb # reassemble 1mb into a stream
798 toserver-chunk-size: 2560
799 toclient-chunk-size: 2560
800 randomize-chunk-size: yes
0b340f09
MT
801 raw: yes
802 segment-prealloc: 2048
803 check-overlap-different-data: true
4c6d6c1e
SS
804
805# Host table:
806#
807# Host table is used by tagging and per host thresholding subsystems.
808#
809host:
810 hash-size: 4096
811 prealloc: 1000
812 memcap: 32mb
813
814# IP Pair table:
815#
816# Used by xbits 'ippair' tracking.
817#
818#ippair:
819# hash-size: 4096
820# prealloc: 1000
821# memcap: 32mb
822
823# Decoder settings
824
825decoder:
826 # Teredo decoder is known to not be completely accurate
827 # it will sometimes detect non-teredo as teredo.
828 teredo:
890f1bf2 829 enabled: false
4c6d6c1e
SS
830
831
832##
833## Performance tuning and profiling
834##
835
836# The detection engine builds internal groups of signatures. The engine
837# allow us to specify the profile to use for them, to manage memory on an
838# efficient way keeping a good performance. For the profile keyword you
839# can use the words "low", "medium", "high" or "custom". If you use custom
840# make sure to define the values at "- custom-values" as your convenience.
841# Usually you would prefer medium/high/low.
842#
843# "sgh mpm-context", indicates how the staging should allot mpm contexts for
844# the signature groups. "single" indicates the use of a single context for
845# all the signature group heads. "full" indicates a mpm-context for each
846# group head. "auto" lets the engine decide the distribution of contexts
847# based on the information the engine gathers on the patterns from each
848# group head.
849#
850# The option inspection-recursion-limit is used to limit the recursive calls
851# in the content inspection code. For certain payload-sig combinations, we
852# might end up taking too much time in the content inspection code.
853# If the argument specified is 0, the engine uses an internally defined
854# default limit. On not specifying a value, we use no limits on the recursion.
855detect:
dccbdf5b 856 profile: custom
4c6d6c1e 857 custom-values:
dccbdf5b
MT
858 toclient-groups: 200
859 toserver-groups: 200
4c6d6c1e
SS
860 sgh-mpm-context: auto
861 inspection-recursion-limit: 3000
99d75ac7 862
4c6d6c1e
SS
863 # If set to yes, the loading of signatures will be made after the capture
864 # is started. This will limit the downtime in IPS mode.
99d75ac7 865 delayed-detect: yes
4c6d6c1e
SS
866
867 prefilter:
868 # default prefiltering setting. "mpm" only creates MPM/fast_pattern
869 # engines. "auto" also sets up prefilter engines for other keywords.
870 # Use --list-keywords=all to see which keywords support prefiltering.
871 default: mpm
872
873 # the grouping values above control how many groups are created per
874 # direction. Port whitelisting forces that port to get it's own group.
875 # Very common ports will benefit, as well as ports with many expensive
876 # rules.
877 grouping:
878 #tcp-whitelist: 53, 80, 139, 443, 445, 1433, 3306, 3389, 6666, 6667, 8080
879 #udp-whitelist: 53, 135, 5060
880
881 profiling:
882 # Log the rules that made it past the prefilter stage, per packet
883 # default is off. The threshold setting determines how many rules
884 # must have made it past pre-filter for that rule to trigger the
885 # logging.
886 #inspect-logging-threshold: 200
887 grouping:
888 dump-to-disk: false
889 include-rules: false # very verbose
890 include-mpm-stats: false
891
892# Select the multi pattern algorithm you want to run for scan/search the
893# in the engine.
894#
895# The supported algorithms are:
896# "ac" - Aho-Corasick, default implementation
897# "ac-bs" - Aho-Corasick, reduced memory implementation
898# "ac-cuda" - Aho-Corasick, CUDA implementation
899# "ac-ks" - Aho-Corasick, "Ken Steele" variant
900# "hs" - Hyperscan, available when built with Hyperscan support
901#
902# The default mpm-algo value of "auto" will use "hs" if Hyperscan is
903# available, "ac" otherwise.
904#
905# The mpm you choose also decides the distribution of mpm contexts for
906# signature groups, specified by the conf - "detect.sgh-mpm-context".
907# Selecting "ac" as the mpm would require "detect.sgh-mpm-context"
908# to be set to "single", because of ac's memory requirements, unless the
909# ruleset is small enough to fit in one's memory, in which case one can
910# use "full" with "ac". Rest of the mpms can be run in "full" mode.
911#
912# There is also a CUDA pattern matcher (only available if Suricata was
913# compiled with --enable-cuda: b2g_cuda. Make sure to update your
914# max-pending-packets setting above as well if you use b2g_cuda.
915
916mpm-algo: auto
917
918# Select the matching algorithm you want to use for single-pattern searches.
919#
920# Supported algorithms are "bm" (Boyer-Moore) and "hs" (Hyperscan, only
921# available if Suricata has been built with Hyperscan support).
922#
923# The default of "auto" will use "hs" if available, otherwise "bm".
924
925spm-algo: auto
926
927# Suricata is multi-threaded. Here the threading can be influenced.
928threading:
f903d3a6 929 set-cpu-affinity: no
4c6d6c1e
SS
930 # Tune cpu affinity of threads. Each family of threads can be bound
931 # on specific CPUs.
932 #
933 # These 2 apply to the all runmodes:
934 # management-cpu-set is used for flow timeout handling, counters
935 # worker-cpu-set is used for 'worker' threads
936 #
937 # Additionally, for autofp these apply:
938 # receive-cpu-set is used for capture threads
939 # verdict-cpu-set is used for IPS verdict threads
940 #
941 cpu-affinity:
942 - management-cpu-set:
943 cpu: [ 0 ] # include only these cpus in affinity settings
944 - receive-cpu-set:
945 cpu: [ 0 ] # include only these cpus in affinity settings
946 - worker-cpu-set:
947 cpu: [ "all" ]
948 mode: "exclusive"
4c6d6c1e
SS
949 prio:
950 low: [ 0 ]
951 medium: [ "1-2" ]
952 high: [ 3 ]
953 default: "medium"
35cdc506
MT
954 - verdict-cpu-set:
955 cpu: [ 0 ]
956 prio:
957 default: "high"
4c6d6c1e
SS
958 #
959 # By default Suricata creates one "detect" thread per available CPU/CPU core.
960 # This setting allows controlling this behaviour. A ratio setting of 2 will
961 # create 2 detect threads for each CPU/CPU core. So for a dual core CPU this
962 # will result in 4 detect threads. If values below 1 are used, less threads
963 # are created. So on a dual core CPU a setting of 0.5 results in 1 detect
964 # thread being created. Regardless of the setting at a minimum 1 detect
965 # thread will always be created.
966 #
967 detect-thread-ratio: 1.0