Project

General

Profile

Bug #3073 » suricata.yaml

Donald Hoskins, 07/08/2019 09:06 PM

 
1
%YAML 1.1
2
---
3

    
4
# Suricata configuration file. In addition to the comments describing all
5
# options in this file, full documentation can be found at:
6
# https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Suricatayaml
7

    
8
##
9
## Step 1: inform Suricata about your network
10
##
11

    
12
vars:
13
  # more specifc is better for alert accuracy and performance
14
  address-groups:
15
    HOME_NET: "[192.168.0.0/16,10.0.0.0/8,172.16.0.0/12]"
16
    #HOME_NET: "[192.168.0.0/16]"
17
    #HOME_NET: "[10.0.0.0/8]"
18
    #HOME_NET: "[172.16.0.0/12]"
19
    #HOME_NET: "any"
20

    
21
    EXTERNAL_NET: "!$HOME_NET"
22
    #EXTERNAL_NET: "any"
23

    
24
    HTTP_SERVERS: "$HOME_NET"
25
    SMTP_SERVERS: "$HOME_NET"
26
    SQL_SERVERS: "$HOME_NET"
27
    DNS_SERVERS: "$HOME_NET"
28
    TELNET_SERVERS: "$HOME_NET"
29
    AIM_SERVERS: "$EXTERNAL_NET"
30
    DNP3_SERVER: "$HOME_NET"
31
    DNP3_CLIENT: "$HOME_NET"
32
    MODBUS_CLIENT: "$HOME_NET"
33
    MODBUS_SERVER: "$HOME_NET"
34
    ENIP_CLIENT: "$HOME_NET"
35
    ENIP_SERVER: "$HOME_NET"
36

    
37
  port-groups:
38
    HTTP_PORTS: "80"
39
    SHELLCODE_PORTS: "!80"
40
    ORACLE_PORTS: 1521
41
    SSH_PORTS: 22
42
    DNP3_PORTS: 20000
43
    MODBUS_PORTS: 502
44
    FILE_DATA_PORTS: "[$HTTP_PORTS,110,143]"
45
    FTP_PORTS: 21
46

    
47

    
48
##
49
## Step 2: select the rules to enable or disable
50
##
51

    
52
default-rule-path: /etc/suricata/rules
53
rule-files:
54
 - botcc.rules
55
 - ciarmy.rules
56
 - compromised.rules
57
 - drop.rules
58
 - dshield.rules
59
# - emerging-activex.rules
60
 - emerging-attack_response.rules
61
 - emerging-chat.rules
62
 - emerging-current_events.rules
63
 - emerging-dns.rules
64
 - emerging-dos.rules
65
 - emerging-exploit.rules
66
 - emerging-ftp.rules
67
# - emerging-games.rules
68
# - emerging-icmp_info.rules
69
# - emerging-icmp.rules
70
 - emerging-imap.rules
71
# - emerging-inappropriate.rules
72
 - emerging-malware.rules
73
 - emerging-misc.rules
74
 - emerging-mobile_malware.rules
75
 - emerging-netbios.rules
76
 - emerging-p2p.rules
77
 - emerging-policy.rules
78
 - emerging-pop3.rules
79
 - emerging-rpc.rules
80
 - emerging-scada.rules
81
 - emerging-scan.rules
82
# - emerging-shellcode.rules
83
 - emerging-smtp.rules
84
 - emerging-snmp.rules
85
 - emerging-sql.rules
86
 - emerging-telnet.rules
87
 - emerging-tftp.rules
88
 - emerging-trojan.rules
89
 - emerging-user_agents.rules
90
 - emerging-voip.rules
91
 - emerging-web_client.rules
92
 - emerging-web_server.rules
93
# - emerging-web_specific_apps.rules
94
 - emerging-worm.rules
95
 - tor.rules
96
# - decoder-events.rules # available in suricata sources under rules dir
97
# - stream-events.rules  # available in suricata sources under rules dir
98
 - http-events.rules    # available in suricata sources under rules dir
99
 - smtp-events.rules    # available in suricata sources under rules dir
100
 - dns-events.rules     # available in suricata sources under rules dir
101
 - tls-events.rules     # available in suricata sources under rules dir
102
# - modbus-events.rules  # available in suricata sources under rules dir
103
# - app-layer-events.rules  # available in suricata sources under rules dir
104
# - dnp3-events.rules       # available in suricata sources under rules dir
105

    
106
classification-file: /etc/suricata/classification.config
107
reference-config-file: /etc/suricata/reference.config
108
# threshold-file: /etc/suricata/threshold.config
109

    
110

    
111
##
112
## Step 3: select outputs to enable
113
##
114

    
115
# The default logging directory.  Any log or output file will be
116
# placed here if its not specified with a full path name. This can be
117
# overridden with the -l command line parameter.
118
default-log-dir: /var/log/
119

    
120
# global stats configuration
121
stats:
122
  enabled: no
123
  # The interval field (in seconds) controls at what interval
124
  # the loggers are invoked.
125
  interval: 8
126

    
127
# Configure the type of alert (and other) logging you would like.
128
outputs:
129
  # a line based alerts log similar to Snort's fast.log
130
  - fast:
131
      enabled: no
132
      filename: fast.log
133
      append: yes
134
      #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
135

    
136
  # Extensible Event Format (nicknamed EVE) event log in JSON format
137
  - eve-log:
138
      enabled: yes
139
      filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
140
      filename: eve.json
141
      #prefix: "@cee: " # prefix to prepend to each log entry
142
      # the following are valid when type: syslog above
143
      #identity: "suricata"
144
      #facility: local5
145
      #level: Info ## possible levels: Emergency, Alert, Critical,
146
                   ## Error, Warning, Notice, Info, Debug
147
      #redis:
148
      #  server: 127.0.0.1
149
      #  port: 6379
150
      #  mode: list ## possible values: list (default), channel
151
      #  key: suricata ## key or channel to use (default to suricata)
152
      # Redis pipelining set up. This will enable to only do a query every
153
      # 'batch-size' events. This should lower the latency induced by network
154
      # connection at the cost of some memory. There is no flushing implemented
155
      # so this setting as to be reserved to high traffic suricata.
156
      #  pipelining:
157
      #    enabled: yes ## set enable to yes to enable query pipelining
158
      #    batch-size: 10 ## number of entry to keep in buffer
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
            http: yes                # enable dumping of http fields
166
            tls: yes                 # enable dumping of tls fields
167
            ssh: yes                 # enable dumping of ssh fields
168
            smtp: yes                # enable dumping of smtp fields
169
            dnp3: yes                # enable dumping of DNP3 fields
170
            #metadata: yes              # add L7/applayer fields, flowbit and other vars to the alert
171
            # Enable the logging of tagged packets for rules using the
172
            # "tag" keyword.
173
            tagged-packets: yes
174

    
175
            # HTTP X-Forwarded-For support by adding an extra field or overwriting
176
            # the source or destination IP address (depending on flow direction)
177
            # with the one reported in the X-Forwarded-For HTTP header. This is
178
            # helpful when reviewing alerts for traffic that is being reverse
179
            # or forward proxied.
180
            xff:
181
              enabled: no
182
              # Two operation modes are available, "extra-data" and "overwrite".
183
              mode: extra-data
184
              # Two proxy deployments are supported, "reverse" and "forward". In
185
              # a "reverse" deployment the IP address used is the last one, in a
186
              # "forward" deployment the first IP address is used.
187
              deployment: reverse
188
              # Header name where the actual IP address will be reported, if more
189
              # than one IP address is present, the last IP address will be the
190
              # one taken into consideration.
191
              header: X-Forwarded-For
192
        - http:
193
            extended: yes     # enable this for extended logging information
194
            # custom allows additional http fields to be included in eve-log
195
            # the example below adds three additional fields when uncommented
196
            #custom: [Accept-Encoding, Accept-Language, Authorization]
197
            custom: [accept, accept-charset, accept-encoding, accept-language,
198
            accept-datetime, authorization, cache-control, cookie, from,
199
            max-forwards, origin, pragma, proxy-authorization, range, te, via,
200
            x-requested-with, dnt, x-forwarded-proto, accept-range, age,
201
            allow, connection, content-encoding, content-language,
202
            content-length, content-location, content-md5, content-range,
203
            content-type, date, etags, last-modified, link, location,
204
            proxy-authenticate, referrer, refresh, retry-after, server,
205
            set-cookie, trailer, transfer-encoding, upgrade, vary, warning,
206
            www-authenticate]
207
        - dns:
208
            # control logging of queries and answers
209
            # default yes, no to disable
210
            query: yes     # enable logging of DNS queries
211
            answer: yes    # enable logging of DNS answers
212
            # control which RR types are logged
213
            # all enabled if custom not specified
214
            #custom: [a, aaaa, cname, mx, ns, ptr, txt]
215
        - tls:
216
            extended: yes     # enable this for extended logging information
217
        - files:
218
            force-magic: no   # force logging magic on all logged files
