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