]> git.ipfire.org Git - ipfire-2.x.git/blob - config/suricata/suricata.yaml
suricata: Set midstream-policy to pass-packet
[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 GENEVE_PORTS: 6081
44 VXLAN_PORTS: 4789
45 TEREDO_PORTS: 3544
46
47 ##
48 ## Ruleset specific options.
49 ##
50 default-rule-path: /var/lib/suricata
51 rule-files:
52 # Include enabled ruleset files from external file.
53 include: /var/ipfire/suricata/suricata-used-rulesfiles.yaml
54
55 classification-file: /usr/share/suricata/classification.config
56 reference-config-file: /usr/share/suricata/reference.config
57 threshold-file: /usr/share/suricata/threshold.config
58
59 ##
60 ## Logging options.
61 ##
62 default-log-dir: /var/log/suricata/
63
64 # Global stats configuration
65 stats:
66 enabled: no
67 # The interval field (in seconds) controls the interval at
68 # which stats are updated in the log.
69 interval: 8
70 # Add decode events to stats.
71 #decoder-events: true
72 # Decoder event prefix in stats. Has been 'decoder' before, but that leads
73 # to missing events in the eve.stats records. See issue #2225.
74 #decoder-events-prefix: "decoder.event"
75 # Add stream events as stats.
76 #stream-events: false
77
78 # Plugins -- Experimental -- specify the filename for each plugin shared object
79 plugins:
80 # - /path/to/plugin.so
81
82 # Configure the type of alert (and other) logging you would like.
83 outputs:
84 # a line based alerts log similar to Snort's fast.log
85 - fast:
86 enabled: yes
87 filename: fast.log
88 append: yes
89 #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
90
91 # Stats.log contains data from various counters of the suricata engine.
92 - stats:
93 enabled: no
94 filename: stats.log
95 append: no # append to file (yes) or overwrite it (no)
96 totals: yes # stats for all threads merged together
97 threads: no # per thread stats
98 #null-values: yes # print counters that have value 0
99
100 # Extensible Event Format (nicknamed EVE) event log in JSON format
101 - eve-log:
102 enabled: no
103 filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
104 filename: eve.json
105 # Enable for multi-threaded eve.json output; output files are amended with
106 # an identifier, e.g., eve.9.json
107 #threaded: false
108 #prefix: "@cee: " # prefix to prepend to each log entry
109 # the following are valid when type: syslog above
110 #identity: "suricata"
111 #facility: local5
112 #level: Info ## possible levels: Emergency, Alert, Critical,
113 ## Error, Warning, Notice, Info, Debug
114 #ethernet: no # log ethernet header in events when available
115 #redis:
116 # server: 127.0.0.1
117 # port: 6379
118 # async: true ## if redis replies are read asynchronously
119 # mode: list ## possible values: list|lpush (default), rpush, channel|publish
120 # ## lpush and rpush are using a Redis list. "list" is an alias for lpush
121 # ## publish is using a Redis channel. "channel" is an alias for publish
122 # key: suricata ## key or channel to use (default to suricata)
123 # Redis pipelining set up. This will enable to only do a query every
124 # 'batch-size' events. This should lower the latency induced by network
125 # connection at the cost of some memory. There is no flushing implemented
126 # so this setting should be reserved to high traffic Suricata deployments.
127 # pipelining:
128 # enabled: yes ## set enable to yes to enable query pipelining
129 # batch-size: 10 ## number of entries to keep in buffer
130
131 # Include top level metadata. Default yes.
132 #metadata: no
133
134 # include the name of the input pcap file in pcap file processing mode
135 pcap-file: false
136
137 # Community Flow ID
138 # Adds a 'community_id' field to EVE records. These are meant to give
139 # records a predictable flow ID that can be used to match records to
140 # output of other tools such as Zeek (Bro).
141 #
142 # Takes a 'seed' that needs to be same across sensors and tools
143 # to make the id less predictable.
144
145 # enable/disable the community id feature.
146 community-id: false
147 # Seed value for the ID output. Valid values are 0-65535.
148 community-id-seed: 0
149
150 # HTTP X-Forwarded-For support by adding an extra field or overwriting
151 # the source or destination IP address (depending on flow direction)
152 # with the one reported in the X-Forwarded-For HTTP header. This is
153 # helpful when reviewing alerts for traffic that is being reverse
154 # or forward proxied.
155 xff:
156 enabled: no
157 # Two operation modes are available: "extra-data" and "overwrite".
158 mode: extra-data
159 # Two proxy deployments are supported: "reverse" and "forward". In
160 # a "reverse" deployment the IP address used is the last one, in a
161 # "forward" deployment the first IP address is used.
162 deployment: reverse
163 # Header name where the actual IP address will be reported. If more
164 # than one IP address is present, the last IP address will be the
165 # one taken into consideration.
166 header: X-Forwarded-For
167
168 types:
169 - alert:
170 # payload: yes # enable dumping payload in Base64
171 # payload-buffer-size: 4kb # max size of payload buffer to output in eve-log
172 # payload-printable: yes # enable dumping payload in printable (lossy) format
173 # packet: yes # enable dumping of packet (without stream segments)
174 # metadata: no # enable inclusion of app layer metadata with alert. Default yes
175 # http-body: yes # Requires metadata; enable dumping of HTTP body in Base64
176 # http-body-printable: yes # Requires metadata; enable dumping of HTTP body in printable format
177
178 # Enable the logging of tagged packets for rules using the
179 # "tag" keyword.
180 tagged-packets: yes
181 # Enable logging the final action taken on a packet by the engine
182 # (e.g: the alert may have action 'allowed' but the verdict be
183 # 'drop' due to another alert. That's the engine's verdict)
184 # verdict: yes
185 # app layer frames
186 - frame:
187 # disabled by default as this is very verbose.
188 enabled: no
189 - anomaly:
190 # Anomaly log records describe unexpected conditions such
191 # as truncated packets, packets with invalid IP/UDP/TCP
192 # length values, and other events that render the packet
193 # invalid for further processing or describe unexpected
194 # behavior on an established stream. Networks which
195 # experience high occurrences of anomalies may experience
196 # packet processing degradation.
197 #
198 # Anomalies are reported for the following:
199 # 1. Decode: Values and conditions that are detected while
200 # decoding individual packets. This includes invalid or
201 # unexpected values for low-level protocol lengths as well
202 # as stream related events (TCP 3-way handshake issues,
203 # unexpected sequence number, etc).
204 # 2. Stream: This includes stream related events (TCP
205 # 3-way handshake issues, unexpected sequence number,
206 # etc).
207 # 3. Application layer: These denote application layer
208 # specific conditions that are unexpected, invalid or are
209 # unexpected given the application monitoring state.
210 #
211 # By default, anomaly logging is enabled. When anomaly
212 # logging is enabled, applayer anomaly reporting is
213 # also enabled.
214 enabled: yes
215 #
216 # Choose one or more types of anomaly logging and whether to enable
217 # logging of the packet header for packet anomalies.
218 types:
219 # decode: no
220 # stream: no
221 # applayer: yes
222 #packethdr: no
223 - http:
224 extended: yes # enable this for extended logging information
225 # custom allows additional HTTP fields to be included in eve-log.
226 # the example below adds three additional fields when uncommented
227 #custom: [Accept-Encoding, Accept-Language, Authorization]
228 # set this value to one and only one from {both, request, response}
229 # to dump all HTTP headers for every HTTP request and/or response
230 # dump-all-headers: none
231 - dns:
232 # This configuration uses the new DNS logging format,
233 # the old configuration is still available:
234 # https://docs.suricata.io/en/latest/output/eve/eve-json-output.html#dns-v1-format
235
236 # As of Suricata 5.0, version 2 of the eve dns output
237 # format is the default.
238 #version: 2
239
240 # Enable/disable this logger. Default: enabled.
241 #enabled: yes
242
243 # Control logging of requests and responses:
244 # - requests: enable logging of DNS queries
245 # - responses: enable logging of DNS answers
246 # By default both requests and responses are logged.
247 #requests: no
248 #responses: no
249
250 # Format of answer logging:
251 # - detailed: array item per answer
252 # - grouped: answers aggregated by type
253 # Default: all
254 #formats: [detailed, grouped]
255
256 # DNS record types to log, based on the query type.
257 # Default: all.
258 #types: [a, aaaa, cname, mx, ns, ptr, txt]
259 - tls:
260 extended: yes # enable this for extended logging information
261 # output TLS transaction where the session is resumed using a
262 # session id
263 #session-resumption: no
264 # custom controls which TLS fields that are included in eve-log
265 #custom: [subject, issuer, session_resumed, serial, fingerprint, sni, version, not_before, not_after, certificate, chain, ja3, ja3s]
266 - files:
267 force-magic: no # force logging magic on all logged files
268 # force logging of checksums, available hash functions are md5,
269 # sha1 and sha256
270 #force-hash: [md5]
271 #- drop:
272 # alerts: yes # log alerts that caused drops
273 # flows: all # start or all: 'start' logs only a single drop
274 # # per flow direction. All logs each dropped pkt.
275 # Enable logging the final action taken on a packet by the engine
276 # (will show more information in case of a drop caused by 'reject')
277 # verdict: yes
278 - smtp:
279 #extended: yes # enable this for extended logging information
280 # this includes: bcc, message-id, subject, x_mailer, user-agent
281 # custom fields logging from the list:
282 # reply-to, bcc, message-id, subject, x-mailer, user-agent, received,
283 # x-originating-ip, in-reply-to, references, importance, priority,
284 # sensitivity, organization, content-md5, date
285 #custom: [received, x-mailer, x-originating-ip, relays, reply-to, bcc]
286 # output md5 of fields: body, subject
287 # for the body you need to set app-layer.protocols.smtp.mime.body-md5
288 # to yes
289 #md5: [body, subject]
290
291 #- dnp3
292 - ftp
293 - rdp
294 - nfs
295 - smb
296 - tftp
297 - ike
298 - dcerpc
299 - krb5
300 - bittorrent-dht
301 - snmp
302 - rfb
303 - sip
304 - quic
305 - dhcp:
306 enabled: yes
307 # When extended mode is on, all DHCP messages are logged
308 # with full detail. When extended mode is off (the
309 # default), just enough information to map a MAC address
310 # to an IP address is logged.
311 extended: no
312 - ssh
313 - mqtt:
314 # passwords: yes # enable output of passwords
315 - http2
316 - pgsql:
317 enabled: no
318 # passwords: yes # enable output of passwords. Disabled by default
319 - stats:
320 totals: yes # stats for all threads merged together
321 threads: no # per thread stats
322 deltas: no # include delta values
323 # bi-directional flows
324 - flow
325 # uni-directional flows
326 #- netflow
327
328 # Metadata event type. Triggered whenever a pktvar is saved
329 # and will include the pktvars, flowvars, flowbits and
330 # flowints.
331 #- metadata
332
333 # EXPERIMENTAL per packet output giving TCP state tracking details
334 # including internal state, flags, etc.
335 # This output is experimental, meant for debugging and subject to
336 # change in both config and output without any notice.
337 #- stream:
338 # all: false # log all TCP packets
339 # event-set: false # log packets that have a decoder/stream event
340 # state-update: false # log packets triggering a TCP state update
341 # spurious-retransmission: false # log spurious retransmission packets
342
343 logging:
344 # The default log level: can be overridden in an output section.
345 # Note that debug level logging will only be emitted if Suricata was
346 # compiled with the --enable-debug configure option.
347 #
348 # This value is overridden by the SC_LOG_LEVEL env var.
349 default-log-level: Info
350
351 # The default output format. Optional parameter, should default to
352 # something reasonable if not provided. Can be overridden in an
353 # output section. You can leave this out to get the default.
354 #
355 # This console log format value can be overridden by the SC_LOG_FORMAT env var.
356 #default-log-format: "%D: %S: %M"
357 #
358 # For the pre-7.0 log format use:
359 #default-log-format: "[%i] %t [%S] - (%f:%l) <%d> (%n) -- "
360
361 # A regex to filter output. Can be overridden in an output section.
362 # Defaults to empty (no filter).
363 #
364 # This value is overridden by the SC_LOG_OP_FILTER env var.
365 default-output-filter:
366
367 # Requires libunwind to be available when Suricata is configured and built.
368 # If a signal unexpectedly terminates Suricata, displays a brief diagnostic
369 # message with the offending stacktrace if enabled.
370 #stacktrace-on-signal: on
371
372 # Define your logging outputs. If none are defined, or they are all
373 # disabled you will get the default: console output.
374 outputs:
375 - console:
376 enabled: no
377 # type: json
378 - file:
379 enabled: no
380 level: info
381 filename: /var/log/suricata/suricata.log
382 # format: "[%i - %m] %z %d: %S: %M"
383 # type: json
384 - syslog:
385 enabled: yes
386 facility: local5
387 format: ""
388 #format: "[%i] <%d> -- "
389 # type: json
390
391 ##
392 ## Netfilter configuration
393 ##
394
395 nfq:
396 mode: repeat
397 repeat-mark: 2147483648
398 repeat-mask: 2147483648
399 bypass-mark: 1073741824
400 bypass-mask: 1073741824
401 # route-queue: 2
402 # batchcount: 20
403 fail-open: no
404
405 ##
406 ## Step 5: App Layer Protocol Configuration
407 ##
408
409 # Configure the app-layer parsers.
410 #
411 # The error-policy setting applies to all app-layer parsers. Values can be
412 # "drop-flow", "pass-flow", "bypass", "drop-packet", "pass-packet", "reject" or
413 # "ignore" (the default).
414 #
415 # The protocol's section details each protocol.
416 #
417 # The option "enabled" takes 3 values - "yes", "no", "detection-only".
418 # "yes" enables both detection and the parser, "no" disables both, and
419 # "detection-only" enables protocol detection only (parser disabled).
420 app-layer:
421 # error-policy: ignore
422 protocols:
423 telnet:
424 enabled: yes
425 rfb:
426 enabled: yes
427 detection-ports:
428 dp: 5900, 5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909
429 mqtt:
430 enabled: yes
431 # max-msg-length: 1mb
432 # subscribe-topic-match-limit: 100
433 # unsubscribe-topic-match-limit: 100
434 # Maximum number of live MQTT transactions per flow
435 # max-tx: 4096
436 krb5:
437 enabled: yes
438 bittorrent-dht:
439 enabled: yes
440 snmp:
441 enabled: yes
442 ike:
443 enabled: yes
444 tls:
445 enabled: yes
446 detection-ports:
447 dp: "[443,444,465,853,993,995]"
448
449 # Generate JA3 fingerprint from client hello. If not specified it
450 # will be disabled by default, but enabled if rules require it.
451 ja3-fingerprints: auto
452
453 # What to do when the encrypted communications start:
454 # - default: keep tracking TLS session, check for protocol anomalies,
455 # inspect tls_* keywords. Disables inspection of unmodified
456 # 'content' signatures.
457 # - bypass: stop processing this flow as much as possible. No further
458 # TLS parsing and inspection. Offload flow bypass to kernel
459 # or hardware if possible.
460 # - full: keep tracking and inspection as normal. Unmodified content
461 # keyword signatures are inspected as well.
462 #
463 # For best performance, select 'bypass'.
464 #
465 encryption-handling: bypass
466
467 pgsql:
468 enabled: no
469 # Stream reassembly size for PostgreSQL. By default, track it completely.
470 stream-depth: 0
471 # Maximum number of live PostgreSQL transactions per flow
472 # max-tx: 1024
473 dcerpc:
474 enabled: yes
475 # Maximum number of live DCERPC transactions per flow
476 # max-tx: 1024
477 ftp:
478 enabled: yes
479 # memcap: 64mb
480 rdp:
481 enabled: yes
482 ssh:
483 enabled: yes
484 #hassh: yes
485 http2:
486 enabled: yes
487 # Maximum number of live HTTP2 streams in a flow
488 #max-streams: 4096
489 # Maximum headers table size
490 #max-table-size: 65536
491 # Maximum reassembly size for header + continuation frames
492 #max-reassembly-size: 102400
493 smtp:
494 enabled: yes
495 raw-extraction: no
496 # Maximum number of live SMTP transactions per flow
497 # max-tx: 256
498 # Configure SMTP-MIME Decoder
499 mime:
500 # Decode MIME messages from SMTP transactions
501 # (may be resource intensive)
502 # This field supersedes all others because it turns the entire
503 # process on or off
504 decode-mime: yes
505
506 # Decode MIME entity bodies (ie. Base64, quoted-printable, etc.)
507 decode-base64: yes
508 decode-quoted-printable: yes
509
510 # Maximum bytes per header data value stored in the data structure
511 # (default is 2000)
512 header-value-depth: 2000
513
514 # Extract URLs and save in state data structure
515 extract-urls: yes
516 # Scheme of URLs to extract
517 # (default is [http])
518 #extract-urls-schemes: [http, https, ftp, mailto]
519 # Log the scheme of URLs that are extracted
520 # (default is no)
521 #log-url-scheme: yes
522 # Set to yes to compute the md5 of the mail body. You will then
523 # be able to journalize it.
524 body-md5: no
525 # Configure inspected-tracker for file_data keyword
526 inspected-tracker:
527 content-limit: 100000
528 content-inspect-min-size: 32768
529 content-inspect-window: 4096
530 imap:
531 enabled: yes
532 smb:
533 enabled: yes
534 detection-ports:
535 dp: 139, 445
536 # Maximum number of live SMB transactions per flow
537 # max-tx: 1024
538
539 # Stream reassembly size for SMB streams. By default track it completely.
540 #stream-depth: 0
541
542 nfs:
543 enabled: yes
544 # max-tx: 1024
545 tftp:
546 enabled: yes
547 dns:
548 # memcaps. Globally and per flow/state.
549 global-memcap: 32mb
550 state-memcap: 512kb
551
552 # How many unreplied DNS requests are considered a flood.
553 # If the limit is reached, app-layer-event:dns.flooded; will match.
554 #request-flood: 512
555
556 tcp:
557 enabled: yes
558 detection-ports:
559 dp: 53
560 udp:
561 enabled: yes
562 detection-ports:
563 dp: 53
564 http:
565 enabled: yes
566 memcap: 256mb
567
568 # Byte Range Containers default settings
569 # byterange:
570 # memcap: 100mb
571 # timeout: 60
572
573 # memcap: Maximum memory capacity for HTTP
574 # Default is unlimited, values can be 64mb, e.g.
575
576 # default-config: Used when no server-config matches
577 # personality: List of personalities used by default
578 # request-body-limit: Limit reassembly of request body for inspection
579 # by http_client_body & pcre /P option.
580 # response-body-limit: Limit reassembly of response body for inspection
581 # by file_data, http_server_body & pcre /Q option.
582 #
583 # For advanced options, see the user guide
584
585
586 # server-config: List of server configurations to use if address matches
587 # address: List of IP addresses or networks for this block
588 # personality: List of personalities used by this block
589 #
590 # Then, all the fields from default-config can be overloaded
591 #
592 # Currently Available Personalities:
593 # Minimal, Generic, IDS (default), IIS_4_0, IIS_5_0, IIS_5_1, IIS_6_0,
594 # IIS_7_0, IIS_7_5, Apache_2
595 libhtp:
596 default-config:
597 personality: IDS
598
599 # Can be specified in kb, mb, gb. Just a number indicates
600 # it's in bytes.
601 request-body-limit: 100kb
602 response-body-limit: 100kb
603
604 # inspection limits
605 request-body-minimal-inspect-size: 32kb
606 request-body-inspect-window: 4kb
607 response-body-minimal-inspect-size: 40kb
608 response-body-inspect-window: 16kb
609
610 # response body decompression (0 disables)
611 response-body-decompress-layer-limit: 2
612
613 # auto will use http-body-inline mode in IPS mode, yes or no set it statically
614 http-body-inline: auto
615
616 # Decompress SWF files. Disabled by default.
617 # Two types: 'deflate', 'lzma', 'both' will decompress deflate and lzma
618 # compress-depth:
619 # Specifies the maximum amount of data to decompress,
620 # set 0 for unlimited.
621 # decompress-depth:
622 # Specifies the maximum amount of decompressed data to obtain,
623 # set 0 for unlimited.
624 swf-decompression:
625 enabled: no
626 type: both
627 compress-depth: 100kb
628 decompress-depth: 100kb
629
630 # Use a random value for inspection sizes around the specified value.
631 # This lowers the risk of some evasion techniques but could lead
632 # to detection change between runs. It is set to 'yes' by default.
633 #randomize-inspection-sizes: yes
634 # If "randomize-inspection-sizes" is active, the value of various
635 # inspection size will be chosen from the [1 - range%, 1 + range%]
636 # range
637 # Default value of "randomize-inspection-range" is 10.
638 #randomize-inspection-range: 10
639
640 # decoding
641 double-decode-path: no
642 double-decode-query: no
643
644 # Can enable LZMA decompression
645 #lzma-enabled: false
646 # Memory limit usage for LZMA decompression dictionary
647 # Data is decompressed until dictionary reaches this size
648 #lzma-memlimit: 1mb
649 # Maximum decompressed size with a compression ratio
650 # above 2048 (only LZMA can reach this ratio, deflate cannot)
651 #compression-bomb-limit: 1mb
652 # Maximum time spent decompressing a single transaction in usec
653 #decompression-time-limit: 100000
654 # Maximum number of live transactions per flow
655 #max-tx: 512
656
657 server-config:
658
659 #- apache:
660 # address: [192.168.1.0/24, 127.0.0.0/8, "::1"]
661 # personality: Apache_2
662 # # Can be specified in kb, mb, gb. Just a number indicates
663 # # it's in bytes.
664 # request-body-limit: 4096
665 # response-body-limit: 4096
666 # double-decode-path: no
667 # double-decode-query: no
668
669 #- iis7:
670 # address:
671 # - 192.168.0.0/24
672 # - 192.168.10.0/24
673 # personality: IIS_7_0
674 # # Can be specified in kb, mb, gb. Just a number indicates
675 # # it's in bytes.
676 # request-body-limit: 4096
677 # response-body-limit: 4096
678 # double-decode-path: no
679 # double-decode-query: no
680
681 # Note: Modbus probe parser is minimalist due to the limited usage in the field.
682 # Only Modbus message length (greater than Modbus header length)
683 # and protocol ID (equal to 0) are checked in probing parser
684 # It is important to enable detection port and define Modbus port
685 # to avoid false positives
686 modbus:
687 # How many unanswered Modbus requests are considered a flood.
688 # If the limit is reached, the app-layer-event:modbus.flooded; will match.
689 #request-flood: 500
690
691 enabled: no
692 detection-ports:
693 dp: 502
694 # According to MODBUS Messaging on TCP/IP Implementation Guide V1.0b, it
695 # is recommended to keep the TCP connection opened with a remote device
696 # and not to open and close it for each MODBUS/TCP transaction. In that
697 # case, it is important to set the depth of the stream reassembling as
698 # unlimited (stream.reassembly.depth: 0)
699
700 # Stream reassembly size for modbus. By default track it completely.
701 stream-depth: 0
702
703 # DNP3
704 dnp3:
705 enabled: no
706 detection-ports:
707 dp: 20000
708
709 # SCADA EtherNet/IP and CIP protocol support
710 enip:
711 enabled: no
712 detection-ports:
713 dp: 44818
714 sp: 44818
715
716 ntp:
717 enabled: yes
718
719 quic:
720 enabled: yes
721
722 dhcp:
723 enabled: yes
724
725 sip:
726 #enabled: yes
727
728 # Limit for the maximum number of asn1 frames to decode (default 256)
729 asn1-max-frames: 256
730
731 # Datasets default settings
732 datasets:
733 # Default fallback memcap and hashsize values for datasets in case these
734 # were not explicitly defined.
735 defaults:
736 #memcap: 100mb
737 #hashsize: 2048
738
739 rules:
740 # Set to true to allow absolute filenames and filenames that use
741 # ".." components to reference parent directories in rules that specify
742 # their filenames.
743 #allow-absolute-filenames: false
744
745 # Allow datasets in rules write access for "save" and
746 # "state". This is enabled by default, however write access is
747 # limited to the data directory.
748 #allow-write: true
749
750 ##############################################################################
751 ##
752 ## Advanced settings below
753 ##
754 ##############################################################################
755
756 ##
757 ## Run Options
758 ##
759
760 # Run Suricata with a specific user-id and group-id:
761 run-as:
762 user: suricata
763 group: suricata
764
765 security:
766 # if true, prevents process creation from Suricata by calling
767 # setrlimit(RLIMIT_NPROC, 0)
768 limit-noproc: true
769 # Use landlock security module under Linux
770 landlock:
771 enabled: yes
772 directories:
773 write:
774 - /run
775 # /usr and /etc folders are added to read list to allow
776 # file magic to be used.
777 read:
778 - /usr/share/misc/magic.mgc
779 - /var/ipfire/suricata/
780 - /var/lib/suricata/rules/
781
782 lua:
783 # Allow Lua rules. Disabled by default.
784 #allow-rules: false
785
786 # Some logging modules will use that name in event as identifier. The default
787 # value is the hostname
788 #sensor-name: suricata
789
790 # Default location of the pid file. The pid file is only used in
791 # daemon mode (start Suricata with -D). If not running in daemon mode
792 # the --pidfile command line option must be used to create a pid file.
793 pid-file: /var/run/suricata.pid
794
795 # Daemon working directory
796 # Suricata will change directory to this one if provided
797 # Default: "/"
798 #daemon-directory: "/"
799
800 # Umask.
801 # Suricata will use this umask if it is provided. By default it will use the
802 # umask passed on by the shell.
803 #umask: 022
804
805 # Suricata core dump configuration. Limits the size of the core dump file to
806 # approximately max-dump. The actual core dump size will be a multiple of the
807 # page size. Core dumps that would be larger than max-dump are truncated. On
808 # Linux, the actual core dump size may be a few pages larger than max-dump.
809 # Setting max-dump to 0 disables core dumping.
810 # Setting max-dump to 'unlimited' will give the full core dump file.
811 # On 32-bit Linux, a max-dump value >= ULONG_MAX may cause the core dump size
812 # to be 'unlimited'.
813
814 coredump:
815 max-dump: unlimited
816
817 # If the Suricata box is a router for the sniffed networks, set it to 'router'. If
818 # it is a pure sniffing setup, set it to 'sniffer-only'.
819 # If set to auto, the variable is internally switched to 'router' in IPS mode
820 # and 'sniffer-only' in IDS mode.
821 # This feature is currently only used by the reject* keywords.
822 host-mode: auto
823
824 # Number of packets preallocated per thread. The default is 1024. A higher number
825 # will make sure each CPU will be more easily kept busy, but may negatively
826 # impact caching.
827 #max-pending-packets: 1024
828
829 # Runmode the engine should use. Please check --list-runmodes to get the available
830 # runmodes for each packet acquisition method. Default depends on selected capture
831 # method. 'workers' generally gives best performance.
832 runmode: workers
833
834 # Specifies the kind of flow load balancer used by the flow pinned autofp mode.
835 #
836 # Supported schedulers are:
837 #
838 # hash - Flow assigned to threads using the 5-7 tuple hash.
839 # ippair - Flow assigned to threads using addresses only.
840 # ftp-hash - Flow assigned to threads using the hash, except for FTP, so that
841 # ftp-data flows will be handled by the same thread
842 #
843 #autofp-scheduler: hash
844
845 # Preallocated size for each packet. Default is 1514 which is the classical
846 # size for pcap on Ethernet. You should adjust this value to the highest
847 # packet size (MTU + hardware header) on your system.
848 #default-packet-size: 1514
849
850 # Unix command socket that can be used to pass commands to Suricata.
851 # An external tool can then connect to get information from Suricata
852 # or trigger some modifications of the engine. Set enabled to yes
853 # to activate the feature. In auto mode, the feature will only be
854 # activated in live capture mode. You can use the filename variable to set
855 # the file name of the socket.
856 unix-command:
857 enabled: no
858 #filename: custom.socket
859
860 # Magic file
861 magic-file: /usr/share/misc/magic.mgc
862
863 legacy:
864 uricontent: enabled
865
866 ##
867 ## Detection settings
868 ##
869
870 # Set the order of alerts based on actions
871 # The default order is pass, drop, reject, alert
872 # action-order:
873 # - pass
874 # - drop
875 # - reject
876 # - alert
877
878 # Define maximum number of possible alerts that can be triggered for the same
879 # packet. Default is 15
880 #packet-alert-max: 15
881
882 # Exception Policies
883 #
884 # Define a common behavior for all exception policies.
885 # In IPS mode, the default is drop-flow. For cases when that's not possible, the
886 # engine will fall to drop-packet. To fallback to old behavior (setting each of
887 # them individually, or ignoring all), set this to ignore.
888 # All values available for exception policies can be used, and there is one
889 # extra option: auto - which means drop-flow or drop-packet (as explained above)
890 # in IPS mode, and ignore in IDS mode. Exception policy values are: drop-packet,
891 # drop-flow, reject, bypass, pass-packet, pass-flow, ignore (disable).
892 exception-policy: pass-packet
893
894 # When run with the option --engine-analysis, the engine will read each of
895 # the parameters below, and print reports for each of the enabled sections
896 # and exit. The reports are printed to a file in the default log dir
897 # given by the parameter "default-log-dir", with engine reporting
898 # subsection below printing reports in its own report file.
899 engine-analysis:
900 # enables printing reports for fast-pattern for every rule.
901 rules-fast-pattern: yes
902 # enables printing reports for each rule
903 rules: yes
904
905 #recursion and match limits for PCRE where supported
906 pcre:
907 match-limit: 3500
908 match-limit-recursion: 1500
909
910 ##
911 ## Advanced Traffic Tracking and Reconstruction Settings
912 ##
913
914 # Host specific policies for defragmentation and TCP stream
915 # reassembly. The host OS lookup is done using a radix tree, just
916 # like a routing table so the most specific entry matches.
917 host-os-policy:
918 # Make the default policy windows.
919 windows: [0.0.0.0/0]
920 bsd: []
921 bsd-right: []
922 old-linux: []
923 linux: []
924 old-solaris: []
925 solaris: []
926 hpux10: []
927 hpux11: []
928 irix: []
929 macos: []
930 vista: []
931 windows2k3: []
932
933 # Defrag settings:
934
935 # The memcap-policy value can be "drop-packet", "pass-packet", "reject" or
936 # "ignore" (which is the default).
937 defrag:
938 memcap: 64mb
939 # memcap-policy: ignore
940 hash-size: 65536
941 trackers: 65535 # number of defragmented flows to follow
942 max-frags: 65535 # number of fragments to keep (higher than trackers)
943 prealloc: yes
944 timeout: 60
945
946 # Flow settings:
947 # By default, the reserved memory (memcap) for flows is 32MB. This is the limit
948 # for flow allocation inside the engine. You can change this value to allow
949 # more memory usage for flows.
950 # The hash-size determines the size of the hash used to identify flows inside
951 # the engine, and by default the value is 65536.
952 # At startup, the engine can preallocate a number of flows, to get better
953 # performance. The number of flows preallocated is 10000 by default.
954 # emergency-recovery is the percentage of flows that the engine needs to
955 # prune before clearing the emergency state. The emergency state is activated
956 # when the memcap limit is reached, allowing new flows to be created, but
957 # pruning them with the emergency timeouts (they are defined below).
958 # If the memcap is reached, the engine will try to prune flows
959 # with the default timeouts. If it doesn't find a flow to prune, it will set
960 # the emergency bit and it will try again with more aggressive timeouts.
961 # If that doesn't work, then it will try to kill the oldest flows using
962 # last time seen flows.
963 # The memcap can be specified in kb, mb, gb. Just a number indicates it's
964 # in bytes.
965 # The memcap-policy can be "drop-packet", "pass-packet", "reject" or "ignore"
966 # (which is the default).
967
968 flow:
969 memcap: 256mb
970 #memcap-policy: ignore
971 hash-size: 65536
972 prealloc: 10000
973 emergency-recovery: 30
974 #managers: 1 # default to one flow manager
975 #recyclers: 1 # default to one flow recycler thread
976
977 # This option controls the use of VLAN ids in the flow (and defrag)
978 # hashing. Normally this should be enabled, but in some (broken)
979 # setups where both sides of a flow are not tagged with the same VLAN
980 # tag, we can ignore the VLAN id's in the flow hashing.
981 vlan:
982 use-for-tracking: true
983
984 # This option controls the use of livedev ids in the flow (and defrag)
985 # hashing. This is enabled by default and should be disabled if
986 # multiple live devices are used to capture traffic from the same network
987 livedev:
988 use-for-tracking: true
989
990 # Specific timeouts for flows. Here you can specify the timeouts that the
991 # active flows will wait to transit from the current state to another, on each
992 # protocol. The value of "new" determines the seconds to wait after a handshake or
993 # stream startup before the engine frees the data of that flow it doesn't
994 # change the state to established (usually if we don't receive more packets
995 # of that flow). The value of "established" is the amount of
996 # seconds that the engine will wait to free the flow if that time elapses
997 # without receiving new packets or closing the connection. "closed" is the
998 # amount of time to wait after a flow is closed (usually zero). "bypassed"
999 # timeout controls locally bypassed flows. For these flows we don't do any other
1000 # tracking. If no packets have been seen after this timeout, the flow is discarded.
1001 #
1002 # There's an emergency mode that will become active under attack circumstances,
1003 # making the engine to check flow status faster. This configuration variables
1004 # use the prefix "emergency-" and work similar as the normal ones.
1005 # Some timeouts doesn't apply to all the protocols, like "closed", for udp and
1006 # icmp.
1007
1008 flow-timeouts:
1009
1010 default:
1011 new: 30
1012 established: 300
1013 closed: 0
1014 bypassed: 100
1015 emergency-new: 10
1016 emergency-established: 100
1017 emergency-closed: 0
1018 emergency-bypassed: 50
1019 tcp:
1020 new: 60
1021 established: 600
1022 closed: 60
1023 bypassed: 100
1024 emergency-new: 5
1025 emergency-established: 100
1026 emergency-closed: 10
1027 emergency-bypassed: 50
1028 udp:
1029 new: 30
1030 established: 300
1031 bypassed: 100
1032 emergency-new: 10
1033 emergency-established: 100
1034 emergency-bypassed: 50
1035 icmp:
1036 new: 30
1037 established: 300
1038 bypassed: 100
1039 emergency-new: 10
1040 emergency-established: 100
1041 emergency-bypassed: 50
1042
1043 # Stream engine settings. Here the TCP stream tracking and reassembly
1044 # engine is configured.
1045 #
1046 # stream:
1047 # memcap: 64mb # Can be specified in kb, mb, gb. Just a
1048 # # number indicates it's in bytes.
1049 # memcap-policy: ignore # Can be "drop-flow", "pass-flow", "bypass",
1050 # # "drop-packet", "pass-packet", "reject" or
1051 # # "ignore" default is "ignore"
1052 # checksum-validation: yes # To validate the checksum of received
1053 # # packet. If csum validation is specified as
1054 # # "yes", then packets with invalid csum values will not
1055 # # be processed by the engine stream/app layer.
1056 # # Warning: locally generated traffic can be
1057 # # generated without checksum due to hardware offload
1058 # # of checksum. You can control the handling of checksum
1059 # # on a per-interface basis via the 'checksum-checks'
1060 # # option
1061 # prealloc-sessions: 2048 # 2k sessions prealloc'd per stream thread
1062 # midstream: false # don't allow midstream session pickups
1063 # midstream-policy: ignore # Can be "drop-flow", "pass-flow", "bypass",
1064 # # "drop-packet", "pass-packet", "reject" or
1065 # # "ignore" default is "ignore"
1066 # async-oneside: false # don't enable async stream handling
1067 # inline: no # stream inline mode
1068 # drop-invalid: yes # in inline mode, drop packets that are invalid with regards to streaming engine
1069 # max-syn-queued: 10 # Max different SYNs to queue
1070 # max-synack-queued: 5 # Max different SYN/ACKs to queue
1071 # bypass: no # Bypass packets when stream.reassembly.depth is reached.
1072 # # Warning: first side to reach this triggers
1073 # # the bypass.
1074 # liberal-timestamps: false # Treat all timestamps as if the Linux policy applies. This
1075 # # means it's slightly more permissive. Enabled by default.
1076 #
1077 # reassembly:
1078 # memcap: 256mb # Can be specified in kb, mb, gb. Just a number
1079 # # indicates it's in bytes.
1080 # memcap-policy: ignore # Can be "drop-flow", "pass-flow", "bypass",
1081 # # "drop-packet", "pass-packet", "reject" or
1082 # # "ignore" default is "ignore"
1083 # depth: 1mb # Can be specified in kb, mb, gb. Just a number
1084 # # indicates it's in bytes.
1085 # toserver-chunk-size: 2560 # inspect raw stream in chunks of at least
1086 # # this size. Can be specified in kb, mb,
1087 # # gb. Just a number indicates it's in bytes.
1088 # toclient-chunk-size: 2560 # inspect raw stream in chunks of at least
1089 # # this size. Can be specified in kb, mb,
1090 # # gb. Just a number indicates it's in bytes.
1091 # randomize-chunk-size: yes # Take a random value for chunk size around the specified value.
1092 # # This lowers the risk of some evasion techniques but could lead
1093 # # to detection change between runs. It is set to 'yes' by default.
1094 # randomize-chunk-range: 10 # If randomize-chunk-size is active, the value of chunk-size is
1095 # # a random value between (1 - randomize-chunk-range/100)*toserver-chunk-size
1096 # # and (1 + randomize-chunk-range/100)*toserver-chunk-size and the same
1097 # # calculation for toclient-chunk-size.
1098 # # Default value of randomize-chunk-range is 10.
1099 #
1100 # raw: yes # 'Raw' reassembly enabled or disabled.
1101 # # raw is for content inspection by detection
1102 # # engine.
1103 #
1104 # segment-prealloc: 2048 # number of segments preallocated per thread
1105 #
1106 # check-overlap-different-data: true|false
1107 # # check if a segment contains different data
1108 # # than what we've already seen for that
1109 # # position in the stream.
1110 # # This is enabled automatically if inline mode
1111 # # is used or when stream-event:reassembly_overlap_different_data;
1112 # # is used in a rule.
1113 #
1114 stream:
1115 memcap: 256mb
1116 prealloc-sessions: 4096
1117 #memcap-policy: ignore
1118 checksum-validation: yes # reject incorrect csums
1119 #midstream: false
1120 midstream-policy: pass-packet
1121 inline: auto # auto will use inline mode in IPS mode, yes or no set it statically
1122 bypass: yes # Bypass packets when stream.reassembly.depth is reached.
1123 reassembly:
1124 memcap: 256mb
1125 #memcap-policy: ignore
1126 depth: 1mb # reassemble 1mb into a stream
1127 toserver-chunk-size: 2560
1128 toclient-chunk-size: 2560
1129 randomize-chunk-size: yes
1130 #randomize-chunk-range: 10
1131 raw: yes
1132 segment-prealloc: 2048
1133 check-overlap-different-data: true
1134
1135 # Host table:
1136 #
1137 # Host table is used by the tagging and per host thresholding subsystems.
1138 #
1139 host:
1140 hash-size: 4096
1141 prealloc: 1000
1142 memcap: 32mb
1143
1144 # IP Pair table:
1145 #
1146 # Used by xbits 'ippair' tracking.
1147 #
1148 #ippair:
1149 # hash-size: 4096
1150 # prealloc: 1000
1151 # memcap: 32mb
1152
1153 # Decoder settings
1154
1155 decoder:
1156 # Teredo decoder is known to not be completely accurate
1157 # as it will sometimes detect non-teredo as teredo.
1158 teredo:
1159 enabled: false
1160 # ports to look for Teredo. Max 4 ports. If no ports are given, or
1161 # the value is set to 'any', Teredo detection runs on _all_ UDP packets.
1162 ports: $TEREDO_PORTS # syntax: '[3544, 1234]' or '3533' or 'any'.
1163
1164 # VXLAN decoder is assigned to up to 4 UDP ports. By default only the
1165 # IANA assigned port 4789 is enabled.
1166 vxlan:
1167 enabled: true
1168 ports: $VXLAN_PORTS # syntax: '[8472, 4789]' or '4789'.
1169
1170 # Geneve decoder is assigned to up to 4 UDP ports. By default only the
1171 # IANA assigned port 6081 is enabled.
1172 geneve:
1173 enabled: true
1174 ports: $GENEVE_PORTS # syntax: '[6081, 1234]' or '6081'.
1175
1176 # maximum number of decoder layers for a packet
1177 # max-layers: 16
1178
1179 ##
1180 ## Performance tuning and profiling
1181 ##
1182
1183 # The detection engine builds internal groups of signatures. The engine
1184 # allows us to specify the profile to use for them, to manage memory in an
1185 # efficient way keeping good performance. For the profile keyword you
1186 # can use the words "low", "medium", "high" or "custom". If you use custom,
1187 # make sure to define the values in the "custom-values" section.
1188 # Usually you would prefer medium/high/low.
1189 #
1190 # "sgh mpm-context", indicates how the staging should allot mpm contexts for
1191 # the signature groups. "single" indicates the use of a single context for
1192 # all the signature group heads. "full" indicates a mpm-context for each
1193 # group head. "auto" lets the engine decide the distribution of contexts
1194 # based on the information the engine gathers on the patterns from each
1195 # group head.
1196 #
1197 # The option inspection-recursion-limit is used to limit the recursive calls
1198 # in the content inspection code. For certain payload-sig combinations, we
1199 # might end up taking too much time in the content inspection code.
1200 # If the argument specified is 0, the engine uses an internally defined
1201 # default limit. When a value is not specified, there are no limits on the recursion.
1202 detect:
1203 profile: medium
1204 custom-values:
1205 toclient-groups: 3
1206 toserver-groups: 25
1207 sgh-mpm-context: auto
1208 inspection-recursion-limit: 3000
1209 # If set to yes, the loading of signatures will be made after the capture
1210 # is started. This will limit the downtime in IPS mode.
1211 delayed-detect: yes
1212
1213 prefilter:
1214 # default prefiltering setting. "mpm" only creates MPM/fast_pattern
1215 # engines. "auto" also sets up prefilter engines for other keywords.
1216 # Use --list-keywords=all to see which keywords support prefiltering.
1217 default: mpm
1218
1219 # the grouping values above control how many groups are created per
1220 # direction. Port whitelisting forces that port to get its own group.
1221 # Very common ports will benefit, as well as ports with many expensive
1222 # rules.
1223 grouping:
1224 #tcp-whitelist: 53, 80, 139, 443, 445, 1433, 3306, 3389, 6666, 6667, 8080
1225 #udp-whitelist: 53, 135, 5060
1226
1227 profiling:
1228 # Log the rules that made it past the prefilter stage, per packet
1229 # default is off. The threshold setting determines how many rules
1230 # must have made it past pre-filter for that rule to trigger the
1231 # logging.
1232 #inspect-logging-threshold: 200
1233 grouping:
1234 dump-to-disk: false
1235 include-rules: false # very verbose
1236 include-mpm-stats: false
1237
1238 # Select the multi pattern algorithm you want to run for scan/search the
1239 # in the engine.
1240 #
1241 # The supported algorithms are:
1242 # "ac" - Aho-Corasick, default implementation
1243 # "ac-bs" - Aho-Corasick, reduced memory implementation
1244 # "ac-ks" - Aho-Corasick, "Ken Steele" variant
1245 # "hs" - Hyperscan, available when built with Hyperscan support
1246 #
1247 # The default mpm-algo value of "auto" will use "hs" if Hyperscan is
1248 # available, "ac" otherwise.
1249 #
1250 # The mpm you choose also decides the distribution of mpm contexts for
1251 # signature groups, specified by the conf - "detect.sgh-mpm-context".
1252 # Selecting "ac" as the mpm would require "detect.sgh-mpm-context"
1253 # to be set to "single", because of ac's memory requirements, unless the
1254 # ruleset is small enough to fit in memory, in which case one can
1255 # use "full" with "ac". The rest of the mpms can be run in "full" mode.
1256
1257 mpm-algo: auto
1258
1259 # Select the matching algorithm you want to use for single-pattern searches.
1260 #
1261 # Supported algorithms are "bm" (Boyer-Moore) and "hs" (Hyperscan, only
1262 # available if Suricata has been built with Hyperscan support).
1263 #
1264 # The default of "auto" will use "hs" if available, otherwise "bm".
1265
1266 spm-algo: auto
1267
1268 # Suricata is multi-threaded. Here the threading can be influenced.
1269 threading:
1270 set-cpu-affinity: no
1271 # Tune cpu affinity of threads. Each family of threads can be bound
1272 # to specific CPUs.
1273 #
1274 # These 2 apply to the all runmodes:
1275 # management-cpu-set is used for flow timeout handling, counters
1276 # worker-cpu-set is used for 'worker' threads
1277 #
1278 # Additionally, for autofp these apply:
1279 # receive-cpu-set is used for capture threads
1280 # verdict-cpu-set is used for IPS verdict threads
1281 #
1282 cpu-affinity:
1283 - management-cpu-set:
1284 cpu: [ 0 ] # include only these CPUs in affinity settings
1285 - receive-cpu-set:
1286 cpu: [ 0 ] # include only these CPUs in affinity settings
1287 - worker-cpu-set:
1288 cpu: [ "all" ]
1289 mode: "exclusive"
1290 # Use explicitly 3 threads and don't compute number by using
1291 # detect-thread-ratio variable:
1292 # threads: 3
1293 prio:
1294 low: [ 0 ]
1295 medium: [ "1-2" ]
1296 high: [ 3 ]
1297 default: "medium"
1298 #- verdict-cpu-set:
1299 # cpu: [ 0 ]
1300 # prio:
1301 # default: "high"
1302 #
1303 # By default Suricata creates one "detect" thread per available CPU/CPU core.
1304 # This setting allows controlling this behaviour. A ratio setting of 2 will
1305 # create 2 detect threads for each CPU/CPU core. So for a dual core CPU this
1306 # will result in 4 detect threads. If values below 1 are used, less threads
1307 # are created. So on a dual core CPU a setting of 0.5 results in 1 detect
1308 # thread being created. Regardless of the setting at a minimum 1 detect
1309 # thread will always be created.
1310 #
1311 detect-thread-ratio: 1.0
1312 #
1313 # By default, the per-thread stack size is left to its default setting. If
1314 # the default thread stack size is too small, use the following configuration
1315 # setting to change the size. Note that if any thread's stack size cannot be
1316 # set to this value, a fatal error occurs.
1317 #
1318 # Generally, the per-thread stack-size should not exceed 8MB.
1319 #stack-size: 8mb