219
            # force logging of checksums, available hash functions are md5,
220
            # sha1 and sha256
221
            #force-hash: [md5]
222
        #- drop:
223
        #    alerts: yes      # log alerts that caused drops
224
        #    flows: all       # start or all: 'start' logs only a single drop
225
        #                     # per flow direction. All logs each dropped pkt.
226
        - smtp:
227
            #extended: yes # enable this for extended logging information
228
            # this includes: bcc, message-id, subject, x_mailer, user-agent
229
            # custom fields logging from the list:
230
            #  reply-to, bcc, message-id, subject, x-mailer, user-agent, received,
231
            #  x-originating-ip, in-reply-to, references, importance, priority,
232
            #  sensitivity, organization, content-md5, date
233
            #custom: [received, x-mailer, x-originating-ip, relays, reply-to, bcc]
234
            # output md5 of fields: body, subject
235
            # for the body you need to set app-layer.protocols.smtp.mime.body-md5
236
            # to yes
237
            #md5: [body, subject]
238

    
239
        - ssh
240
        - stats:
241
            totals: yes       # stats for all threads merged together
242
            threads: no       # per thread stats
243
            deltas: no        # include delta values
244
        # bi-directional flows
245
        - flow
246
        # uni-directional flows
247
        #- netflow
248
        #- dnp3
249

    
250
  # alert output for use with Barnyard2
251
  - unified2-alert:
252
      enabled: no
253
      filename: unified2.alert
254

    
255
      # File size limit.  Can be specified in kb, mb, gb.  Just a number
256
      # is parsed as bytes.
257
      #limit: 32mb
258

    
259
      # Sensor ID field of unified2 alerts.
260
      #sensor-id: 0
261

    
262
      # Include payload of packets related to alerts. Defaults to true, set to
263
      # false if payload is not required.
264
      #payload: yes
265

    
266
      # HTTP X-Forwarded-For support by adding the unified2 extra header or
267
      # overwriting the source or destination IP address (depending on flow
268
      # direction) with the one reported in the X-Forwarded-For HTTP header.
269
      # This is helpful when reviewing alerts for traffic that is being reverse
270
      # or forward proxied.
271
      xff:
272
        enabled: no
273
        # Two operation modes are available, "extra-data" and "overwrite". Note
274
        # that in the "overwrite" mode, if the reported IP address in the HTTP
275
        # X-Forwarded-For header is of a different version of the packet
276
        # received, it will fall-back to "extra-data" mode.
277
        mode: extra-data
278
        # Two proxy deployments are supported, "reverse" and "forward". In
279
        # a "reverse" deployment the IP address used is the last one, in a
280
        # "forward" deployment the first IP address is used.
281
        deployment: reverse
282
        # Header name where the actual IP address will be reported, if more
283
        # than one IP address is present, the last IP address will be the
284
        # one taken into consideration.
285
        header: X-Forwarded-For
286

    
287
  # a line based log of HTTP requests (no alerts)
288
  - http-log:
289
      enabled: no
290
      filename: http.log
291
      append: yes
292
      #extended: yes     # enable this for extended logging information
293
      #custom: yes       # enabled the custom logging format (defined by customformat)
294
      #customformat: "%{%D-%H:%M:%S}t.%z %{X-Forwarded-For}i %H %m %h %u %s %B %a:%p -> %A:%P"
295
      #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
296

    
297
  # a line based log of TLS handshake parameters (no alerts)
298
  - tls-log:
299
      enabled: no  # Log TLS connections.
300
      filename: tls.log # File to store TLS logs.
301
      append: yes
302
      #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
303
      #extended: yes # Log extended information like fingerprint
304

    
305
  # output module to store certificates chain to disk
306
  - tls-store:
307
      enabled: no
308
      #certs-log-dir: certs # directory to store the certificates files
309

    
310
  # a line based log of DNS requests and/or replies (no alerts)
311
  - dns-log:
312
      enabled: no
313
      filename: dns.log
314
      append: yes
315
      #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
316

    
317
  # Packet log... log packets in pcap format. 3 modes of operation: "normal"
318
  # "multi" and "sguil".
319
  #
320
  # In normal mode a pcap file "filename" is created in the default-log-dir,
321
  # or are as specified by "dir".
322
  # In multi mode, a file is created per thread. This will perform much
323
  # better, but will create multiple files where 'normal' would create one.
324
  # In multi mode the filename takes a few special variables:
325
  # - %n -- thread number
326
  # - %i -- thread id
327
  # - %t -- timestamp (secs or secs.usecs based on 'ts-format'
328
  # E.g. filename: pcap.%n.%t
329
  #
330
  # Note that it's possible to use directories, but the directories are not
331
  # created by Suricata. E.g. filename: pcaps/%n/log.%s will log into the
332
  # per thread directory.
333
  #
334
  # Also note that the limit and max-files settings are enforced per thread.
335
  # So the size limit when using 8 threads with 1000mb files and 2000 files
336
  # is: 8*1000*2000 ~ 16TiB.
337
  #
338
  # In Sguil mode "dir" indicates the base directory. In this base dir the
339
  # pcaps are created in th directory structure Sguil expects:
340
  #
341
  # $sguil-base-dir/YYYY-MM-DD/$filename.<timestamp>
342
  #
343
  # By default all packets are logged except:
344
  # - TCP streams beyond stream.reassembly.depth
345
  # - encrypted streams after the key exchange
346
  #
347
  - pcap-log:
348
      enabled: no
349
      filename: log.pcap
350

    
351
      # File size limit.  Can be specified in kb, mb, gb.  Just a number
352
      # is parsed as bytes.
353
      limit: 1000mb
354

    
355
      # If set to a value will enable ring buffer mode. Will keep Maximum of "max-files" of size "limit"
356
      max-files: 2000
357

    
358
      mode: normal # normal, multi or sguil.
359

    
360
      # Directory to place pcap files. If not provided the default log
361
      # directory will be used. Required for "sguil" mode.
362
      #dir: /nsm_data/
363

    
364
      #ts-format: usec # sec or usec second format (default) is filename.sec usec is filename.sec.usec
365
      use-stream-depth: no #If set to "yes" packets seen after reaching stream inspection depth are ignored. "no" logs all packets
366
      honor-pass-rules: no # If set to "yes", flows in which a pass rule matched will stopped being logged.
367

    
368
  # a full alerts log containing much information for signature writers
369
  # or for investigating suspected false positives.
370
  - alert-debug:
371
      enabled: no
372
      filename: alert-debug.log
373
      append: yes
374
      #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
375

    
376
  # alert output to prelude (http://www.prelude-technologies.com/) only
377
  # available if Suricata has been compiled with --enable-prelude
378
  - alert-prelude:
379
      enabled: no
380
      profile: suricata
381
      log-packet-content: no
382
      log-packet-header: yes
383

    
384
  # Stats.log contains data from various counters of the suricata engine.
385
  - stats:
386
      enabled: yes
387
      filename: stats.log
388
      append: yes       # append to file (yes) or overwrite it (no)
389
      totals: yes       # stats for all threads merged together
390
      threads: no       # per thread stats
391
      #null-values: yes  # print counters that have value 0
392

    
393
  # a line based alerts log similar to fast.log into syslog
394
  - syslog:
395
      enabled: no
396
      # reported identity to syslog. If ommited the program name (usually
397
      # suricata) will be used.
398
      #identity: "suricata"
399
      facility: local5
400
      #level: Info ## possible levels: Emergency, Alert, Critical,
401
                   ## Error, Warning, Notice, Info, Debug
402

    
403
  # a line based information for dropped packets in IPS mode
404
  - drop:
405
      enabled: no
406
      filename: drop.log
407
      append: yes
408
      #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
409

    
410
  # output module to store extracted files to disk
411
  #
412
  # The files are stored to the log-dir in a format "file.<id>" where <id> is
413
  # an incrementing number starting at 1. For each file "file.<id>" a meta
414
  # file "file.<id>.meta" is created.
415
  #
416
  # File extraction depends on a lot of things to be fully done:
417
  # - file-store stream-depth. For optimal results, set this to 0 (unlimited)
418
  # - http request / response body sizes. Again set to 0 for optimal results.
419
  # - rules that contain the "filestore" keyword.
420
  - file-store:
421
      enabled: no       # set to yes to enable
422
      log-dir: files    # directory to store the files
423
      force-magic: no   # force logging magic on all stored files
424
      # force logging of checksums, available hash functions are md5,
425
      # sha1 and sha256
426
      #force-hash: [md5]
427
      force-filestore: no # force storing of all files
428
      # override global stream-depth for sessions in which we want to
429
      # perform file extraction. Set to 0 for unlimited.
430
      #stream-depth: 0
431
      #waldo: file.waldo # waldo file to store the file_id across runs
432

    
433
  # output module to log files tracked in a easily parsable json format
434
  - file-log:
435
      enabled: no
436
      filename: files-json.log
437
      append: yes
438
      #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
