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