439

    
440
      force-magic: no   # force logging magic on all logged files
441
      # force logging of checksums, available hash functions are md5,
442
      # sha1 and sha256
443
      #force-hash: [md5]
444

    
445
  # Log TCP data after stream normalization
446
  # 2 types: file or dir. File logs into a single logfile. Dir creates
447
  # 2 files per TCP session and stores the raw TCP data into them.
448
  # Using 'both' will enable both file and dir modes.
449
  #
450
  # Note: limited by stream.depth
451
  - tcp-data:
452
      enabled: no
453
      type: file
454
      filename: tcp-data.log
455

    
456
  # Log HTTP body data after normalization, dechunking and unzipping.
457
  # 2 types: file or dir. File logs into a single logfile. Dir creates
458
  # 2 files per HTTP session and stores the normalized data into them.
459
  # Using 'both' will enable both file and dir modes.
460
  #
461
  # Note: limited by the body limit settings
462
  - http-body-data:
463
      enabled: no
464
      type: file
465
      filename: http-data.log
466

    
467
  # Lua Output Support - execute lua script to generate alert and event
468
  # output.
469
  # Documented at:
470
  # https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Lua_Output
471
  - lua:
472
      enabled: no
473
      #scripts-dir: /etc/suricata/lua-output/
474
      scripts:
475
      #   - script1.lua
476

    
477
# Logging configuration.  This is not about logging IDS alerts/events, but
478
# output about what Suricata is doing, like startup messages, errors, etc.
479
logging:
480
  # The default log level, can be overridden in an output section.
481
  # Note that debug level logging will only be emitted if Suricata was
482
  # compiled with the --enable-debug configure option.
483
  #
484
  # This value is overriden by the SC_LOG_LEVEL env var.
485
  default-log-level: notice
486

    
487
  # The default output format.  Optional parameter, should default to
488
  # something reasonable if not provided.  Can be overriden in an
489
  # output section.  You can leave this out to get the default.
490
  #
491
  # This value is overriden by the SC_LOG_FORMAT env var.
492
  #default-log-format: "[%i] %t - (%f:%l) <%d> (%n) -- "
493

    
494
  # A regex to filter output.  Can be overridden in an output section.
495
  # Defaults to empty (no filter).
496
  #
497
  # This value is overriden by the SC_LOG_OP_FILTER env var.
498
  default-output-filter:
499

    
500
  # Define your logging outputs.  If none are defined, or they are all
501
  # disabled you will get the default - console output.
502
  outputs:
503
  - console:
504
      enabled: yes
505
      # type: json
506
  - file:
507
      enabled: yes
508
      level: info
509
      filename: /var/log/suricata.log
510
      # type: json
511
  - syslog:
512
      enabled: no
513
      facility: local5
514
      format: "[%i] <%d> -- "
515
      # type: json
516

    
517

    
518
##
519
## Step 4: configure common capture settings
520
##
521
## See "Advanced Capture Options" below for more options, including NETMAP
522
## and PF_RING.
523
##
524

    
525
# Linux high speed capture support
526
af-packet:
527
  - interface: eth0
528
    # Number of receive threads. "auto" uses the number of cores
529
    #threads: auto
530
    # Default clusterid. AF_PACKET will load balance packets based on flow.
531
    cluster-id: 99
532
    # Default AF_PACKET cluster type. AF_PACKET can load balance per flow or per hash.
533
    # This is only supported for Linux kernel > 3.1
534
    # possible value are:
535
    #  * cluster_round_robin: round robin load balancing
536
    #  * cluster_flow: all packets of a given flow are send to the same socket
537
    #  * cluster_cpu: all packets treated in kernel by a CPU are send to the same socket
538
    #  * cluster_qm: all packets linked by network card to a RSS queue are sent to the same
539
    #  socket. Requires at least Linux 3.14.
540
    #  * cluster_random: packets are sent randomly to sockets but with an equipartition.
541
    #  Requires at least Linux 3.14.
542
    #  * cluster_rollover: kernel rotates between sockets filling each socket before moving
543
    #  to the next. Requires at least Linux 3.10.
544
    # Recommended modes are cluster_flow on most boxes and cluster_cpu or cluster_qm on system
545
    # with capture card using RSS (require cpu affinity tuning and system irq tuning)
546
    cluster-type: cluster_flow
547
    # In some fragmentation case, the hash can not be computed. If "defrag" is set
548
    # to yes, the kernel will do the needed defragmentation before sending the packets.
549
    defrag: yes
550
    # After Linux kernel 3.10 it is possible to activate the rollover option: if a socket is
551
    # full then kernel will send the packet on the next socket with room available. This option
552
    # can minimize packet drop and increase the treated bandwidth on single intensive flow.
553
    #rollover: yes
554
    # To use the ring feature of AF_PACKET, set 'use-mmap' to yes
555
    #use-mmap: yes
556
    # Lock memory map to avoid it goes to swap. Be careful that over suscribing could lock
557
    # your system
558
    #mmap-locked: yes
559
    # Use tpacket_v3 capture mode, only active if use-mmap is true
560
    # Don't use it in IPS or TAP mode as it causes severe latency
561
    #tpacket-v3: yes
562
    # Ring size will be computed with respect to max_pending_packets and number
563
    # of threads. You can set manually the ring size in number of packets by setting
564
    # the following value. If you are using flow cluster-type and have really network
565
    # intensive single-flow you could want to set the ring-size independently of the number
566
    # of threads:
567
    #ring-size: 2048
568
    # Block size is used by tpacket_v3 only. It should set to a value high enough to contain
569
    # a decent number of packets. Size is in bytes so please consider your MTU. It should be
570
    # a power of 2 and it must be multiple of page size (usually 4096).
571
    #block-size: 32768
572
    # tpacket_v3 block timeout: an open block is passed to userspace if it is not
573
    # filled after block-timeout milliseconds.
574
    #block-timeout: 10
575
    # On busy system, this could help to set it to yes to recover from a packet drop
576
    # phase. This will result in some packets (at max a ring flush) being non treated.
577
    #use-emergency-flush: yes
578
    # recv buffer size, increase value could improve performance
579
    # buffer-size: 32768
580
    # Set to yes to disable promiscuous mode
581
    # disable-promisc: no
582
    # Choose checksum verification mode for the interface. At the moment
583
    # of the capture, some packets may be with an invalid checksum due to
584
    # offloading to the network card of the checksum computation.
585
    # Possible values are:
586
    #  - kernel: use indication sent by kernel for each packet (default)
587
    #  - yes: checksum validation is forced
588
    #  - no: checksum validation is disabled
589
    #  - auto: suricata uses a statistical approach to detect when
590
    #  checksum off-loading is used.
591
    # Warning: 'checksum-validation' must be set to yes to have any validation
592
    #checksum-checks: kernel
593
    # BPF filter to apply to this interface. The pcap filter syntax apply here.
594
    #bpf-filter: port 80 or udp
595
    # You can use the following variables to activate AF_PACKET tap or IPS mode.
596
    # If copy-mode is set to ips or tap, the traffic coming to the current
597
    # interface will be copied to the copy-iface interface. If 'tap' is set, the
598
    # copy is complete. If 'ips' is set, the packet matching a 'drop' action
599
    # will not be copied.
600
    #copy-mode: ips
601
    #copy-iface: eth1
602

    
603
  # Put default values here. These will be used for an interface that is not
604
  # in the list above.
605
  - interface: default
606
    #threads: auto
607
    #use-mmap: no
608
    #rollover: yes
609
    #tpacket-v3: yes
610

    
611
# Cross platform libpcap capture support
612
pcap:
613
  - interface: eth0
614
    # On Linux, pcap will try to use mmaped capture and will use buffer-size
615
    # as total of memory used by the ring. So set this to something bigger
616
    # than 1% of your bandwidth.
617
    #buffer-size: 16777216
618
    #bpf-filter: "tcp and port 25"
619
    # Choose checksum verification mode for the interface. At the moment
620
    # of the capture, some packets may be with an invalid checksum due to
621
    # offloading to the network card of the checksum computation.
622
    # Possible values are:
623
    #  - yes: checksum validation is forced
624
    #  - no: checksum validation is disabled
625
    #  - auto: suricata uses a statistical approach to detect when
626
    #  checksum off-loading is used. (default)
627
    # Warning: 'checksum-validation' must be set to yes to have any validation
628
    #checksum-checks: auto
629
    # With some accelerator cards using a modified libpcap (like myricom), you
630
    # may want to have the same number of capture threads as the number of capture
631
    # rings. In this case, set up the threads variable to N to start N threads
632
    # listening on the same interface.
633
    #threads: 16
634
    # set to no to disable promiscuous mode:
635
    #promisc: no
636
    # set snaplen, if not set it defaults to MTU if MTU can be known
637
    # via ioctl call and to full capture if not.
638
    #snaplen: 1518
639
  # Put default values here
640
  - interface: default
641
    #checksum-checks: auto
642

    
643
# Settings for reading pcap files
644
pcap-file:
645
  # Possible values are:
646
  #  - yes: checksum validation is forced
647
  #  - no: checksum validation is disabled
648
  #  - auto: suricata uses a statistical approach to detect when
649
  #  checksum off-loading is used. (default)
650
  # Warning: 'checksum-validation' must be set to yes to have checksum tested
651
  checksum-checks: auto
652

    
653
# See "Advanced Capture Options" below for more options, including NETMAP
654
# and PF_RING.
655

    
656

    
657
##
658
## Step 5: App Layer Protocol Configuration
659
##
660

    
661
# Configure the app-layer parsers. The protocols section details each
662
# protocol.
663
#
664
# The option "enabled" takes 3 values - "yes", "no", "detection-only".
665
# "yes" enables both detection and the parser, "no" disables both, and
666
# "detection-only" enables protocol detection only (parser disabled).
667
app-layer:
668
  protocols:
669
    tls:
670
      enabled: yes
671
      detection-ports:
672
        dp: 443
673

    
674
      # Completely stop processing TLS/SSL session after the handshake
675
      # completed. If bypass is enabled this will also trigger flow
676
      # bypass. If disabled (the default), TLS/SSL session is still
677
      # tracked for Heartbleed and other anomalies.
678
      #no-reassemble: yes
679
    dcerpc:
680
      enabled: yes
681
    ftp:
682
      enabled: yes
683
    ssh:
684
      enabled: yes
685
    smtp:
686
      enabled: yes
687
      # Configure SMTP-MIME Decoder
688
      mime:
689
        # Decode MIME messages from SMTP transactions
690
        # (may be resource intensive)
691
        # This field supercedes all others because it turns the entire
692
        # process on or off
693
        decode-mime: yes
694

    
695
        # Decode MIME entity bodies (ie. base64, quoted-printable, etc.)
696
        decode-base64: yes
697
        decode-quoted-printable: yes
698

    
699
        # Maximum bytes per header data value stored in the data structure
700
        # (default is 2000)
701
        header-value-depth: 2000
702

    
703
        # Extract URLs and save in state data structure
704
        extract-urls: yes
705
        # Set to yes to compute the md5 of the mail body. You will then
706
        # be able to journalize it.
707
        body-md5: no
708
      # Configure inspected-tracker for file_data keyword
709
      inspected-tracker:
710
        content-limit: 100000
711
        content-inspect-min-size: 32768
712
        content-inspect-window: 4096
713
    imap:
714
      enabled: detection-only
715
    msn:
716
      enabled: detection-only
717
    smb:
718
      enabled: yes
719
      detection-ports:
720
        dp: 139, 445
721
    # smb2 detection is disabled internally inside the engine.
722
    #smb2:
723
    #  enabled: yes
724
    # Note: NFS parser depends on Rust support: pass --enable-rust
725
    # to configure.
726
    nfs:
727
      enabled: no
728
    dns:
729
      # memcaps. Globally and per flow/state.
730
      #global-memcap: 16mb
731
      #state-memcap: 512kb
732

    
733
      # How many unreplied DNS requests are considered a flood.
734
      # If the limit is reached, app-layer-event:dns.flooded; will match.
735
      #request-flood: 500
736

    
737
      tcp:
738
        enabled: yes
739
        detection-ports:
740
          dp: 53
741
      udp:
742
        enabled: yes
743
        detection-ports:
744
          dp: 53
745
    http:
746
      enabled: yes
747
      # memcap: 64mb
748

    
749
      # default-config:           Used when no server-config matches
750
      #   personality:            List of personalities used by default
751
      #   request-body-limit:     Limit reassembly of request body for inspection
752
      #                           by http_client_body & pcre /P option.
753
      #   response-body-limit:    Limit reassembly of response body for inspection
754
      #                           by file_data, http_server_body & pcre /Q option.
755
      #   double-decode-path:     Double decode path section of the URI
756
      #   double-decode-query:    Double decode query section of the URI
757
      #   response-body-decompress-layer-limit:
758
      #                           Limit to how many layers of compression will be
759
      #                           decompressed. Defaults to 2.
760
      #
761
      # server-config:            List of server configurations to use if address matches
762
      #   address:                List of ip addresses or networks for this block
763
      #   personalitiy:           List of personalities used by this block
764
      #   request-body-limit:     Limit reassembly of request body for inspection
765
      #                           by http_client_body & pcre /P option.
766
      #   response-body-limit:    Limit reassembly of response body for inspection
767
      #                           by file_data, http_server_body & pcre /Q option.
768
      #   double-decode-path:     Double decode path section of the URI
769
      #   double-decode-query:    Double decode query section of the URI
770
      #
771
      #   uri-include-all:        Include all parts of the URI. By default the
772
      #                           'scheme', username/password, hostname and port
773
      #                           are excluded. Setting this option to true adds
774
      #                           all of them to the normalized uri as inspected
775
      #                           by http_uri, urilen, pcre with /U and the other
776
      #                           keywords that inspect the normalized uri.
777
      #                           Note that this does not affect http_raw_uri.
778
      #                           Also, note that including all was the default in
779
      #                           1.4 and 2.0beta1.
780
      #
781
      #   meta-field-limit:       Hard size limit for request and response size
782
      #                           limits. Applies to request line and headers,
783
      #                           response line and headers. Does not apply to
784
      #                           request or response bodies. Default is 18k.
785
      #                           If this limit is reached an event is raised.
786
      #
787
      # Currently Available Personalities:
788
      #   Minimal, Generic, IDS (default), IIS_4_0, IIS_5_0, IIS_5_1, IIS_6_0,
789
      #   IIS_7_0, IIS_7_5, Apache_2
790
      libhtp:
791
         default-config:
792
           personality: IDS
793

    
794
           # Can be specified in kb, mb, gb.  Just a number indicates
795
           # it's in bytes.
796
           request-body-limit: 100kb
797
           response-body-limit: 100kb
798

    
799
           # inspection limits
800
           request-body-minimal-inspect-size: 32kb
801
           request-body-inspect-window: 4kb
802
           response-body-minimal-inspect-size: 40kb
803
           response-body-inspect-window: 16kb
804

    
805
           # response body decompression (0 disables)
806
           response-body-decompress-layer-limit: 2
807

    
808
           # auto will use http-body-inline mode in IPS mode, yes or no set it statically
809
           http-body-inline: auto
810

    
811
           # Take a random value for inspection sizes around the specified value.
812
           # This lower the risk of some evasion technics but could lead
813
           # detection change between runs. It is set to 'yes' by default.
814
           #randomize-inspection-sizes: yes
815
           # If randomize-inspection-sizes is active, the value of various
816
           # inspection size will be choosen in the [1 - range%, 1 + range%]
817
           # range
818
           # Default value of randomize-inspection-range is 10.
819
           #randomize-inspection-range: 10
820

    
821
           # decoding
822
           double-decode-path: no
823
           double-decode-query: no
824

    
825
         server-config:
826

    
827
           #- apache:
828
           #    address: [192.168.1.0/24, 127.0.0.0/8, "::1"]
829
           #    personality: Apache_2
830
           #    # Can be specified in kb, mb, gb.  Just a number indicates
831
           #    # it's in bytes.
832
           #    request-body-limit: 4096
833
           #    response-body-limit: 4096
834
           #    double-decode-path: no
835
           #    double-decode-query: no
836

    
837
           #- iis7:
838
           #    address:
839
           #      - 192.168.0.0/24
840
           #      - 192.168.10.0/24
841
           #    personality: IIS_7_0
842
           #    # Can be specified in kb, mb, gb.  Just a number indicates
843
           #    # it's in bytes.
844
           #    request-body-limit: 4096
845
           #    response-body-limit: 4096
846
           #    double-decode-path: no
847
           #    double-decode-query: no
848

    
849
    # Note: Modbus probe parser is minimalist due to the poor significant field
850
    # Only Modbus message length (greater than Modbus header length)
851
    # And Protocol ID (equal to 0) are checked in probing parser
852
    # It is important to enable detection port and define Modbus port
853
    # to avoid false positive
854
    modbus:
855
      # How many unreplied Modbus requests are considered a flood.
856
      # If the limit is reached, app-layer-event:modbus.flooded; will match.
857
      #request-flood: 500
858

    
859
      enabled: no
860
      detection-ports:
861
        dp: 502
862
      # According to MODBUS Messaging on TCP/IP Implementation Guide V1.0b, it
863
      # is recommended to keep the TCP connection opened with a remote device
864
      # and not to open and close it for each MODBUS/TCP transaction. In that
865
      # case, it is important to set the depth of the stream reassembling as
866
      # unlimited (stream.reassembly.depth: 0)
867

    
868
      # Stream reassembly size for modbus. By default track it completely.
869
      stream-depth: 0
870

    
871
    # DNP3
872
    dnp3:
873
      enabled: no
874
      detection-ports:
875
        dp: 20000
876

    
877
    # SCADA EtherNet/IP and CIP protocol support
878
    enip:
879
      enabled: no
880
      detection-ports:
881
        dp: 44818
882
        sp: 44818
883

    
884
    # Note: parser depends on experimental Rust support
885
    # with --enable-rust-experimental passed to configure
886
    ntp:
887
      enabled: no
888

    
889
# Limit for the maximum number of asn1 frames to decode (default 256)
890
asn1-max-frames: 256
891

    
892

    
893
##############################################################################
894
##
895
## Advanced settings below
896
##
897
##############################################################################
898

    
899
##
900
## Run Options
901
##
902

    
903
# Run suricata as user and group.
904
#run-as:
905
#  user: suri
906
#  group: suri
907

    
908
# Some logging module will use that name in event as identifier. The default
909
# value is the hostname
910
#sensor-name: suricata
911

    
912
# Default location of the pid file. The pid file is only used in
913
# daemon mode (start Suricata with -D). If not running in daemon mode
914
# the --pidfile command line option must be used to create a pid file.
915
#pid-file: /usr/var/run/suricata.pid
916

    
917
# Daemon working directory
918
# Suricata will change directory to this one if provided
919
# Default: "/"
920
#daemon-directory: "/"
921

    
922
# Suricata core dump configuration. Limits the size of the core dump file to
923
# approximately max-dump. The actual core dump size will be a multiple of the
924
# page size. Core dumps that would be larger than max-dump are truncated. On
925
# Linux, the actual core dump size may be a few pages larger than max-dump.
926
# Setting max-dump to 0 disables core dumping.
927
# Setting max-dump to 'unlimited' will give the full core dump file.
928
# On 32-bit Linux, a max-dump value >= ULONG_MAX may cause the core dump size
929
# to be 'unlimited'.
930

    
931
coredump:
932
  max-dump: unlimited
933

    
934
# If suricata box is a router for the sniffed networks, set it to 'router'. If
935
# it is a pure sniffing setup, set it to 'sniffer-only'.
936
# If set to auto, the variable is internally switch to 'router' in IPS mode
937
# and 'sniffer-only' in IDS mode.
938
# This feature is currently only used by the reject* keywords.
939
host-mode: auto
940

    
941
# Number of packets preallocated per thread. The default is 1024. A higher number 
942
# will make sure each CPU will be more easily kept busy, but may negatively 
943
# impact caching.
944
#
945
# If you are using the CUDA pattern matcher (mpm-algo: ac-cuda), different rules
946
# apply. In that case try something like 60000 or more. This is because the CUDA
947
# pattern matcher buffers and scans as many packets as possible in parallel.
948
#max-pending-packets: 1024
949

    
950
# Runmode the engine should use. Please check --list-runmodes to get the available
951
# runmodes for each packet acquisition method. Defaults to "autofp" (auto flow pinned
952
# load balancing).
953
#runmode: autofp
954

    
955
# Specifies the kind of flow load balancer used by the flow pinned autofp mode.
956
#
957
# Supported schedulers are:
958
#
959
# round-robin       - Flows assigned to threads in a round robin fashion.
960
# active-packets    - Flows assigned to threads that have the lowest number of
961
#                     unprocessed packets (default).
962
# hash              - Flow alloted usihng the address hash. More of a random
963
#                     technique. Was the default in Suricata 1.2.1 and older.
964
#
965
#autofp-scheduler: active-packets
966

    
967
# Preallocated size for packet. Default is 1514 which is the classical
968
# size for pcap on ethernet. You should adjust this value to the highest
969
# packet size (MTU + hardware header) on your system.
970
#default-packet-size: 1514
971

    
972
# Unix command socket can be used to pass commands to suricata.
973
# An external tool can then connect to get information from suricata
974
# or trigger some modifications of the engine. Set enabled to yes
975
# to activate the feature. In auto mode, the feature will only be
976
# activated in live capture mode. You can use the filename variable to set
977
# the file name of the socket.
978
unix-command:
979
  enabled: auto
980
  #filename: custom.socket
981

    
982
# Magic file. The extension .mgc is added to the value here.
983
#magic-file: /usr/share/file/magic
984
#magic-file: 
985

    
986
legacy:
987
  uricontent: enabled
988

    
989
##
990
## Detection settings
991
##
992

    
993
# Set the order of alerts bassed on actions
994
# The default order is pass, drop, reject, alert
995
# action-order:
996
#   - pass
997
#   - drop
998
#   - reject
999
#   - alert
1000

    
1001
# IP Reputation
1002
#reputation-categories-file: /etc/config/suricata/suricata/iprep/categories.txt
1003
#default-reputation-path: /etc/config/suricata/suricata/iprep
1004
#reputation-files:
1005
# - reputation.list
1006

    
1007
# When run with the option --engine-analysis, the engine will read each of
1008
# the parameters below, and print reports for each of the enabled sections
1009
# and exit.  The reports are printed to a file in the default log dir
1010
# given by the parameter "default-log-dir", with engine reporting
1011
# subsection below printing reports in its own report file.
1012
engine-analysis:
1013
  # enables printing reports for fast-pattern for every rule.
1014
  rules-fast-pattern: yes
1015
  # enables printing reports for each rule
1016
  rules: yes
1017

    
1018
#recursion and match limits for PCRE where supported
1019
pcre:
1020
  match-limit: 3500
1021
  match-limit-recursion: 1500
1022

    
1023
##
1024
## Advanced Traffic Tracking and Reconstruction Settings
1025
##
1026

    
1027
# Host specific policies for defragmentation and TCP stream
1028
# reassembly. The host OS lookup is done using a radix tree, just
1029
# like a routing table so the most specific entry matches.
1030
host-os-policy:
1031
  # Make the default policy windows.
1032
  windows: [0.0.0.0/0]
1033
  bsd: []
1034
  bsd-right: []
1035
  old-linux: []
1036
  linux: []
1037
  old-solaris: []
1038
  solaris: []
1039
  hpux10: []
1040
  hpux11: []
1041
  irix: []
1042
  macos: []
1043
  vista: []
1044
  windows2k3: []
1045

    
1046
# Defrag settings:
1047

    
1048
defrag:
1049
  memcap: 32mb
1050
  hash-size: 65536
1051
  trackers: 65535 # number of defragmented flows to follow
1052
  max-frags: 65535 # number of fragments to keep (higher than trackers)
1053
  prealloc: yes
1054
  timeout: 60
1055

    
1056
# Enable defrag per host settings
1057
#  host-config:
1058
#
1059
#    - dmz:
1060
#        timeout: 30
1061
#        address: [192.168.1.0/24, 127.0.0.0/8, 1.1.1.0/24, 2.2.2.0/24, "1.1.1.1", "2.2.2.2", "::1"]
1062
#
1063
#    - lan:
1064
#        timeout: 45
1065
#        address:
1066
#          - 192.168.0.0/24
1067
#          - 192.168.10.0/24
1068
#          - 172.16.14.0/24
1069

    
1070
# Flow settings:
1071
# By default, the reserved memory (memcap) for flows is 32MB. This is the limit
1072
# for flow allocation inside the engine. You can change this value to allow
1073
# more memory usage for flows.
1074
# The hash-size determine the size of the hash used to identify flows inside
1075
# the engine, and by default the value is 65536.
1076
# At the startup, the engine can preallocate a number of flows, to get a better
1077
# performance. The number of flows preallocated is 10000 by default.
1078
# emergency-recovery is the percentage of flows that the engine need to
1079
# prune before unsetting the emergency state. The emergency state is activated
1080
# when the memcap limit is reached, allowing to create new flows, but
1081
# prunning them with the emergency timeouts (they are defined below).
1082
# If the memcap is reached, the engine will try to prune flows
1083
# with the default timeouts. If it doens't find a flow to prune, it will set
1084
# the emergency bit and it will try again with more agressive timeouts.
1085
# If that doesn't work, then it will try to kill the last time seen flows
1086
# not in use.
1087
# The memcap can be specified in kb, mb, gb.  Just a number indicates it's
1088
# in bytes.
1089

    
1090
flow:
1091
  memcap: 128mb
1092
  hash-size: 65536
1093
  prealloc: 10000
1094
  emergency-recovery: 30
1095
  #managers: 1 # default to one flow manager
1096
  #recyclers: 1 # default to one flow recycler thread
1097

    
1098
# This option controls the use of vlan ids in the flow (and defrag)
1099
# hashing. Normally this should be enabled, but in some (broken)
1100
# setups where both sides of a flow are not tagged with the same vlan
1101
# tag, we can ignore the vlan id's in the flow hashing.
1102
vlan:
1103
  use-for-tracking: true
1104

    
1105
# Specific timeouts for flows. Here you can specify the timeouts that the
1106
# active flows will wait to transit from the current state to another, on each
1107
# protocol. The value of "new" determine the seconds to wait after a hanshake or
1108
# stream startup before the engine free the data of that flow it doesn't
1109
# change the state to established (usually if we don't receive more packets
1110
# of that flow). The value of "established" is the amount of
1111
# seconds that the engine will wait to free the flow if it spend that amount
1112
# without receiving new packets or closing the connection. "closed" is the
1113
# amount of time to wait after a flow is closed (usually zero). "bypassed"
1114
# timeout controls locally bypassed flows. For these flows we don't do any other
1115
# tracking. If no packets have been seen after this timeout, the flow is discarded.
1116
#
1117
# There's an emergency mode that will become active under attack circumstances,
1118
# making the engine to check flow status faster. This configuration variables
1119
# use the prefix "emergency-" and work similar as the normal ones.
1120
# Some timeouts doesn't apply to all the protocols, like "closed", for udp and
1121
# icmp.
1122

    
1123
flow-timeouts:
1124

    
1125
  default:
1126
    new: 30
1127
    established: 300
1128
    closed: 0
1129
    bypassed: 100
1130
    emergency-new: 10
1131
    emergency-established: 100
1132
    emergency-closed: 0
1133
    emergency-bypassed: 50
1134
  tcp:
1135
    new: 60
1136
    established: 600
1137
    closed: 60
1138
    bypassed: 100
1139
    emergency-new: 5
1140
    emergency-established: 100
1141
    emergency-closed: 10
1142
    emergency-bypassed: 50
1143
  udp:
1144
    new: 30
1145
    established: 300
1146
    bypassed: 100
1147
    emergency-new: 10
1148
    emergency-established: 100
1149
    emergency-bypassed: 50
1150
  icmp:
1151
    new: 30
1152
    established: 300
1153
    bypassed: 100
1154
    emergency-new: 10
1155
    emergency-established: 100
1156
    emergency-bypassed: 50
1157

    
1158
# Stream engine settings. Here the TCP stream tracking and reassembly
1159
# engine is configured.
1160
#
1161
# stream:
1162
#   memcap: 32mb                # Can be specified in kb, mb, gb.  Just a
1163
#                               # number indicates it's in bytes.
1164
#   checksum-validation: yes    # To validate the checksum of received
1165
#                               # packet. If csum validation is specified as
1166
#                               # "yes", then packet with invalid csum will not
1167
#                               # be processed by the engine stream/app layer.
1168
#                               # Warning: locally generated trafic can be
1169
#                               # generated without checksum due to hardware offload
1170
#                               # of checksum. You can control the handling of checksum
1171
#                               # on a per-interface basis via the 'checksum-checks'
1172
#                               # option
1173
#   prealloc-sessions: 2k       # 2k sessions prealloc'd per stream thread
1174
#   midstream: false            # don't allow midstream session pickups
1175
#   async-oneside: false        # don't enable async stream handling
1176
#   inline: no                  # stream inline mode
1177
#   drop-invalid: yes           # in inline mode, drop packets that are invalid with regards to streaming engine
1178
#   max-synack-queued: 5        # Max different SYN/ACKs to queue
1179
#   bypass: no                  # Bypass packets when stream.depth is reached
1180
#
1181
#   reassembly:
1182
#     memcap: 64mb              # Can be specified in kb, mb, gb.  Just a number
1183
#                               # indicates it's in bytes.
1184
#     depth: 1mb                # Can be specified in kb, mb, gb.  Just a number
1185
#                               # indicates it's in bytes.
1186
#     toserver-chunk-size: 2560 # inspect raw stream in chunks of at least
1187
#                               # this size.  Can be specified in kb, mb,
1188
#                               # gb.  Just a number indicates it's in bytes.
1189
#     toclient-chunk-size: 2560 # inspect raw stream in chunks of at least
1190
#                               # this size.  Can be specified in kb, mb,
1191
#                               # gb.  Just a number indicates it's in bytes.
1192
#     randomize-chunk-size: yes # Take a random value for chunk size around the specified value.
1193
#                               # This lower the risk of some evasion technics but could lead
1194
#                               # detection change between runs. It is set to 'yes' by default.
1195
#     randomize-chunk-range: 10 # If randomize-chunk-size is active, the value of chunk-size is
1196
#                               # a random value between (1 - randomize-chunk-range/100)*toserver-chunk-size
1197
#                               # and (1 + randomize-chunk-range/100)*toserver-chunk-size and the same
1198
#                               # calculation for toclient-chunk-size.
1199
#                               # Default value of randomize-chunk-range is 10.
1200
#
1201
#     raw: yes                  # 'Raw' reassembly enabled or disabled.
1202
#                               # raw is for content inspection by detection
1203
#                               # engine.
1204
#
1205
#     segment-prealloc: 2048    # number of segments preallocated per thread
1206
#
1207
#     check-overlap-different-data: true|false
1208
#                               # check if a segment contains different data
1209
#                               # than what we've already seen for that
1210
#                               # position in the stream.
1211
#                               # This is enabled automatically if inline mode
1212
#                               # is used or when stream-event:reassembly_overlap_different_data;
1213
#                               # is used in a rule.
1214
#
1215
stream:
1216
  memcap: 64mb
1217
  checksum-validation: yes      # reject wrong csums
1218
  inline: auto                  # auto will use inline mode in IPS mode, yes or no set it statically
1219
  reassembly:
1220
    memcap: 256mb
1221
    depth: 1mb                  # reassemble 1mb into a stream
1222
    toserver-chunk-size: 2560
1223
    toclient-chunk-size: 2560
1224
    randomize-chunk-size: yes
1225
    #randomize-chunk-range: 10
1226
    #raw: yes
1227
    #segment-prealloc: 2048
1228
    #check-overlap-different-data: true
1229

    
1230
# Host table:
1231
#
1232
# Host table is used by tagging and per host thresholding subsystems.
1233
#
1234
host:
1235
  hash-size: 4096
1236
  prealloc: 1000
1237
  memcap: 32mb
1238

    
1239
# IP Pair table:
1240
#
1241
# Used by xbits 'ippair' tracking.
1242
#
1243
#ippair:
1244
#  hash-size: 4096
1245
#  prealloc: 1000
1246
#  memcap: 32mb
1247

    
1248
# Decoder settings
1249

    
1250
decoder:
1251
  # Teredo decoder is known to not be completely accurate
1252
  # it will sometimes detect non-teredo as teredo.
1253
  teredo:
1254
    enabled: false
1255

    
1256

    
1257
##
1258
## Performance tuning and profiling
1259
##
1260

    
1261
# The detection engine builds internal groups of signatures. The engine
1262
# allow us to specify the profile to use for them, to manage memory on an
1263
# efficient way keeping a good performance. For the profile keyword you
1264
# can use the words "low", "medium", "high" or "custom". If you use custom
1265
# make sure to define the values at "- custom-values" as your convenience.
1266
# Usually you would prefer medium/high/low.
1267
#
1268
# "sgh mpm-context", indicates how the staging should allot mpm contexts for
1269
# the signature groups.  "single" indicates the use of a single context for
1270
# all the signature group heads.  "full" indicates a mpm-context for each
1271
# group head.  "auto" lets the engine decide the distribution of contexts
1272
# based on the information the engine gathers on the patterns from each
1273
# group head.
1274
#
1275
# The option inspection-recursion-limit is used to limit the recursive calls
1276
# in the content inspection code.  For certain payload-sig combinations, we
1277
# might end up taking too much time in the content inspection code.
1278
# If the argument specified is 0, the engine uses an internally defined
1279
# default limit.  On not specifying a value, we use no limits on the recursion.
1280
detect:
1281
  profile: medium
1282
  custom-values:
1283
    toclient-groups: 3
1284
    toserver-groups: 25
1285
  sgh-mpm-context: auto
1286
  inspection-recursion-limit: 3000
1287
  # If set to yes, the loading of signatures will be made after the capture
1288
  # is started. This will limit the downtime in IPS mode.
1289
  #delayed-detect: yes
1290

    
1291
  prefilter:
1292
    # default prefiltering setting. "mpm" only creates MPM/fast_pattern
1293
    # engines. "auto" also sets up prefilter engines for other keywords.
1294
    # Use --list-keywords=all to see which keywords support prefiltering.
1295
    default: mpm
1296

    
1297
  # the grouping values above control how many groups are created per
1298
  # direction. Port whitelisting forces that port to get it's own group.
1299
  # Very common ports will benefit, as well as ports with many expensive
1300
  # rules.
1301
  grouping:
1302
    #tcp-whitelist: 53, 80, 139, 443, 445, 1433, 3306, 3389, 6666, 6667, 8080
1303
    #udp-whitelist: 53, 135, 5060
1304

    
1305
  profiling:
1306
    # Log the rules that made it past the prefilter stage, per packet
1307
    # default is off. The threshold setting determines how many rules
1308
    # must have made it past pre-filter for that rule to trigger the
1309
    # logging.
1310
    #inspect-logging-threshold: 200
1311
    grouping:
1312
      dump-to-disk: false
1313
      include-rules: false      # very verbose
1314
      include-mpm-stats: false
1315

    
1316
# Select the multi pattern algorithm you want to run for scan/search the
1317
# in the engine.
1318
#
1319
# The supported algorithms are:
1320
# "ac"      - Aho-Corasick, default implementation
1321
# "ac-bs"   - Aho-Corasick, reduced memory implementation
1322
# "ac-cuda" - Aho-Corasick, CUDA implementation
1323
# "ac-ks"   - Aho-Corasick, "Ken Steele" variant
1324
# "hs"      - Hyperscan, available when built with Hyperscan support
1325
#
1326
# The default mpm-algo value of "auto" will use "hs" if Hyperscan is
1327
# available, "ac" otherwise.
1328
#
1329
# The mpm you choose also decides the distribution of mpm contexts for
1330
# signature groups, specified by the conf - "detect.sgh-mpm-context".
1331
# Selecting "ac" as the mpm would require "detect.sgh-mpm-context"
1332
# to be set to "single", because of ac's memory requirements, unless the
1333
# ruleset is small enough to fit in one's memory, in which case one can
1334
# use "full" with "ac".  Rest of the mpms can be run in "full" mode.
1335
#
1336
# There is also a CUDA pattern matcher (only available if Suricata was
1337
# compiled with --enable-cuda: b2g_cuda. Make sure to update your
1338
# max-pending-packets setting above as well if you use b2g_cuda.
1339

    
1340
mpm-algo: auto
1341

    
1342
# Select the matching algorithm you want to use for single-pattern searches.
1343
#
1344
# Supported algorithms are "bm" (Boyer-Moore) and "hs" (Hyperscan, only
1345
# available if Suricata has been built with Hyperscan support).
1346
#
1347
# The default of "auto" will use "hs" if available, otherwise "bm".
1348

    
1349
spm-algo: auto
1350

    
1351
# Suricata is multi-threaded. Here the threading can be influenced.
1352
threading:
1353
  set-cpu-affinity: no
1354
  # Tune cpu affinity of threads. Each family of threads can be bound
1355
  # on specific CPUs.
1356
  #
1357
  # These 2 apply to the all runmodes:
1358
  # management-cpu-set is used for flow timeout handling, counters
1359
  # worker-cpu-set is used for 'worker' threads
1360
  #
1361
  # Additionally, for autofp these apply:
1362
  # receive-cpu-set is used for capture threads
1363
  # verdict-cpu-set is used for IPS verdict threads
1364
  #
1365
  cpu-affinity:
1366
    - management-cpu-set:
1367
        cpu: [ 0 ]  # include only these cpus in affinity settings
1368
    - receive-cpu-set:
1369
        cpu: [ 0 ]  # include only these cpus in affinity settings
1370
    - worker-cpu-set:
1371
        cpu: [ "all" ]
1372
        mode: "exclusive"
1373
        # Use explicitely 3 threads and don't compute number by using
1374
        # detect-thread-ratio variable:
1375
        # threads: 3
1376
        prio:
1377
          low: [ 0 ]
1378
          medium: [ "1-2" ]
1379
          high: [ 3 ]
1380
          default: "medium"
1381
    #- verdict-cpu-set:
1382
    #    cpu: [ 0 ]
1383
    #    prio:
1384
    #      default: "high"
1385
  #
1386
  # By default Suricata creates one "detect" thread per available CPU/CPU core.
1387
  # This setting allows controlling this behaviour. A ratio setting of 2 will
1388
  # create 2 detect threads for each CPU/CPU core. So for a dual core CPU this
1389
  # will result in 4 detect threads. If values below 1 are used, less threads
1390
  # are created. So on a dual core CPU a setting of 0.5 results in 1 detect
1391
  # thread being created. Regardless of the setting at a minimum 1 detect
1392
  # thread will always be created.
1393
  #
1394
  detect-thread-ratio: 1.0
1395

    
1396
# Luajit has a strange memory requirement, it's 'states' need to be in the
1397
# first 2G of the process' memory.
1398
#
1399
# 'luajit.states' is used to control how many states are preallocated.
1400
# State use: per detect script: 1 per detect thread. Per output script: 1 per
1401
# script.
1402
luajit:
1403
  states: 128
1404

    
1405
# Profiling settings. Only effective if Suricata has been built with the
1406
# the --enable-profiling configure flag.
1407
#
1408
profiling:
1409
  # Run profiling for every xth packet. The default is 1, which means we
1410
  # profile every packet. If set to 1000, one packet is profiled for every
1411
  # 1000 received.
1412
  #sample-rate: 1000
1413

    
1414
  # rule profiling
1415
  rules:
1416

    
1417
    # Profiling can be disabled here, but it will still have a
1418
    # performance impact if compiled in.
1419
    enabled: yes
1420
    filename: rule_perf.log
1421
    append: yes
1422

    
1423
    # Sort options: ticks, avgticks, checks, matches, maxticks
1424
    # If commented out all the sort options will be used.
1425
    sort: avgticks
1426

    
1427
    # Limit the number of sids for which stats are shown at exit (per sort).
1428
    limit: 10
1429

    
1430
    # output to json
1431
    json: yes
1432

    
1433
  # per keyword profiling
1434
  keywords:
1435
    enabled: yes
1436
    filename: keyword_perf.log
1437
    append: yes
1438

    
1439
  # per rulegroup profiling
1440
  rulegroups:
1441
    enabled: yes
1442
    filename: rule_group_perf.log
1443
    append: yes
1444

    
1445
  # packet profiling
1446
  packets:
1447

    
1448
    # Profiling can be disabled here, but it will still have a
1449
    # performance impact if compiled in.
1450
    enabled: yes
1451
    filename: packet_stats.log
1452
    append: yes
1453

    
1454
    # per packet csv output
1455
    csv:
1456

    
1457
      # Output can be disabled here, but it will still have a
1458
      # performance impact if compiled in.
1459
      enabled: no
1460
      filename: packet_stats.csv
1461

    
1462
  # profiling of locking. Only available when Suricata was built with
1463
  # --enable-profiling-locks.
1464
  locks:
1465
    enabled: no
1466
    filename: lock_stats.log
1467
    append: yes
1468

    
1469
  pcap-log:
1470
    enabled: no
1471
    filename: pcaplog_stats.log
1472
    append: yes
1473

    
1474
##
1475
## Netfilter integration
1476
##
1477

    
1478
# When running in NFQ inline mode, it is possible to use a simulated
1479
# non-terminal NFQUEUE verdict.
1480
# This permit to do send all needed packet to suricata via this a rule:
1481
#        iptables -I FORWARD -m mark ! --mark $MARK/$MASK -j NFQUEUE
1482
# And below, you can have your standard filtering ruleset. To activate
1483
# this mode, you need to set mode to 'repeat'
1484
# If you want packet to be sent to another queue after an ACCEPT decision
1485
# set mode to 'route' and set next-queue value.
1486
# On linux >= 3.1, you can set batchcount to a value > 1 to improve performance
1487
# by processing several packets before sending a verdict (worker runmode only).
1488
# On linux >= 3.6, you can set the fail-open option to yes to have the kernel
1489
# accept the packet if suricata is not able to keep pace.
1490
# bypass mark and mask can be used to implement NFQ bypass. If bypass mark is
1491
# set then the NFQ bypass is activated. Suricata will set the bypass mark/mask
1492
# on packet of a flow that need to be bypassed. The Nefilter ruleset has to
1493
# directly accept all packets of a flow once a packet has been marked.
1494
nfq:
1495
#  mode: accept
1496
#  repeat-mark: 1
1497
#  repeat-mask: 1
1498
#  bypass-mark: 1
1499
#  bypass-mask: 1
1500
#  route-queue: 2
1501
#  batchcount: 20
1502
#  fail-open: yes
1503

    
1504
#nflog support
1505
nflog:
1506
    # netlink multicast group
1507
    # (the same as the iptables --nflog-group param)
1508
    # Group 0 is used by the kernel, so you can't use it
1509
  - group: 2
1510
    # netlink buffer size
1511
    buffer-size: 18432
1512
    # put default value here
1513
  - group: default
1514
    # set number of packet to queue inside kernel
1515
    qthreshold: 1
1516
    # set the delay before flushing packet in the queue inside kernel
1517
    qtimeout: 100
1518
    # netlink max buffer size
1519
    max-size: 20000
1520

    
1521
##
1522
## Advanced Capture Options
1523
##
1524

    
1525
# general settings affecting packet capture
1526
capture:
1527
  # disable NIC offloading. It's restored when Suricata exists.
1528
  # Enabled by default
1529
  #disable-offloading: false
1530
  #
1531
  # disable checksum validation. Same as setting '-k none' on the
1532
  # commandline
1533
  #checksum-validation: none
1534

    
1535
# Netmap support
1536
#
1537
# Netmap operates with NIC directly in driver, so you need FreeBSD wich have
1538
# built-in netmap support or compile and install netmap module and appropriate
1539
# NIC driver on your Linux system.
1540
# To reach maximum throughput disable all receive-, segmentation-,
1541
# checksum- offloadings on NIC.
1542
# Disabling Tx checksum offloading is *required* for connecting OS endpoint
1543
# with NIC endpoint.
1544
# You can find more information at https://github.com/luigirizzo/netmap
1545
#
1546
netmap:
1547
   # To specify OS endpoint add plus sign at the end (e.g. "eth0+")
1548
 - interface: eth2
1549
   # Number of receive threads. "auto" uses number of RSS queues on interface.
1550
   #threads: auto
1551
   # You can use the following variables to activate netmap tap or IPS mode.
1552
   # If copy-mode is set to ips or tap, the traffic coming to the current
1553
   # interface will be copied to the copy-iface interface. If 'tap' is set, the
1554
   # copy is complete. If 'ips' is set, the packet matching a 'drop' action
1555
   # will not be copied.
1556
   # To specify the OS as the copy-iface (so the OS can route packets, or forward
1557
   # to a service running on the same machine) add a plus sign at the end
1558
   # (e.g. "copy-iface: eth0+"). Don't forget to set up a symmetrical eth0+ -> eth0
1559
   # for return packets. Hardware checksumming must be *off* on the interface if
1560
   # using an OS endpoint (e.g. 'ifconfig eth0 -rxcsum -txcsum -rxcsum6 -txcsum6' for FreeBSD
1561
   # or 'ethtool -K eth0 tx off rx off' for Linux).
1562
   #copy-mode: tap
1563
   #copy-iface: eth3
1564
   # Set to yes to disable promiscuous mode
1565
   # disable-promisc: no
1566
   # Choose checksum verification mode for the interface. At the moment
1567
   # of the capture, some packets may be with an invalid checksum due to
1568
   # offloading to the network card of the checksum computation.
1569
   # Possible values are:
1570
   #  - yes: checksum validation is forced
1571
   #  - no: checksum validation is disabled
1572
   #  - auto: suricata uses a statistical approach to detect when
1573
   #  checksum off-loading is used.
1574
   # Warning: 'checksum-validation' must be set to yes to have any validation
1575
   #checksum-checks: auto
1576
   # BPF filter to apply to this interface. The pcap filter syntax apply here.
1577
   #bpf-filter: port 80 or udp
1578
 #- interface: eth3
1579
   #threads: auto
1580
   #copy-mode: tap
1581
   #copy-iface: eth2
1582
   # Put default values here
1583
 - interface: default
1584

    
1585
# PF_RING configuration. for use with native PF_RING support
1586
# for more info see http://www.ntop.org/products/pf_ring/
1587
pfring:
1588
  - interface: eth0
1589
    # Number of receive threads (>1 will enable experimental flow pinned
1590
    # runmode)
1591
    threads: 1
1592

    
1593
    # Default clusterid.  PF_RING will load balance packets based on flow.
1594
    # All threads/processes that will participate need to have the same
1595
    # clusterid.
1596
    cluster-id: 99
1597

    
1598
    # Default PF_RING cluster type. PF_RING can load balance per flow.
1599
    # Possible values are cluster_flow or cluster_round_robin.
1600
    cluster-type: cluster_flow
1601
    # bpf filter for this interface
1602
    #bpf-filter: tcp
1603
    # Choose checksum verification mode for the interface. At the moment
1604
    # of the capture, some packets may be with an invalid checksum due to
1605
    # offloading to the network card of the checksum computation.
1606
    # Possible values are:
1607
    #  - rxonly: only compute checksum for packets received by network card.
1608
    #  - yes: checksum validation is forced
1609
    #  - no: checksum validation is disabled
1610
    #  - auto: suricata uses a statistical approach to detect when
1611
    #  checksum off-loading is used. (default)
1612
    # Warning: 'checksum-validation' must be set to yes to have any validation
1613
    #checksum-checks: auto
1614
  # Second interface
1615
  #- interface: eth1
1616
  #  threads: 3
1617
  #  cluster-id: 93
1618
  #  cluster-type: cluster_flow
1619
  # Put default values here
1620
  - interface: default
1621
    #threads: 2
1622

    
1623
# For FreeBSD ipfw(8) divert(4) support.
1624
# Please make sure you have ipfw_load="YES" and ipdivert_load="YES"
1625
# in /etc/loader.conf or kldload'ing the appropriate kernel modules.
1626
# Additionally, you need to have an ipfw rule for the engine to see
1627
# the packets from ipfw.  For Example:
1628
#
1629
#   ipfw add 100 divert 8000 ip from any to any
1630
#
1631
# The 8000 above should be the same number you passed on the command
1632
# line, i.e. -d 8000
1633
#
1634
ipfw:
1635

    
1636
  # Reinject packets at the specified ipfw rule number.  This config
1637
  # option is the ipfw rule number AT WHICH rule processing continues
1638
  # in the ipfw processing system after the engine has finished
1639
  # inspecting the packet for acceptance.  If no rule number is specified,
1640
  # accepted packets are reinjected at the divert rule which they entered
1641
  # and IPFW rule processing continues.  No check is done to verify
1642
  # this will rule makes sense so care must be taken to avoid loops in ipfw.
1643
  #
1644
  ## The following example tells the engine to reinject packets
1645
  # back into the ipfw firewall AT rule number 5500:
1646
  #
1647
  # ipfw-reinjection-rule-number: 5500
1648

    
1649

    
1650
napatech:
1651
    # The Host Buffer Allowance for all streams
1652
    # (-1 = OFF, 1 - 100 = percentage of the host buffer that can be held back)
1653
    # This may be enabled when sharing streams with another application.
1654
    # Otherwise, it should be turned off.
1655
    hba: -1
1656

    
1657
    # use_all_streams set to "yes" will query the Napatech service for all configured
1658
    # streams and listen on all of them. When set to "no" the streams config array
1659
    # will be used.
1660
    use-all-streams: yes
1661

    
1662
    # The streams to listen on.  This can be either:
1663
    #   a list of individual streams (e.g. streams: [0,1,2,3])
1664
    # or
1665
    #   a range of streams (e.g. streams: ["0-3"])
1666
    streams: ["0-3"]
1667

    
1668
# Tilera mpipe configuration. for use on Tilera TILE-Gx.
1669
mpipe:
1670

    
1671
  # Load balancing modes: "static", "dynamic", "sticky", or "round-robin".
1672
  load-balance: dynamic
1673

    
1674
  # Number of Packets in each ingress packet queue. Must be 128, 512, 2028 or 65536
1675
  iqueue-packets: 2048
1676

    
1677
  # List of interfaces we will listen on.
1678
  inputs:
1679
  - interface: xgbe2
1680
  - interface: xgbe3
1681
  - interface: xgbe4
1682

    
1683

    
1684
  # Relative weight of memory for packets of each mPipe buffer size.
1685
  stack:
1686
    size128: 0
1687
    size256: 9
1688
    size512: 0
1689
    size1024: 0
1690
    size1664: 7
1691
    size4096: 0
1692
    size10386: 0
1693
    size16384: 0
1694

    
1695
##
1696
## Hardware accelaration
1697
##
1698

    
1699
# Cuda configuration.
1700
cuda:
1701
  # The "mpm" profile.  On not specifying any of these parameters, the engine's
1702
  # internal default values are used, which are same as the ones specified in
1703
  # in the default conf file.
1704
  mpm:
1705
    # The minimum length required to buffer data to the gpu.
1706
    # Anything below this is MPM'ed on the CPU.
1707
    # Can be specified in kb, mb, gb.  Just a number indicates it's in bytes.
1708
    # A value of 0 indicates there's no limit.
1709
    data-buffer-size-min-limit: 0
1710
    # The maximum length for data that we would buffer to the gpu.
1711
    # Anything over this is MPM'ed on the CPU.
1712
    # Can be specified in kb, mb, gb.  Just a number indicates it's in bytes.
1713
    data-buffer-size-max-limit: 1500
1714
    # The ring buffer size used by the CudaBuffer API to buffer data.
1715
    cudabuffer-buffer-size: 500mb
1716
    # The max chunk size that can be sent to the gpu in a single go.
1717
    gpu-transfer-size: 50mb
1718
    # The timeout limit for batching of packets in microseconds.
1719
    batching-timeout: 2000
1720
    # The device to use for the mpm.  Currently we don't support load balancing
1721
    # on multiple gpus.  In case you have multiple devices on your system, you
1722
    # can specify the device to use, using this conf.  By default we hold 0, to
1723
    # specify the first device cuda sees.  To find out device-id associated with
1724
    # the card(s) on the system run "suricata --list-cuda-cards".
1725
    device-id: 0
1726
    # No of Cuda streams used for asynchronous processing. All values > 0 are valid.
1727
    # For this option you need a device with Compute Capability > 1.0.
1728
    cuda-streams: 2
1729

    
1730
##
1731
## Include other configs
1732
##
1733

    
1734
# Includes.  Files included here will be handled as if they were
1735
# inlined in this configuration file.
1736
#include: include1.yaml
1737
#include: include2.yaml
(2-2/3)