{"id":2568,"date":"2025-02-21T10:36:52","date_gmt":"2025-02-21T09:36:52","guid":{"rendered":"http:\/\/clark.tipistrani.it\/?p=2568"},"modified":"2025-02-21T10:36:52","modified_gmt":"2025-02-21T09:36:52","slug":"suricata-yaml-su-devuan-5","status":"publish","type":"post","link":"http:\/\/clark.tipistrani.it\/?p=2568","title":{"rendered":"suricata.yaml su Devuan 5"},"content":{"rendered":"<p>%YAML 1.1<br \/>\n&#8212;<\/p>\n<p># Suricata configuration file. In addition to the comments describing all<br \/>\n# options in this file, full documentation can be found at:<br \/>\n# https:\/\/suricata.readthedocs.io\/en\/latest\/configuration\/suricata-yaml.html<\/p>\n<p>##<br \/>\n## Step 1: Inform Suricata about your network<br \/>\n##<\/p>\n<p>vars:<br \/>\n# more specific is better for alert accuracy and performance<br \/>\naddress-groups:<br \/>\n#HOME_NET: &#8220;[192.168.0.0\/16,10.0.0.0\/8,172.16.0.0\/12]&#8221;<br \/>\nHOME_NET: &#8220;[192.168.2.0\/23]&#8221;<br \/>\n#HOME_NET: &#8220;[10.0.0.0\/8]&#8221;<br \/>\n#HOME_NET: &#8220;[172.16.0.0\/12]&#8221;<br \/>\n#HOME_NET: &#8220;any&#8221;<\/p>\n<p>EXTERNAL_NET: &#8220;!$HOME_NET&#8221;<br \/>\n#EXTERNAL_NET: &#8220;any&#8221;<\/p>\n<p>HTTP_SERVERS: &#8220;$HOME_NET&#8221;<br \/>\nSMTP_SERVERS: &#8220;$HOME_NET&#8221;<br \/>\nSQL_SERVERS: &#8220;$HOME_NET&#8221;<br \/>\nDNS_SERVERS: &#8220;$HOME_NET&#8221;<br \/>\nTELNET_SERVERS: &#8220;$HOME_NET&#8221;<br \/>\nAIM_SERVERS: &#8220;$EXTERNAL_NET&#8221;<br \/>\nDC_SERVERS: &#8220;$HOME_NET&#8221;<br \/>\nDNP3_SERVER: &#8220;$HOME_NET&#8221;<br \/>\nDNP3_CLIENT: &#8220;$HOME_NET&#8221;<br \/>\nMODBUS_CLIENT: &#8220;$HOME_NET&#8221;<br \/>\nMODBUS_SERVER: &#8220;$HOME_NET&#8221;<br \/>\nENIP_CLIENT: &#8220;$HOME_NET&#8221;<br \/>\nENIP_SERVER: &#8220;$HOME_NET&#8221;<\/p>\n<p>port-groups:<br \/>\nHTTP_PORTS: &#8220;80&#8221;<br \/>\nSHELLCODE_PORTS: &#8220;!80&#8221;<br \/>\nORACLE_PORTS: 1521<br \/>\nSSH_PORTS: 22<br \/>\nDNP3_PORTS: 20000<br \/>\nMODBUS_PORTS: 502<br \/>\nFILE_DATA_PORTS: &#8220;[$HTTP_PORTS,110,143]&#8221;<br \/>\nFTP_PORTS: 21<br \/>\nGENEVE_PORTS: 6081<br \/>\nVXLAN_PORTS: 4789<br \/>\nTEREDO_PORTS: 3544<\/p>\n<p>##<br \/>\n## Step 2: Select outputs to enable<br \/>\n##<\/p>\n<p># The default logging directory. Any log or output file will be<br \/>\n# placed here if it&#8217;s not specified with a full path name. This can be<br \/>\n# overridden with the -l command line parameter.<br \/>\ndefault-log-dir: \/var\/log\/suricata\/<\/p>\n<p># Global stats configuration<br \/>\nstats:<br \/>\nenabled: yes<br \/>\n# The interval field (in seconds) controls the interval at<br \/>\n# which stats are updated in the log.<br \/>\ninterval: 8<br \/>\n# Add decode events to stats.<br \/>\n#decoder-events: true<br \/>\n# Decoder event prefix in stats. Has been &#8216;decoder&#8217; before, but that leads<br \/>\n# to missing events in the eve.stats records. See issue #2225.<br \/>\n#decoder-events-prefix: &#8220;decoder.event&#8221;<br \/>\n# Add stream events as stats.<br \/>\n#stream-events: false<\/p>\n<p># Configure the type of alert (and other) logging you would like.<br \/>\noutputs:<br \/>\n# a line based alerts log similar to Snort&#8217;s fast.log<br \/>\n&#8211; fast:<br \/>\nenabled: yes<br \/>\nfilename: fast.log<br \/>\nappend: yes<br \/>\n#filetype: regular # &#8216;regular&#8217;, &#8216;unix_stream&#8217; or &#8216;unix_dgram&#8217;<\/p>\n<p># Extensible Event Format (nicknamed EVE) event log in JSON format<br \/>\n&#8211; eve-log:<br \/>\nenabled: yes<br \/>\nfiletype: regular #regular|syslog|unix_dgram|unix_stream|redis<br \/>\nfilename: eve.json<br \/>\n# Enable for multi-threaded eve.json output; output files are amended with<br \/>\n# with an identifier, e.g., eve.9.json<br \/>\nthreaded: false<br \/>\n#prefix: &#8220;@cee: &#8221; # prefix to prepend to each log entry<br \/>\n# the following are valid when type: syslog above<br \/>\n#identity: &#8220;suricata&#8221;<br \/>\n#facility: local5<br \/>\n#level: Info ## possible levels: Emergency, Alert, Critical,<br \/>\n## Error, Warning, Notice, Info, Debug<br \/>\n#ethernet: no # log ethernet header in events when available<br \/>\n#redis:<br \/>\n# server: 127.0.0.1<br \/>\n# port: 6379<br \/>\n# async: true ## if redis replies are read asynchronously<br \/>\n# mode: list ## possible values: list|lpush (default), rpush, channel|publish<br \/>\n# ## lpush and rpush are using a Redis list. &#8220;list&#8221; is an alias for lpush<br \/>\n# ## publish is using a Redis channel. &#8220;channel&#8221; is an alias for publish<br \/>\n# key: suricata ## key or channel to use (default to suricata)<br \/>\n# Redis pipelining set up. This will enable to only do a query every<br \/>\n# &#8216;batch-size&#8217; events. This should lower the latency induced by network<br \/>\n# connection at the cost of some memory. There is no flushing implemented<br \/>\n# so this setting should be reserved to high traffic Suricata deployments.<br \/>\n# pipelining:<br \/>\n# enabled: yes ## set enable to yes to enable query pipelining<br \/>\n# batch-size: 10 ## number of entries to keep in buffer<\/p>\n<p># Include top level metadata. Default yes.<br \/>\n#metadata: no<\/p>\n<p># include the name of the input pcap file in pcap file processing mode<br \/>\npcap-file: false<\/p>\n<p># Community Flow ID<br \/>\n# Adds a &#8216;community_id&#8217; field to EVE records. These are meant to give<br \/>\n# records a predictable flow ID that can be used to match records to<br \/>\n# output of other tools such as Zeek (Bro).<br \/>\n#<br \/>\n# Takes a &#8216;seed&#8217; that needs to be same across sensors and tools<br \/>\n# to make the id less predictable.<\/p>\n<p># enable\/disable the community id feature.<br \/>\n#community-id: false<br \/>\ncommunity-id: true<br \/>\n# Seed value for the ID output. Valid values are 0-65535.<br \/>\ncommunity-id-seed: 0<\/p>\n<p># HTTP X-Forwarded-For support by adding an extra field or overwriting<br \/>\n# the source or destination IP address (depending on flow direction)<br \/>\n# with the one reported in the X-Forwarded-For HTTP header. This is<br \/>\n# helpful when reviewing alerts for traffic that is being reverse<br \/>\n# or forward proxied.<br \/>\nxff:<br \/>\nenabled: no<br \/>\n# Two operation modes are available: &#8220;extra-data&#8221; and &#8220;overwrite&#8221;.<br \/>\nmode: extra-data<br \/>\n# Two proxy deployments are supported: &#8220;reverse&#8221; and &#8220;forward&#8221;. In<br \/>\n# a &#8220;reverse&#8221; deployment the IP address used is the last one, in a<br \/>\n# &#8220;forward&#8221; deployment the first IP address is used.<br \/>\ndeployment: reverse<br \/>\n# Header name where the actual IP address will be reported. If more<br \/>\n# than one IP address is present, the last IP address will be the<br \/>\n# one taken into consideration.<br \/>\nheader: X-Forwarded-For<\/p>\n<p>types:<br \/>\n&#8211; alert:<br \/>\n# payload: yes # enable dumping payload in Base64<br \/>\n# payload-buffer-size: 4kb # max size of payload buffer to output in eve-log<br \/>\n# payload-printable: yes # enable dumping payload in printable (lossy) format<br \/>\n# packet: yes # enable dumping of packet (without stream segments)<br \/>\n# metadata: no # enable inclusion of app layer metadata with alert. Default yes<br \/>\n# http-body: yes # Requires metadata; enable dumping of HTTP body in Base64<br \/>\n# http-body-printable: yes # Requires metadata; enable dumping of HTTP body in printable format<\/p>\n<p># Enable the logging of tagged packets for rules using the<br \/>\n# &#8220;tag&#8221; keyword.<br \/>\ntagged-packets: yes<br \/>\n&#8211; anomaly:<br \/>\n# Anomaly log records describe unexpected conditions such<br \/>\n# as truncated packets, packets with invalid IP\/UDP\/TCP<br \/>\n# length values, and other events that render the packet<br \/>\n# invalid for further processing or describe unexpected<br \/>\n# behavior on an established stream. Networks which<br \/>\n# experience high occurrences of anomalies may experience<br \/>\n# packet processing degradation.<br \/>\n#<br \/>\n# Anomalies are reported for the following:<br \/>\n# 1. Decode: Values and conditions that are detected while<br \/>\n# decoding individual packets. This includes invalid or<br \/>\n# unexpected values for low-level protocol lengths as well<br \/>\n# as stream related events (TCP 3-way handshake issues,<br \/>\n# unexpected sequence number, etc).<br \/>\n# 2. Stream: This includes stream related events (TCP<br \/>\n# 3-way handshake issues, unexpected sequence number,<br \/>\n# etc).<br \/>\n# 3. Application layer: These denote application layer<br \/>\n# specific conditions that are unexpected, invalid or are<br \/>\n# unexpected given the application monitoring state.<br \/>\n#<br \/>\n# By default, anomaly logging is enabled. When anomaly<br \/>\n# logging is enabled, applayer anomaly reporting is<br \/>\n# also enabled.<br \/>\nenabled: yes<br \/>\n#<br \/>\n# Choose one or more types of anomaly logging and whether to enable<br \/>\n# logging of the packet header for packet anomalies.<br \/>\ntypes:<br \/>\n# decode: no<br \/>\n# stream: no<br \/>\n# applayer: yes<br \/>\n#packethdr: no<br \/>\n&#8211; http:<br \/>\nextended: yes # enable this for extended logging information<br \/>\n# custom allows additional HTTP fields to be included in eve-log.<br \/>\n# the example below adds three additional fields when uncommented<br \/>\n#custom: [Accept-Encoding, Accept-Language, Authorization]<br \/>\n# set this value to one and only one from {both, request, response}<br \/>\n# to dump all HTTP headers for every HTTP request and\/or response<br \/>\n# dump-all-headers: none<br \/>\n&#8211; dns:<br \/>\n# This configuration uses the new DNS logging format,<br \/>\n# the old configuration is still available:<br \/>\n# https:\/\/suricata.readthedocs.io\/en\/latest\/output\/eve\/eve-json-output.html#dns-v1-format<\/p>\n<p># As of Suricata 5.0, version 2 of the eve dns output<br \/>\n# format is the default.<br \/>\n#version: 2<\/p>\n<p># Enable\/disable this logger. Default: enabled.<br \/>\n#enabled: yes<\/p>\n<p># Control logging of requests and responses:<br \/>\n# &#8211; requests: enable logging of DNS queries<br \/>\n# &#8211; responses: enable logging of DNS answers<br \/>\n# By default both requests and responses are logged.<br \/>\n#requests: no<br \/>\n#responses: no<\/p>\n<p># Format of answer logging:<br \/>\n# &#8211; detailed: array item per answer<br \/>\n# &#8211; grouped: answers aggregated by type<br \/>\n# Default: all<br \/>\n#formats: [detailed, grouped]<\/p>\n<p># DNS record types to log, based on the query type.<br \/>\n# Default: all.<br \/>\n#types: [a, aaaa, cname, mx, ns, ptr, txt]<br \/>\n&#8211; tls:<br \/>\nextended: yes # enable this for extended logging information<br \/>\n# output TLS transaction where the session is resumed using a<br \/>\n# session id<br \/>\n#session-resumption: no<br \/>\n# custom controls which TLS fields that are included in eve-log<br \/>\n#custom: [subject, issuer, session_resumed, serial, fingerprint, sni, version, not_before, not_after, certificate, chain, ja3, ja3s]<br \/>\n&#8211; files:<br \/>\nforce-magic: no # force logging magic on all logged files<br \/>\n# force logging of checksums, available hash functions are md5,<br \/>\n# sha1 and sha256<br \/>\n#force-hash: [md5]<br \/>\n#- drop:<br \/>\n# alerts: yes # log alerts that caused drops<br \/>\n# flows: all # start or all: &#8216;start&#8217; logs only a single drop<br \/>\n# # per flow direction. All logs each dropped pkt.<br \/>\n&#8211; smtp:<br \/>\n#extended: yes # enable this for extended logging information<br \/>\n# this includes: bcc, message-id, subject, x_mailer, user-agent<br \/>\n# custom fields logging from the list:<br \/>\n# reply-to, bcc, message-id, subject, x-mailer, user-agent, received,<br \/>\n# x-originating-ip, in-reply-to, references, importance, priority,<br \/>\n# sensitivity, organization, content-md5, date<br \/>\n#custom: [received, x-mailer, x-originating-ip, relays, reply-to, bcc]<br \/>\n# output md5 of fields: body, subject<br \/>\n# for the body you need to set app-layer.protocols.smtp.mime.body-md5<br \/>\n# to yes<br \/>\n#md5: [body, subject]<\/p>\n<p>#- dnp3<br \/>\n&#8211; ftp<br \/>\n&#8211; rdp<br \/>\n&#8211; nfs<br \/>\n&#8211; smb<br \/>\n&#8211; tftp<br \/>\n&#8211; ikev2<br \/>\n&#8211; dcerpc<br \/>\n&#8211; krb5<br \/>\n&#8211; snmp<br \/>\n&#8211; rfb<br \/>\n&#8211; sip<br \/>\n&#8211; dhcp:<br \/>\nenabled: yes<br \/>\n# When extended mode is on, all DHCP messages are logged<br \/>\n# with full detail. When extended mode is off (the<br \/>\n# default), just enough information to map a MAC address<br \/>\n# to an IP address is logged.<br \/>\nextended: no<br \/>\n&#8211; ssh<br \/>\n&#8211; mqtt:<br \/>\n# passwords: yes # enable output of passwords<br \/>\n# HTTP2 logging. HTTP2 support is currently experimental and<br \/>\n# disabled by default. To enable, uncomment the following line<br \/>\n# and be sure to enable http2 in the app-layer section.<br \/>\n#- http2<br \/>\n&#8211; stats:<br \/>\ntotals: yes # stats for all threads merged together<br \/>\nthreads: no # per thread stats<br \/>\ndeltas: no # include delta values<br \/>\n# bi-directional flows<br \/>\n&#8211; flow<br \/>\n# uni-directional flows<br \/>\n#- netflow<\/p>\n<p># Metadata event type. Triggered whenever a pktvar is saved<br \/>\n# and will include the pktvars, flowvars, flowbits and<br \/>\n# flowints.<br \/>\n#- metadata<\/p>\n<p># a line based log of HTTP requests (no alerts)<br \/>\n&#8211; http-log:<br \/>\nenabled: no<br \/>\nfilename: http.log<br \/>\nappend: yes<br \/>\n#extended: yes # enable this for extended logging information<br \/>\n#custom: yes # enable the custom logging format (defined by customformat)<br \/>\n#customformat: &#8220;%{%D-%H:%M:%S}t.%z %{X-Forwarded-For}i %H %m %h %u %s %B %a:%p -&gt; %A:%P&#8221;<br \/>\n#filetype: regular # &#8216;regular&#8217;, &#8216;unix_stream&#8217; or &#8216;unix_dgram&#8217;<\/p>\n<p># a line based log of TLS handshake parameters (no alerts)<br \/>\n&#8211; tls-log:<br \/>\nenabled: no # Log TLS connections.<br \/>\nfilename: tls.log # File to store TLS logs.<br \/>\nappend: yes<br \/>\n#extended: yes # Log extended information like fingerprint<br \/>\n#custom: yes # enabled the custom logging format (defined by customformat)<br \/>\n#customformat: &#8220;%{%D-%H:%M:%S}t.%z %a:%p -&gt; %A:%P %v %n %d %D&#8221;<br \/>\n#filetype: regular # &#8216;regular&#8217;, &#8216;unix_stream&#8217; or &#8216;unix_dgram&#8217;<br \/>\n# output TLS transaction where the session is resumed using a<br \/>\n# session id<br \/>\n#session-resumption: no<\/p>\n<p># output module to store certificates chain to disk<br \/>\n&#8211; tls-store:<br \/>\nenabled: no<br \/>\n#certs-log-dir: certs # directory to store the certificates files<\/p>\n<p># Packet log&#8230; log packets in pcap format. 3 modes of operation: &#8220;normal&#8221;<br \/>\n# &#8220;multi&#8221; and &#8220;sguil&#8221;.<br \/>\n#<br \/>\n# In normal mode a pcap file &#8220;filename&#8221; is created in the default-log-dir,<br \/>\n# or as specified by &#8220;dir&#8221;.<br \/>\n# In multi mode, a file is created per thread. This will perform much<br \/>\n# better, but will create multiple files where &#8216;normal&#8217; would create one.<br \/>\n# In multi mode the filename takes a few special variables:<br \/>\n# &#8211; %n &#8212; thread number<br \/>\n# &#8211; %i &#8212; thread id<br \/>\n# &#8211; %t &#8212; timestamp (secs or secs.usecs based on &#8216;ts-format&#8217;<br \/>\n# E.g. filename: pcap.%n.%t<br \/>\n#<br \/>\n# Note that it&#8217;s possible to use directories, but the directories are not<br \/>\n# created by Suricata. E.g. filename: pcaps\/%n\/log.%s will log into the<br \/>\n# per thread directory.<br \/>\n#<br \/>\n# Also note that the limit and max-files settings are enforced per thread.<br \/>\n# So the size limit when using 8 threads with 1000mb files and 2000 files<br \/>\n# is: 8*1000*2000 ~ 16TiB.<br \/>\n#<br \/>\n# In Sguil mode &#8220;dir&#8221; indicates the base directory. In this base dir the<br \/>\n# pcaps are created in the directory structure Sguil expects:<br \/>\n#<br \/>\n# $sguil-base-dir\/YYYY-MM-DD\/$filename.&lt;timestamp&gt;<br \/>\n#<br \/>\n# By default all packets are logged except:<br \/>\n# &#8211; TCP streams beyond stream.reassembly.depth<br \/>\n# &#8211; encrypted streams after the key exchange<br \/>\n#<br \/>\n&#8211; pcap-log:<br \/>\nenabled: no<br \/>\nfilename: log.pcap<\/p>\n<p># File size limit. Can be specified in kb, mb, gb. Just a number<br \/>\n# is parsed as bytes.<br \/>\nlimit: 1000mb<\/p>\n<p># If set to a value, ring buffer mode is enabled. Will keep maximum of<br \/>\n# &#8220;max-files&#8221; of size &#8220;limit&#8221;<br \/>\nmax-files: 2000<\/p>\n<p># Compression algorithm for pcap files. Possible values: none, lz4.<br \/>\n# Enabling compression is incompatible with the sguil mode. Note also<br \/>\n# that on Windows, enabling compression will *increase* disk I\/O.<br \/>\ncompression: none<\/p>\n<p># Further options for lz4 compression. The compression level can be set<br \/>\n# to a value between 0 and 16, where higher values result in higher<br \/>\n# compression.<br \/>\n#lz4-checksum: no<br \/>\n#lz4-level: 0<\/p>\n<p>mode: normal # normal, multi or sguil.<\/p>\n<p># Directory to place pcap files. If not provided the default log<br \/>\n# directory will be used. Required for &#8220;sguil&#8221; mode.<br \/>\n#dir: \/nsm_data\/<\/p>\n<p>#ts-format: usec # sec or usec second format (default) is filename.sec usec is filename.sec.usec<br \/>\nuse-stream-depth: no #If set to &#8220;yes&#8221; packets seen after reaching stream inspection depth are ignored. &#8220;no&#8221; logs all packets<br \/>\nhonor-pass-rules: no # If set to &#8220;yes&#8221;, flows in which a pass rule matched will stop being logged.<\/p>\n<p># a full alert log containing much information for signature writers<br \/>\n# or for investigating suspected false positives.<br \/>\n&#8211; alert-debug:<br \/>\nenabled: no<br \/>\nfilename: alert-debug.log<br \/>\nappend: yes<br \/>\n#filetype: regular # &#8216;regular&#8217;, &#8216;unix_stream&#8217; or &#8216;unix_dgram&#8217;<\/p>\n<p># alert output to prelude (https:\/\/www.prelude-siem.org\/) only<br \/>\n# available if Suricata has been compiled with &#8211;enable-prelude<br \/>\n&#8211; alert-prelude:<br \/>\nenabled: no<br \/>\nprofile: suricata<br \/>\nlog-packet-content: no<br \/>\nlog-packet-header: yes<\/p>\n<p># Stats.log contains data from various counters of the Suricata engine.<br \/>\n&#8211; stats:<br \/>\nenabled: yes<br \/>\nfilename: stats.log<br \/>\nappend: yes # append to file (yes) or overwrite it (no)<br \/>\ntotals: yes # stats for all threads merged together<br \/>\nthreads: no # per thread stats<br \/>\n#null-values: yes # print counters that have value 0. Default: no<\/p>\n<p># a line based alerts log similar to fast.log into syslog<br \/>\n&#8211; syslog:<br \/>\nenabled: no<br \/>\n# reported identity to syslog. If omitted the program name (usually<br \/>\n# suricata) will be used.<br \/>\n#identity: &#8220;suricata&#8221;<br \/>\nfacility: local5<br \/>\n#level: Info ## possible levels: Emergency, Alert, Critical,<br \/>\n## Error, Warning, Notice, Info, Debug<\/p>\n<p># Output module for storing files on disk. Files are stored in<br \/>\n# directory names consisting of the first 2 characters of the<br \/>\n# SHA256 of the file. Each file is given its SHA256 as a filename.<br \/>\n#<br \/>\n# When a duplicate file is found, the timestamps on the existing file<br \/>\n# are updated.<br \/>\n#<br \/>\n# Unlike the older filestore, metadata is not written by default<br \/>\n# as each file should already have a &#8220;fileinfo&#8221; record in the<br \/>\n# eve-log. If write-fileinfo is set to yes, then each file will have<br \/>\n# one more associated .json files that consist of the fileinfo<br \/>\n# record. A fileinfo file will be written for each occurrence of the<br \/>\n# file seen using a filename suffix to ensure uniqueness.<br \/>\n#<br \/>\n# To prune the filestore directory see the &#8220;suricatactl filestore<br \/>\n# prune&#8221; command which can delete files over a certain age.<br \/>\n&#8211; file-store:<br \/>\nversion: 2<br \/>\nenabled: no<\/p>\n<p># Set the directory for the filestore. Relative pathnames<br \/>\n# are contained within the &#8220;default-log-dir&#8221;.<br \/>\n#dir: filestore<\/p>\n<p># Write out a fileinfo record for each occurrence of a file.<br \/>\n# Disabled by default as each occurrence is already logged<br \/>\n# as a fileinfo record to the main eve-log.<br \/>\n#write-fileinfo: yes<\/p>\n<p># Force storing of all files. Default: no.<br \/>\n#force-filestore: yes<\/p>\n<p># Override the global stream-depth for sessions in which we want<br \/>\n# to perform file extraction. Set to 0 for unlimited; otherwise,<br \/>\n# must be greater than the global stream-depth value to be used.<br \/>\n#stream-depth: 0<\/p>\n<p># Uncomment the following variable to define how many files can<br \/>\n# remain open for filestore by Suricata. Default value is 0 which<br \/>\n# means files get closed after each write to the file.<br \/>\n#max-open-files: 1000<\/p>\n<p># Force logging of checksums: available hash functions are md5,<br \/>\n# sha1 and sha256. Note that SHA256 is automatically forced by<br \/>\n# the use of this output module as it uses the SHA256 as the<br \/>\n# file naming scheme.<br \/>\n#force-hash: [sha1, md5]<br \/>\n# NOTE: X-Forwarded configuration is ignored if write-fileinfo is disabled<br \/>\n# HTTP X-Forwarded-For support by adding an extra field or overwriting<br \/>\n# the source or destination IP address (depending on flow direction)<br \/>\n# with the one reported in the X-Forwarded-For HTTP header. This is<br \/>\n# helpful when reviewing alerts for traffic that is being reverse<br \/>\n# or forward proxied.<br \/>\nxff:<br \/>\nenabled: no<br \/>\n# Two operation modes are available, &#8220;extra-data&#8221; and &#8220;overwrite&#8221;.<br \/>\nmode: extra-data<br \/>\n# Two proxy deployments are supported, &#8220;reverse&#8221; and &#8220;forward&#8221;. In<br \/>\n# a &#8220;reverse&#8221; deployment the IP address used is the last one, in a<br \/>\n# &#8220;forward&#8221; deployment the first IP address is used.<br \/>\ndeployment: reverse<br \/>\n# Header name where the actual IP address will be reported. If more<br \/>\n# than one IP address is present, the last IP address will be the<br \/>\n# one taken into consideration.<br \/>\nheader: X-Forwarded-For<\/p>\n<p># Log TCP data after stream normalization<br \/>\n# Two types: file or dir:<br \/>\n# &#8211; file logs into a single logfile.<br \/>\n# &#8211; dir creates 2 files per TCP session and stores the raw TCP<br \/>\n# data into them.<br \/>\n# Use &#8216;both&#8217; to enable both file and dir modes.<br \/>\n#<br \/>\n# Note: limited by &#8220;stream.reassembly.depth&#8221;<br \/>\n&#8211; tcp-data:<br \/>\nenabled: no<br \/>\ntype: file<br \/>\nfilename: tcp-data.log<\/p>\n<p># Log HTTP body data after normalization, de-chunking and unzipping.<br \/>\n# Two types: file or dir.<br \/>\n# &#8211; file logs into a single logfile.<br \/>\n# &#8211; dir creates 2 files per HTTP session and stores the<br \/>\n# normalized data into them.<br \/>\n# Use &#8216;both&#8217; to enable both file and dir modes.<br \/>\n#<br \/>\n# Note: limited by the body limit settings<br \/>\n&#8211; http-body-data:<br \/>\nenabled: no<br \/>\ntype: file<br \/>\nfilename: http-data.log<\/p>\n<p># Lua Output Support &#8211; execute lua script to generate alert and event<br \/>\n# output.<br \/>\n# Documented at:<br \/>\n# https:\/\/suricata.readthedocs.io\/en\/latest\/output\/lua-output.html<br \/>\n&#8211; lua:<br \/>\nenabled: no<br \/>\n#scripts-dir: \/etc\/suricata\/lua-output\/<br \/>\nscripts:<br \/>\n# &#8211; script1.lua<\/p>\n<p># Logging configuration. This is not about logging IDS alerts\/events, but<br \/>\n# output about what Suricata is doing, like startup messages, errors, etc.<br \/>\nlogging:<br \/>\n# The default log level: can be overridden in an output section.<br \/>\n# Note that debug level logging will only be emitted if Suricata was<br \/>\n# compiled with the &#8211;enable-debug configure option.<br \/>\n#<br \/>\n# This value is overridden by the SC_LOG_LEVEL env var.<br \/>\ndefault-log-level: notice<\/p>\n<p># The default output format. Optional parameter, should default to<br \/>\n# something reasonable if not provided. Can be overridden in an<br \/>\n# output section. You can leave this out to get the default.<br \/>\n#<br \/>\n# This value is overridden by the SC_LOG_FORMAT env var.<br \/>\n#default-log-format: &#8220;[%i] %t &#8211; (%f:%l) &lt;%d&gt; (%n) &#8212; &#8221;<\/p>\n<p># A regex to filter output. Can be overridden in an output section.<br \/>\n# Defaults to empty (no filter).<br \/>\n#<br \/>\n# This value is overridden by the SC_LOG_OP_FILTER env var.<br \/>\ndefault-output-filter:<\/p>\n<p># Define your logging outputs. If none are defined, or they are all<br \/>\n# disabled you will get the default: console output.<br \/>\noutputs:<br \/>\n&#8211; console:<br \/>\nenabled: yes<br \/>\n# type: json<br \/>\n&#8211; file:<br \/>\nenabled: yes<br \/>\nlevel: info<br \/>\nfilename: suricata.log<br \/>\n# type: json<br \/>\n&#8211; syslog:<br \/>\nenabled: no<br \/>\nfacility: local5<br \/>\nformat: &#8220;[%i] &lt;%d&gt; &#8212; &#8221;<br \/>\n# type: json<\/p>\n<p>##<br \/>\n## Step 3: Configure common capture settings<br \/>\n##<br \/>\n## See &#8220;Advanced Capture Options&#8221; below for more options, including Netmap<br \/>\n## and PF_RING.<br \/>\n##<\/p>\n<p># Linux high speed capture support<br \/>\naf-packet:<br \/>\n&#8211; interface: eth0<br \/>\n# Number of receive threads. &#8220;auto&#8221; uses the number of cores<br \/>\n#threads: auto<br \/>\n# Default clusterid. AF_PACKET will load balance packets based on flow.<br \/>\ncluster-id: 99<br \/>\n# Default AF_PACKET cluster type. AF_PACKET can load balance per flow or per hash.<br \/>\n# This is only supported for Linux kernel &gt; 3.1<br \/>\n# possible value are:<br \/>\n# * cluster_flow: all packets of a given flow are sent to the same socket<br \/>\n# * cluster_cpu: all packets treated in kernel by a CPU are sent to the same socket<br \/>\n# * cluster_qm: all packets linked by network card to a RSS queue are sent to the same<br \/>\n# socket. Requires at least Linux 3.14.<br \/>\n# * cluster_ebpf: eBPF file load balancing. See doc\/userguide\/capture-hardware\/ebpf-xdp.rst for<br \/>\n# more info.<br \/>\n# Recommended modes are cluster_flow on most boxes and cluster_cpu or cluster_qm on system<br \/>\n# with capture card using RSS (requires cpu affinity tuning and system IRQ tuning)<br \/>\ncluster-type: cluster_flow<br \/>\n# In some fragmentation cases, the hash can not be computed. If &#8220;defrag&#8221; is set<br \/>\n# to yes, the kernel will do the needed defragmentation before sending the packets.<br \/>\ndefrag: yes<br \/>\n# To use the ring feature of AF_PACKET, set &#8216;use-mmap&#8217; to yes<br \/>\n#use-mmap: yes<br \/>\n# Lock memory map to avoid it being swapped. Be careful that over<br \/>\n# subscribing could lock your system<br \/>\n#mmap-locked: yes<br \/>\n# Use tpacket_v3 capture mode, only active if use-mmap is true<br \/>\n# Don&#8217;t use it in IPS or TAP mode as it causes severe latency<br \/>\n#tpacket-v3: yes<br \/>\n# Ring size will be computed with respect to &#8220;max-pending-packets&#8221; and number<br \/>\n# of threads. You can set manually the ring size in number of packets by setting<br \/>\n# the following value. If you are using flow &#8220;cluster-type&#8221; and have really network<br \/>\n# intensive single-flow you may want to set the &#8220;ring-size&#8221; independently of the number<br \/>\n# of threads:<br \/>\n#ring-size: 2048<br \/>\n# Block size is used by tpacket_v3 only. It should set to a value high enough to contain<br \/>\n# a decent number of packets. Size is in bytes so please consider your MTU. It should be<br \/>\n# a power of 2 and it must be multiple of page size (usually 4096).<br \/>\n#block-size: 32768<br \/>\n# tpacket_v3 block timeout: an open block is passed to userspace if it is not<br \/>\n# filled after block-timeout milliseconds.<br \/>\n#block-timeout: 10<br \/>\n# On busy systems, set it to yes to help recover from a packet drop<br \/>\n# phase. This will result in some packets (at max a ring flush) not being inspected.<br \/>\n#use-emergency-flush: yes<br \/>\n# recv buffer size, increased value could improve performance<br \/>\n# buffer-size: 32768<br \/>\n# Set to yes to disable promiscuous mode<br \/>\n# disable-promisc: no<br \/>\n# Choose checksum verification mode for the interface. At the moment<br \/>\n# of the capture, some packets may have an invalid checksum due to<br \/>\n# the checksum computation being offloaded to the network card.<br \/>\n# Possible values are:<br \/>\n# &#8211; kernel: use indication sent by kernel for each packet (default)<br \/>\n# &#8211; yes: checksum validation is forced<br \/>\n# &#8211; no: checksum validation is disabled<br \/>\n# &#8211; auto: Suricata uses a statistical approach to detect when<br \/>\n# checksum off-loading is used.<br \/>\n# Warning: &#8216;capture.checksum-validation&#8217; must be set to yes to have any validation<br \/>\n#checksum-checks: kernel<br \/>\n# BPF filter to apply to this interface. The pcap filter syntax applies here.<br \/>\n#bpf-filter: port 80 or udp<br \/>\n# You can use the following variables to activate AF_PACKET tap or IPS mode.<br \/>\n# If copy-mode is set to ips or tap, the traffic coming to the current<br \/>\n# interface will be copied to the copy-iface interface. If &#8216;tap&#8217; is set, the<br \/>\n# copy is complete. If &#8216;ips&#8217; is set, the packet matching a &#8216;drop&#8217; action<br \/>\n# will not be copied.<br \/>\n#copy-mode: ips<br \/>\n#copy-iface: eth1<br \/>\n# For eBPF and XDP setup including bypass, filter and load balancing, please<br \/>\n# see doc\/userguide\/capture-hardware\/ebpf-xdp.rst for more info.<\/p>\n<p># Put default values here. These will be used for an interface that is not<br \/>\n# in the list above.<br \/>\n&#8211; interface: default<br \/>\n#threads: auto<br \/>\n#use-mmap: no<br \/>\n#tpacket-v3: yes<br \/>\n### le due righe sotto sono state aggiunte in data 21\/02\/25<br \/>\ndetect-engine:<br \/>\n-rule-reload:true<br \/>\n# Cross platform libpcap capture support<br \/>\npcap:<br \/>\n&#8211; interface: eth0<br \/>\n# On Linux, pcap will try to use mmap&#8217;ed capture and will use &#8220;buffer-size&#8221;<br \/>\n# as total memory used by the ring. So set this to something bigger<br \/>\n# than 1% of your bandwidth.<br \/>\n#buffer-size: 16777216<br \/>\n#bpf-filter: &#8220;tcp and port 25&#8221;<br \/>\n# Choose checksum verification mode for the interface. At the moment<br \/>\n# of the capture, some packets may have an invalid checksum due to<br \/>\n# the checksum computation being offloaded to the network card.<br \/>\n# Possible values are:<br \/>\n# &#8211; yes: checksum validation is forced<br \/>\n# &#8211; no: checksum validation is disabled<br \/>\n# &#8211; auto: Suricata uses a statistical approach to detect when<br \/>\n# checksum off-loading is used. (default)<br \/>\n# Warning: &#8216;capture.checksum-validation&#8217; must be set to yes to have any validation<br \/>\n#checksum-checks: auto<br \/>\n# With some accelerator cards using a modified libpcap (like Myricom), you<br \/>\n# may want to have the same number of capture threads as the number of capture<br \/>\n# rings. In this case, set up the threads variable to N to start N threads<br \/>\n# listening on the same interface.<br \/>\n#threads: 16<br \/>\n# set to no to disable promiscuous mode:<br \/>\n#promisc: no<br \/>\n# set snaplen, if not set it defaults to MTU if MTU can be known<br \/>\n# via ioctl call and to full capture if not.<br \/>\n#snaplen: 1518<br \/>\n# Put default values here<br \/>\n&#8211; interface: default<br \/>\n#checksum-checks: auto<\/p>\n<p># Settings for reading pcap files<br \/>\npcap-file:<br \/>\n# Possible values are:<br \/>\n# &#8211; yes: checksum validation is forced<br \/>\n# &#8211; no: checksum validation is disabled<br \/>\n# &#8211; auto: Suricata uses a statistical approach to detect when<br \/>\n# checksum off-loading is used. (default)<br \/>\n# Warning: &#8216;checksum-validation&#8217; must be set to yes to have checksum tested<br \/>\nchecksum-checks: auto<\/p>\n<p># See &#8220;Advanced Capture Options&#8221; below for more options, including Netmap<br \/>\n# and PF_RING.<\/p>\n<p>##<br \/>\n## Step 4: App Layer Protocol configuration<br \/>\n##<\/p>\n<p># Configure the app-layer parsers. The protocol&#8217;s section details each<br \/>\n# protocol.<br \/>\n#<br \/>\n# The option &#8220;enabled&#8221; takes 3 values &#8211; &#8220;yes&#8221;, &#8220;no&#8221;, &#8220;detection-only&#8221;.<br \/>\n# &#8220;yes&#8221; enables both detection and the parser, &#8220;no&#8221; disables both, and<br \/>\n# &#8220;detection-only&#8221; enables protocol detection only (parser disabled).<br \/>\napp-layer:<br \/>\nprotocols:<br \/>\nrfb:<br \/>\nenabled: yes<br \/>\ndetection-ports:<br \/>\ndp: 5900, 5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909<br \/>\n# MQTT, disabled by default.<br \/>\nmqtt:<br \/>\n# enabled: no<br \/>\n# max-msg-length: 1mb<br \/>\nenabled: yes<br \/>\nmax-msg-length: 1mb<br \/>\nkrb5:<br \/>\nenabled: yes<br \/>\nsnmp:<br \/>\nenabled: yes<br \/>\nikev2:<br \/>\nenabled: yes<br \/>\ntls:<br \/>\nenabled: yes<br \/>\ndetection-ports:<br \/>\ndp: 443<\/p>\n<p># Generate JA3 fingerprint from client hello. If not specified it<br \/>\n# will be disabled by default, but enabled if rules require it.<br \/>\n#ja3-fingerprints: auto<\/p>\n<p># What to do when the encrypted communications start:<br \/>\n# &#8211; default: keep tracking TLS session, check for protocol anomalies,<br \/>\n# inspect tls_* keywords. Disables inspection of unmodified<br \/>\n# &#8216;content&#8217; signatures.<br \/>\n# &#8211; bypass: stop processing this flow as much as possible. No further<br \/>\n# TLS parsing and inspection. Offload flow bypass to kernel<br \/>\n# or hardware if possible.<br \/>\n# &#8211; full: keep tracking and inspection as normal. Unmodified content<br \/>\n# keyword signatures are inspected as well.<br \/>\n#<br \/>\n# For best performance, select &#8216;bypass&#8217;.<br \/>\n#<br \/>\n#encryption-handling: default<\/p>\n<p>dcerpc:<br \/>\nenabled: yes<br \/>\nftp:<br \/>\nenabled: yes<br \/>\n# memcap: 64mb<br \/>\nrdp:<br \/>\n#enabled: yes<br \/>\nenabled: yes<br \/>\nssh:<br \/>\nenabled: yes<br \/>\n#hassh: yes<br \/>\n# HTTP2: Experimental HTTP 2 support. Disabled by default.<br \/>\nhttp2:<br \/>\nenabled: no<br \/>\nsmtp:<br \/>\nenabled: yes<br \/>\nraw-extraction: no<br \/>\n# Configure SMTP-MIME Decoder<br \/>\nmime:<br \/>\n# Decode MIME messages from SMTP transactions<br \/>\n# (may be resource intensive)<br \/>\n# This field supersedes all others because it turns the entire<br \/>\n# process on or off<br \/>\ndecode-mime: yes<\/p>\n<p># Decode MIME entity bodies (ie. Base64, quoted-printable, etc.)<br \/>\ndecode-base64: yes<br \/>\ndecode-quoted-printable: yes<\/p>\n<p># Maximum bytes per header data value stored in the data structure<br \/>\n# (default is 2000)<br \/>\nheader-value-depth: 2000<\/p>\n<p># Extract URLs and save in state data structure<br \/>\nextract-urls: yes<br \/>\n# Set to yes to compute the md5 of the mail body. You will then<br \/>\n# be able to journalize it.<br \/>\nbody-md5: no<br \/>\n# Configure inspected-tracker for file_data keyword<br \/>\ninspected-tracker:<br \/>\ncontent-limit: 100000<br \/>\ncontent-inspect-min-size: 32768<br \/>\ncontent-inspect-window: 4096<br \/>\nimap:<br \/>\nenabled: detection-only<br \/>\nsmb:<br \/>\nenabled: yes<br \/>\ndetection-ports:<br \/>\ndp: 139, 445<\/p>\n<p># Stream reassembly size for SMB streams. By default track it completely.<br \/>\n#stream-depth: 0<\/p>\n<p>nfs:<br \/>\nenabled: yes<br \/>\ntftp:<br \/>\nenabled: yes<br \/>\ndns:<br \/>\ntcp:<br \/>\nenabled: yes<br \/>\ndetection-ports:<br \/>\ndp: 53<br \/>\nudp:<br \/>\nenabled: yes<br \/>\ndetection-ports:<br \/>\ndp: 53<br \/>\nhttp:<br \/>\nenabled: yes<br \/>\n# memcap: Maximum memory capacity for HTTP<br \/>\n# Default is unlimited, values can be 64mb, e.g.<\/p>\n<p># default-config: Used when no server-config matches<br \/>\n# personality: List of personalities used by default<br \/>\n# request-body-limit: Limit reassembly of request body for inspection<br \/>\n# by http_client_body &amp; pcre \/P option.<br \/>\n# response-body-limit: Limit reassembly of response body for inspection<br \/>\n# by file_data, http_server_body &amp; pcre \/Q option.<br \/>\n#<br \/>\n# For advanced options, see the user guide<\/p>\n<p># server-config: List of server configurations to use if address matches<br \/>\n# address: List of IP addresses or networks for this block<br \/>\n# personality: List of personalities used by this block<br \/>\n#<br \/>\n# Then, all the fields from default-config can be overloaded<br \/>\n#<br \/>\n# Currently Available Personalities:<br \/>\n# Minimal, Generic, IDS (default), IIS_4_0, IIS_5_0, IIS_5_1, IIS_6_0,<br \/>\n# IIS_7_0, IIS_7_5, Apache_2<br \/>\nlibhtp:<br \/>\ndefault-config:<br \/>\npersonality: IDS<\/p>\n<p># Can be specified in kb, mb, gb. Just a number indicates<br \/>\n# it&#8217;s in bytes.<br \/>\nrequest-body-limit: 100kb<br \/>\nresponse-body-limit: 100kb<\/p>\n<p># inspection limits<br \/>\nrequest-body-minimal-inspect-size: 32kb<br \/>\nrequest-body-inspect-window: 4kb<br \/>\nresponse-body-minimal-inspect-size: 40kb<br \/>\nresponse-body-inspect-window: 16kb<\/p>\n<p># response body decompression (0 disables)<br \/>\nresponse-body-decompress-layer-limit: 2<\/p>\n<p># auto will use http-body-inline mode in IPS mode, yes or no set it statically<br \/>\nhttp-body-inline: auto<\/p>\n<p># Decompress SWF files.<br \/>\n# Two types: &#8216;deflate&#8217;, &#8216;lzma&#8217;, &#8216;both&#8217; will decompress deflate and lzma<br \/>\n# compress-depth:<br \/>\n# Specifies the maximum amount of data to decompress,<br \/>\n# set 0 for unlimited.<br \/>\n# decompress-depth:<br \/>\n# Specifies the maximum amount of decompressed data to obtain,<br \/>\n# set 0 for unlimited.<br \/>\nswf-decompression:<br \/>\nenabled: yes<br \/>\ntype: both<br \/>\ncompress-depth: 0<br \/>\ndecompress-depth: 0<\/p>\n<p># Use a random value for inspection sizes around the specified value.<br \/>\n# This lowers the risk of some evasion techniques but could lead<br \/>\n# to detection change between runs. It is set to &#8216;yes&#8217; by default.<br \/>\n#randomize-inspection-sizes: yes<br \/>\n# If &#8220;randomize-inspection-sizes&#8221; is active, the value of various<br \/>\n# inspection size will be chosen from the [1 &#8211; range%, 1 + range%]<br \/>\n# range<br \/>\n# Default value of &#8220;randomize-inspection-range&#8221; is 10.<br \/>\n#randomize-inspection-range: 10<\/p>\n<p># decoding<br \/>\ndouble-decode-path: no<br \/>\ndouble-decode-query: no<\/p>\n<p># Can enable LZMA decompression<br \/>\n#lzma-enabled: false<br \/>\n# Memory limit usage for LZMA decompression dictionary<br \/>\n# Data is decompressed until dictionary reaches this size<br \/>\n#lzma-memlimit: 1mb<br \/>\n# Maximum decompressed size with a compression ratio<br \/>\n# above 2048 (only LZMA can reach this ratio, deflate cannot)<br \/>\n#compression-bomb-limit: 1mb<\/p>\n<p>server-config:<\/p>\n<p>#- apache:<br \/>\n# address: [192.168.1.0\/24, 127.0.0.0\/8, &#8220;::1&#8221;]<br \/>\n# personality: Apache_2<br \/>\n# # Can be specified in kb, mb, gb. Just a number indicates<br \/>\n# # it&#8217;s in bytes.<br \/>\n# request-body-limit: 4096<br \/>\n# response-body-limit: 4096<br \/>\n# double-decode-path: no<br \/>\n# double-decode-query: no<\/p>\n<p>#- iis7:<br \/>\n# address:<br \/>\n# &#8211; 192.168.0.0\/24<br \/>\n# &#8211; 192.168.10.0\/24<br \/>\n# personality: IIS_7_0<br \/>\n# # Can be specified in kb, mb, gb. Just a number indicates<br \/>\n# # it&#8217;s in bytes.<br \/>\n# request-body-limit: 4096<br \/>\n# response-body-limit: 4096<br \/>\n# double-decode-path: no<br \/>\n# double-decode-query: no<\/p>\n<p># Note: Modbus probe parser is minimalist due to the limited usage in the field.<br \/>\n# Only Modbus message length (greater than Modbus header length)<br \/>\n# and protocol ID (equal to 0) are checked in probing parser<br \/>\n# It is important to enable detection port and define Modbus port<br \/>\n# to avoid false positives<br \/>\nmodbus:<br \/>\n# How many unanswered Modbus requests are considered a flood.<br \/>\n# If the limit is reached, the app-layer-event:modbus.flooded; will match.<br \/>\n#request-flood: 500<\/p>\n<p>enabled: no<br \/>\ndetection-ports:<br \/>\ndp: 502<br \/>\n# According to MODBUS Messaging on TCP\/IP Implementation Guide V1.0b, it<br \/>\n# is recommended to keep the TCP connection opened with a remote device<br \/>\n# and not to open and close it for each MODBUS\/TCP transaction. In that<br \/>\n# case, it is important to set the depth of the stream reassembling as<br \/>\n# unlimited (stream.reassembly.depth: 0)<\/p>\n<p># Stream reassembly size for modbus. By default track it completely.<br \/>\nstream-depth: 0<\/p>\n<p># DNP3<br \/>\ndnp3:<br \/>\nenabled: no<br \/>\ndetection-ports:<br \/>\ndp: 20000<\/p>\n<p># SCADA EtherNet\/IP and CIP protocol support<br \/>\nenip:<br \/>\nenabled: no<br \/>\ndetection-ports:<br \/>\ndp: 44818<br \/>\nsp: 44818<\/p>\n<p>ntp:<br \/>\nenabled: yes<\/p>\n<p>dhcp:<br \/>\nenabled: yes<\/p>\n<p>sip:<br \/>\n#enabled: no<br \/>\nenabled: yes<br \/>\n# Limit for the maximum number of asn1 frames to decode (default 256)<br \/>\nasn1-max-frames: 256<\/p>\n<p># Datasets default settings<br \/>\n# datasets:<br \/>\n# # Default fallback memcap and hashsize values for datasets in case these<br \/>\n# # were not explicitly defined.<br \/>\n# defaults:<br \/>\n# memcap: 100mb<br \/>\n# hashsize: 2048<\/p>\n<p>##############################################################################<br \/>\n##<br \/>\n## Advanced settings below<br \/>\n##<br \/>\n##############################################################################<\/p>\n<p>##<br \/>\n## Run Options<br \/>\n##<\/p>\n<p># Run Suricata with a specific user-id and group-id:<br \/>\n#run-as:<br \/>\n# user: suri<br \/>\n# group: suri<\/p>\n<p># Some logging modules will use that name in event as identifier. The default<br \/>\n# value is the hostname<br \/>\n#sensor-name: suricata<\/p>\n<p># Default location of the pid file. The pid file is only used in<br \/>\n# daemon mode (start Suricata with -D). If not running in daemon mode<br \/>\n# the &#8211;pidfile command line option must be used to create a pid file.<br \/>\n#pid-file: \/var\/run\/suricata.pid<\/p>\n<p># Daemon working directory<br \/>\n# Suricata will change directory to this one if provided<br \/>\n# Default: &#8220;\/&#8221;<br \/>\n#daemon-directory: &#8220;\/&#8221;<\/p>\n<p># Umask.<br \/>\n# Suricata will use this umask if it is provided. By default it will use the<br \/>\n# umask passed on by the shell.<br \/>\n#umask: 022<\/p>\n<p># Suricata core dump configuration. Limits the size of the core dump file to<br \/>\n# approximately max-dump. The actual core dump size will be a multiple of the<br \/>\n# page size. Core dumps that would be larger than max-dump are truncated. On<br \/>\n# Linux, the actual core dump size may be a few pages larger than max-dump.<br \/>\n# Setting max-dump to 0 disables core dumping.<br \/>\n# Setting max-dump to &#8216;unlimited&#8217; will give the full core dump file.<br \/>\n# On 32-bit Linux, a max-dump value &gt;= ULONG_MAX may cause the core dump size<br \/>\n# to be &#8216;unlimited&#8217;.<\/p>\n<p>coredump:<br \/>\nmax-dump: unlimited<\/p>\n<p># If the Suricata box is a router for the sniffed networks, set it to &#8216;router&#8217;. If<br \/>\n# it is a pure sniffing setup, set it to &#8216;sniffer-only&#8217;.<br \/>\n# If set to auto, the variable is internally switched to &#8216;router&#8217; in IPS mode<br \/>\n# and &#8216;sniffer-only&#8217; in IDS mode.<br \/>\n# This feature is currently only used by the reject* keywords.<br \/>\nhost-mode: auto<\/p>\n<p># Number of packets preallocated per thread. The default is 1024. A higher number<br \/>\n# will make sure each CPU will be more easily kept busy, but may negatively<br \/>\n# impact caching.<br \/>\n#max-pending-packets: 1024<\/p>\n<p># Runmode the engine should use. Please check &#8211;list-runmodes to get the available<br \/>\n# runmodes for each packet acquisition method. Default depends on selected capture<br \/>\n# method. &#8216;workers&#8217; generally gives best performance.<br \/>\n#runmode: autofp<\/p>\n<p># Specifies the kind of flow load balancer used by the flow pinned autofp mode.<br \/>\n#<br \/>\n# Supported schedulers are:<br \/>\n#<br \/>\n# hash &#8211; Flow assigned to threads using the 5-7 tuple hash.<br \/>\n# ippair &#8211; Flow assigned to threads using addresses only.<br \/>\n#<br \/>\n#autofp-scheduler: hash<\/p>\n<p># Preallocated size for each packet. Default is 1514 which is the classical<br \/>\n# size for pcap on Ethernet. You should adjust this value to the highest<br \/>\n# packet size (MTU + hardware header) on your system.<br \/>\n#default-packet-size: 1514<\/p>\n<p># Unix command socket that can be used to pass commands to Suricata.<br \/>\n# An external tool can then connect to get information from Suricata<br \/>\n# or trigger some modifications of the engine. Set enabled to yes<br \/>\n# to activate the feature. In auto mode, the feature will only be<br \/>\n# activated in live capture mode. You can use the filename variable to set<br \/>\n# the file name of the socket.<br \/>\nunix-command:<br \/>\nenabled: yes<br \/>\nfilename: \/var\/run\/suricata\/suricata-command.socket<\/p>\n<p># Magic file. The extension .mgc is added to the value here.<br \/>\n#magic-file: \/usr\/share\/file\/magic<br \/>\n#magic-file:<\/p>\n<p># GeoIP2 database file. Specify path and filename of GeoIP2 database<br \/>\n# if using rules with &#8220;geoip&#8221; rule option.<br \/>\n#geoip-database: \/usr\/local\/share\/GeoLite2\/GeoLite2-Country.mmdb<\/p>\n<p>legacy:<br \/>\nuricontent: enabled<\/p>\n<p>##<br \/>\n## Detection settings<br \/>\n##<\/p>\n<p># Set the order of alerts based on actions<br \/>\n# The default order is pass, drop, reject, alert<br \/>\n# action-order:<br \/>\n# &#8211; pass<br \/>\n# &#8211; drop<br \/>\n# &#8211; reject<br \/>\n# &#8211; alert<\/p>\n<p># IP Reputation<br \/>\n#reputation-categories-file: \/etc\/suricata\/iprep\/categories.txt<br \/>\n#default-reputation-path: \/etc\/suricata\/iprep<br \/>\n#reputation-files:<br \/>\n# &#8211; reputation.list<\/p>\n<p># When run with the option &#8211;engine-analysis, the engine will read each of<br \/>\n# the parameters below, and print reports for each of the enabled sections<br \/>\n# and exit. The reports are printed to a file in the default log dir<br \/>\n# given by the parameter &#8220;default-log-dir&#8221;, with engine reporting<br \/>\n# subsection below printing reports in its own report file.<br \/>\nengine-analysis:<br \/>\n# enables printing reports for fast-pattern for every rule.<br \/>\nrules-fast-pattern: yes<br \/>\n# enables printing reports for each rule<br \/>\nrules: yes<\/p>\n<p>#recursion and match limits for PCRE where supported<br \/>\npcre:<br \/>\nmatch-limit: 3500<br \/>\nmatch-limit-recursion: 1500<\/p>\n<p>##<br \/>\n## Advanced Traffic Tracking and Reconstruction Settings<br \/>\n##<\/p>\n<p># Host specific policies for defragmentation and TCP stream<br \/>\n# reassembly. The host OS lookup is done using a radix tree, just<br \/>\n# like a routing table so the most specific entry matches.<br \/>\nhost-os-policy:<br \/>\n# Make the default policy windows.<br \/>\nwindows: [0.0.0.0\/0]<br \/>\nbsd: []<br \/>\nbsd-right: []<br \/>\nold-linux: []<br \/>\nlinux: []<br \/>\nold-solaris: []<br \/>\nsolaris: []<br \/>\nhpux10: []<br \/>\nhpux11: []<br \/>\nirix: []<br \/>\nmacos: []<br \/>\nvista: []<br \/>\nwindows2k3: []<\/p>\n<p># Defrag settings:<\/p>\n<p>defrag:<br \/>\nmemcap: 32mb<br \/>\nhash-size: 65536<br \/>\ntrackers: 65535 # number of defragmented flows to follow<br \/>\nmax-frags: 65535 # number of fragments to keep (higher than trackers)<br \/>\nprealloc: yes<br \/>\ntimeout: 60<\/p>\n<p># Enable defrag per host settings<br \/>\n# host-config:<br \/>\n#<br \/>\n# &#8211; dmz:<br \/>\n# timeout: 30<br \/>\n# address: [192.168.1.0\/24, 127.0.0.0\/8, 1.1.1.0\/24, 2.2.2.0\/24, &#8220;1.1.1.1&#8221;, &#8220;2.2.2.2&#8221;, &#8220;::1&#8221;]<br \/>\n#<br \/>\n# &#8211; lan:<br \/>\n# timeout: 45<br \/>\n# address:<br \/>\n# &#8211; 192.168.0.0\/24<br \/>\n# &#8211; 192.168.10.0\/24<br \/>\n# &#8211; 172.16.14.0\/24<\/p>\n<p># Flow settings:<br \/>\n# By default, the reserved memory (memcap) for flows is 32MB. This is the limit<br \/>\n# for flow allocation inside the engine. You can change this value to allow<br \/>\n# more memory usage for flows.<br \/>\n# The hash-size determines the size of the hash used to identify flows inside<br \/>\n# the engine, and by default the value is 65536.<br \/>\n# At startup, the engine can preallocate a number of flows, to get better<br \/>\n# performance. The number of flows preallocated is 10000 by default.<br \/>\n# emergency-recovery is the percentage of flows that the engine needs to<br \/>\n# prune before clearing the emergency state. The emergency state is activated<br \/>\n# when the memcap limit is reached, allowing new flows to be created, but<br \/>\n# pruning them with the emergency timeouts (they are defined below).<br \/>\n# If the memcap is reached, the engine will try to prune flows<br \/>\n# with the default timeouts. If it doesn&#8217;t find a flow to prune, it will set<br \/>\n# the emergency bit and it will try again with more aggressive timeouts.<br \/>\n# If that doesn&#8217;t work, then it will try to kill the oldest flows using<br \/>\n# last time seen flows.<br \/>\n# The memcap can be specified in kb, mb, gb. Just a number indicates it&#8217;s<br \/>\n# in bytes.<\/p>\n<p>flow:<br \/>\nmemcap: 128mb<br \/>\nhash-size: 65536<br \/>\nprealloc: 10000<br \/>\nemergency-recovery: 30<br \/>\n#managers: 1 # default to one flow manager<br \/>\n#recyclers: 1 # default to one flow recycler thread<\/p>\n<p># This option controls the use of VLAN ids in the flow (and defrag)<br \/>\n# hashing. Normally this should be enabled, but in some (broken)<br \/>\n# setups where both sides of a flow are not tagged with the same VLAN<br \/>\n# tag, we can ignore the VLAN id&#8217;s in the flow hashing.<br \/>\nvlan:<br \/>\nuse-for-tracking: true<\/p>\n<p># Specific timeouts for flows. Here you can specify the timeouts that the<br \/>\n# active flows will wait to transit from the current state to another, on each<br \/>\n# protocol. The value of &#8220;new&#8221; determines the seconds to wait after a handshake or<br \/>\n# stream startup before the engine frees the data of that flow it doesn&#8217;t<br \/>\n# change the state to established (usually if we don&#8217;t receive more packets<br \/>\n# of that flow). The value of &#8220;established&#8221; is the amount of<br \/>\n# seconds that the engine will wait to free the flow if that time elapses<br \/>\n# without receiving new packets or closing the connection. &#8220;closed&#8221; is the<br \/>\n# amount of time to wait after a flow is closed (usually zero). &#8220;bypassed&#8221;<br \/>\n# timeout controls locally bypassed flows. For these flows we don&#8217;t do any other<br \/>\n# tracking. If no packets have been seen after this timeout, the flow is discarded.<br \/>\n#<br \/>\n# There&#8217;s an emergency mode that will become active under attack circumstances,<br \/>\n# making the engine to check flow status faster. This configuration variables<br \/>\n# use the prefix &#8220;emergency-&#8221; and work similar as the normal ones.<br \/>\n# Some timeouts doesn&#8217;t apply to all the protocols, like &#8220;closed&#8221;, for udp and<br \/>\n# icmp.<\/p>\n<p>flow-timeouts:<\/p>\n<p>default:<br \/>\nnew: 30<br \/>\nestablished: 300<br \/>\nclosed: 0<br \/>\nbypassed: 100<br \/>\nemergency-new: 10<br \/>\nemergency-established: 100<br \/>\nemergency-closed: 0<br \/>\nemergency-bypassed: 50<br \/>\ntcp:<br \/>\nnew: 60<br \/>\nestablished: 600<br \/>\nclosed: 60<br \/>\nbypassed: 100<br \/>\nemergency-new: 5<br \/>\nemergency-established: 100<br \/>\nemergency-closed: 10<br \/>\nemergency-bypassed: 50<br \/>\nudp:<br \/>\nnew: 30<br \/>\nestablished: 300<br \/>\nbypassed: 100<br \/>\nemergency-new: 10<br \/>\nemergency-established: 100<br \/>\nemergency-bypassed: 50<br \/>\nicmp:<br \/>\nnew: 30<br \/>\nestablished: 300<br \/>\nbypassed: 100<br \/>\nemergency-new: 10<br \/>\nemergency-established: 100<br \/>\nemergency-bypassed: 50<\/p>\n<p># Stream engine settings. Here the TCP stream tracking and reassembly<br \/>\n# engine is configured.<br \/>\n#<br \/>\n# stream:<br \/>\n# memcap: 32mb # Can be specified in kb, mb, gb. Just a<br \/>\n# # number indicates it&#8217;s in bytes.<br \/>\n# checksum-validation: yes # To validate the checksum of received<br \/>\n# # packet. If csum validation is specified as<br \/>\n# # &#8220;yes&#8221;, then packets with invalid csum values will not<br \/>\n# # be processed by the engine stream\/app layer.<br \/>\n# # Warning: locally generated traffic can be<br \/>\n# # generated without checksum due to hardware offload<br \/>\n# # of checksum. You can control the handling of checksum<br \/>\n# # on a per-interface basis via the &#8216;checksum-checks&#8217;<br \/>\n# # option<br \/>\n# prealloc-sessions: 2k # 2k sessions prealloc&#8217;d per stream thread<br \/>\n# midstream: false # don&#8217;t allow midstream session pickups<br \/>\n# async-oneside: false # don&#8217;t enable async stream handling<br \/>\n# inline: no # stream inline mode<br \/>\n# drop-invalid: yes # in inline mode, drop packets that are invalid with regards to streaming engine<br \/>\n# max-synack-queued: 5 # Max different SYN\/ACKs to queue<br \/>\n# bypass: no # Bypass packets when stream.reassembly.depth is reached.<br \/>\n# # Warning: first side to reach this triggers<br \/>\n# # the bypass.<br \/>\n#<br \/>\n# reassembly:<br \/>\n# memcap: 64mb # Can be specified in kb, mb, gb. Just a number<br \/>\n# # indicates it&#8217;s in bytes.<br \/>\n# depth: 1mb # Can be specified in kb, mb, gb. Just a number<br \/>\n# # indicates it&#8217;s in bytes.<br \/>\n# toserver-chunk-size: 2560 # inspect raw stream in chunks of at least<br \/>\n# # this size. Can be specified in kb, mb,<br \/>\n# # gb. Just a number indicates it&#8217;s in bytes.<br \/>\n# toclient-chunk-size: 2560 # inspect raw stream in chunks of at least<br \/>\n# # this size. Can be specified in kb, mb,<br \/>\n# # gb. Just a number indicates it&#8217;s in bytes.<br \/>\n# randomize-chunk-size: yes # Take a random value for chunk size around the specified value.<br \/>\n# # This lowers the risk of some evasion techniques but could lead<br \/>\n# # to detection change between runs. It is set to &#8216;yes&#8217; by default.<br \/>\n# randomize-chunk-range: 10 # If randomize-chunk-size is active, the value of chunk-size is<br \/>\n# # a random value between (1 &#8211; randomize-chunk-range\/100)*toserver-chunk-size<br \/>\n# # and (1 + randomize-chunk-range\/100)*toserver-chunk-size and the same<br \/>\n# # calculation for toclient-chunk-size.<br \/>\n# # Default value of randomize-chunk-range is 10.<br \/>\n#<br \/>\n# raw: yes # &#8216;Raw&#8217; reassembly enabled or disabled.<br \/>\n# # raw is for content inspection by detection<br \/>\n# # engine.<br \/>\n#<br \/>\n# segment-prealloc: 2048 # number of segments preallocated per thread<br \/>\n#<br \/>\n# check-overlap-different-data: true|false<br \/>\n# # check if a segment contains different data<br \/>\n# # than what we&#8217;ve already seen for that<br \/>\n# # position in the stream.<br \/>\n# # This is enabled automatically if inline mode<br \/>\n# # is used or when stream-event:reassembly_overlap_different_data;<br \/>\n# # is used in a rule.<br \/>\n#<br \/>\nstream:<br \/>\nmemcap: 64mb<br \/>\nchecksum-validation: yes # reject incorrect csums<br \/>\ninline: auto # auto will use inline mode in IPS mode, yes or no set it statically<br \/>\nreassembly:<br \/>\nmemcap: 256mb<br \/>\ndepth: 1mb # reassemble 1mb into a stream<br \/>\ntoserver-chunk-size: 2560<br \/>\ntoclient-chunk-size: 2560<br \/>\nrandomize-chunk-size: yes<br \/>\n#randomize-chunk-range: 10<br \/>\n#raw: yes<br \/>\n#segment-prealloc: 2048<br \/>\n#check-overlap-different-data: true<\/p>\n<p># Host table:<br \/>\n#<br \/>\n# Host table is used by the tagging and per host thresholding subsystems.<br \/>\n#<br \/>\nhost:<br \/>\nhash-size: 4096<br \/>\nprealloc: 1000<br \/>\nmemcap: 32mb<\/p>\n<p># IP Pair table:<br \/>\n#<br \/>\n# Used by xbits &#8216;ippair&#8217; tracking.<br \/>\n#<br \/>\n#ippair:<br \/>\n# hash-size: 4096<br \/>\n# prealloc: 1000<br \/>\n# memcap: 32mb<\/p>\n<p># Decoder settings<\/p>\n<p>decoder:<br \/>\n# Teredo decoder is known to not be completely accurate<br \/>\n# as it will sometimes detect non-teredo as teredo.<br \/>\nteredo:<br \/>\nenabled: true<br \/>\n# ports to look for Teredo. Max 4 ports. If no ports are given, or<br \/>\n# the value is set to &#8216;any&#8217;, Teredo detection runs on _all_ UDP packets.<br \/>\nports: $TEREDO_PORTS # syntax: &#8216;[3544, 1234]&#8217; or &#8216;3533&#8217; or &#8216;any&#8217;.<\/p>\n<p># VXLAN decoder is assigned to up to 4 UDP ports. By default only the<br \/>\n# IANA assigned port 4789 is enabled.<br \/>\nvxlan:<br \/>\nenabled: true<br \/>\nports: $VXLAN_PORTS # syntax: &#8216;[8472, 4789]&#8217; or &#8216;4789&#8217;.<\/p>\n<p># Geneve decoder is assigned to up to 4 UDP ports. By default only the<br \/>\n# IANA assigned port 6081 is enabled.<br \/>\ngeneve:<br \/>\nenabled: true<br \/>\nports: $GENEVE_PORTS # syntax: &#8216;[6081, 1234]&#8217; or &#8216;6081&#8217;.<\/p>\n<p>##<br \/>\n## Performance tuning and profiling<br \/>\n##<\/p>\n<p># The detection engine builds internal groups of signatures. The engine<br \/>\n# allows us to specify the profile to use for them, to manage memory in an<br \/>\n# efficient way keeping good performance. For the profile keyword you<br \/>\n# can use the words &#8220;low&#8221;, &#8220;medium&#8221;, &#8220;high&#8221; or &#8220;custom&#8221;. If you use custom,<br \/>\n# make sure to define the values in the &#8220;custom-values&#8221; section.<br \/>\n# Usually you would prefer medium\/high\/low.<br \/>\n#<br \/>\n# &#8220;sgh mpm-context&#8221;, indicates how the staging should allot mpm contexts for<br \/>\n# the signature groups. &#8220;single&#8221; indicates the use of a single context for<br \/>\n# all the signature group heads. &#8220;full&#8221; indicates a mpm-context for each<br \/>\n# group head. &#8220;auto&#8221; lets the engine decide the distribution of contexts<br \/>\n# based on the information the engine gathers on the patterns from each<br \/>\n# group head.<br \/>\n#<br \/>\n# The option inspection-recursion-limit is used to limit the recursive calls<br \/>\n# in the content inspection code. For certain payload-sig combinations, we<br \/>\n# might end up taking too much time in the content inspection code.<br \/>\n# If the argument specified is 0, the engine uses an internally defined<br \/>\n# default limit. When a value is not specified, there are no limits on the recursion.<br \/>\ndetect:<br \/>\nprofile: medium<br \/>\ncustom-values:<br \/>\ntoclient-groups: 3<br \/>\ntoserver-groups: 25<br \/>\nsgh-mpm-context: auto<br \/>\ninspection-recursion-limit: 3000<br \/>\n# If set to yes, the loading of signatures will be made after the capture<br \/>\n# is started. This will limit the downtime in IPS mode.<br \/>\n#delayed-detect: yes<\/p>\n<p>prefilter:<br \/>\n# default prefiltering setting. &#8220;mpm&#8221; only creates MPM\/fast_pattern<br \/>\n# engines. &#8220;auto&#8221; also sets up prefilter engines for other keywords.<br \/>\n# Use &#8211;list-keywords=all to see which keywords support prefiltering.<br \/>\ndefault: mpm<\/p>\n<p># the grouping values above control how many groups are created per<br \/>\n# direction. Port whitelisting forces that port to get its own group.<br \/>\n# Very common ports will benefit, as well as ports with many expensive<br \/>\n# rules.<br \/>\ngrouping:<br \/>\n#tcp-whitelist: 53, 80, 139, 443, 445, 1433, 3306, 3389, 6666, 6667, 8080<br \/>\n#udp-whitelist: 53, 135, 5060<\/p>\n<p>profiling:<br \/>\n# Log the rules that made it past the prefilter stage, per packet<br \/>\n# default is off. The threshold setting determines how many rules<br \/>\n# must have made it past pre-filter for that rule to trigger the<br \/>\n# logging.<br \/>\n#inspect-logging-threshold: 200<br \/>\ngrouping:<br \/>\ndump-to-disk: false<br \/>\ninclude-rules: false # very verbose<br \/>\ninclude-mpm-stats: false<\/p>\n<p># Select the multi pattern algorithm you want to run for scan\/search the<br \/>\n# in the engine.<br \/>\n#<br \/>\n# The supported algorithms are:<br \/>\n# &#8220;ac&#8221; &#8211; Aho-Corasick, default implementation<br \/>\n# &#8220;ac-bs&#8221; &#8211; Aho-Corasick, reduced memory implementation<br \/>\n# &#8220;ac-ks&#8221; &#8211; Aho-Corasick, &#8220;Ken Steele&#8221; variant<br \/>\n# &#8220;hs&#8221; &#8211; Hyperscan, available when built with Hyperscan support<br \/>\n#<br \/>\n# The default mpm-algo value of &#8220;auto&#8221; will use &#8220;hs&#8221; if Hyperscan is<br \/>\n# available, &#8220;ac&#8221; otherwise.<br \/>\n#<br \/>\n# The mpm you choose also decides the distribution of mpm contexts for<br \/>\n# signature groups, specified by the conf &#8211; &#8220;detect.sgh-mpm-context&#8221;.<br \/>\n# Selecting &#8220;ac&#8221; as the mpm would require &#8220;detect.sgh-mpm-context&#8221;<br \/>\n# to be set to &#8220;single&#8221;, because of ac&#8217;s memory requirements, unless the<br \/>\n# ruleset is small enough to fit in memory, in which case one can<br \/>\n# use &#8220;full&#8221; with &#8220;ac&#8221;. The rest of the mpms can be run in &#8220;full&#8221; mode.<\/p>\n<p>mpm-algo: auto<\/p>\n<p># Select the matching algorithm you want to use for single-pattern searches.<br \/>\n#<br \/>\n# Supported algorithms are &#8220;bm&#8221; (Boyer-Moore) and &#8220;hs&#8221; (Hyperscan, only<br \/>\n# available if Suricata has been built with Hyperscan support).<br \/>\n#<br \/>\n# The default of &#8220;auto&#8221; will use &#8220;hs&#8221; if available, otherwise &#8220;bm&#8221;.<\/p>\n<p>spm-algo: auto<\/p>\n<p># Suricata is multi-threaded. Here the threading can be influenced.<br \/>\nthreading:<br \/>\nset-cpu-affinity: no<br \/>\n# Tune cpu affinity of threads. Each family of threads can be bound<br \/>\n# to specific CPUs.<br \/>\n#<br \/>\n# These 2 apply to the all runmodes:<br \/>\n# management-cpu-set is used for flow timeout handling, counters<br \/>\n# worker-cpu-set is used for &#8216;worker&#8217; threads<br \/>\n#<br \/>\n# Additionally, for autofp these apply:<br \/>\n# receive-cpu-set is used for capture threads<br \/>\n# verdict-cpu-set is used for IPS verdict threads<br \/>\n#<br \/>\ncpu-affinity:<br \/>\n&#8211; management-cpu-set:<br \/>\ncpu: [ 0 ] # include only these CPUs in affinity settings<br \/>\n&#8211; receive-cpu-set:<br \/>\ncpu: [ 0 ] # include only these CPUs in affinity settings<br \/>\n&#8211; worker-cpu-set:<br \/>\ncpu: [ &#8220;all&#8221; ]<br \/>\nmode: &#8220;exclusive&#8221;<br \/>\n# Use explicitly 3 threads and don&#8217;t compute number by using<br \/>\n# detect-thread-ratio variable:<br \/>\n# threads: 3<br \/>\nprio:<br \/>\nlow: [ 0 ]<br \/>\nmedium: [ &#8220;1-2&#8221; ]<br \/>\nhigh: [ 3 ]<br \/>\ndefault: &#8220;medium&#8221;<br \/>\n#- verdict-cpu-set:<br \/>\n# cpu: [ 0 ]<br \/>\n# prio:<br \/>\n# default: &#8220;high&#8221;<br \/>\n#<br \/>\n# By default Suricata creates one &#8220;detect&#8221; thread per available CPU\/CPU core.<br \/>\n# This setting allows controlling this behaviour. A ratio setting of 2 will<br \/>\n# create 2 detect threads for each CPU\/CPU core. So for a dual core CPU this<br \/>\n# will result in 4 detect threads. If values below 1 are used, less threads<br \/>\n# are created. So on a dual core CPU a setting of 0.5 results in 1 detect<br \/>\n# thread being created. Regardless of the setting at a minimum 1 detect<br \/>\n# thread will always be created.<br \/>\n#<br \/>\ndetect-thread-ratio: 1.0<\/p>\n<p># Luajit has a strange memory requirement, its &#8216;states&#8217; need to be in the<br \/>\n# first 2G of the process&#8217; memory.<br \/>\n#<br \/>\n# &#8216;luajit.states&#8217; is used to control how many states are preallocated.<br \/>\n# State use: per detect script: 1 per detect thread. Per output script: 1 per<br \/>\n# script.<br \/>\nluajit:<br \/>\nstates: 128<\/p>\n<p># Profiling settings. Only effective if Suricata has been built with<br \/>\n# the &#8211;enable-profiling configure flag.<br \/>\n#<br \/>\nprofiling:<br \/>\n# Run profiling for every X-th packet. The default is 1, which means we<br \/>\n# profile every packet. If set to 1000, one packet is profiled for every<br \/>\n# 1000 received.<br \/>\n#sample-rate: 1000<\/p>\n<p># rule profiling<br \/>\nrules:<\/p>\n<p># Profiling can be disabled here, but it will still have a<br \/>\n# performance impact if compiled in.<br \/>\nenabled: yes<br \/>\nfilename: rule_perf.log<br \/>\nappend: yes<\/p>\n<p># Sort options: ticks, avgticks, checks, matches, maxticks<br \/>\n# If commented out all the sort options will be used.<br \/>\n#sort: avgticks<\/p>\n<p># Limit the number of sids for which stats are shown at exit (per sort).<br \/>\nlimit: 10<\/p>\n<p># output to json<br \/>\njson: yes<\/p>\n<p># per keyword profiling<br \/>\nkeywords:<br \/>\nenabled: yes<br \/>\nfilename: keyword_perf.log<br \/>\nappend: yes<\/p>\n<p>prefilter:<br \/>\nenabled: yes<br \/>\nfilename: prefilter_perf.log<br \/>\nappend: yes<\/p>\n<p># per rulegroup profiling<br \/>\nrulegroups:<br \/>\nenabled: yes<br \/>\nfilename: rule_group_perf.log<br \/>\nappend: yes<\/p>\n<p># packet profiling<br \/>\npackets:<\/p>\n<p># Profiling can be disabled here, but it will still have a<br \/>\n# performance impact if compiled in.<br \/>\nenabled: yes<br \/>\nfilename: packet_stats.log<br \/>\nappend: yes<\/p>\n<p># per packet csv output<br \/>\ncsv:<\/p>\n<p># Output can be disabled here, but it will still have a<br \/>\n# performance impact if compiled in.<br \/>\nenabled: no<br \/>\nfilename: packet_stats.csv<\/p>\n<p># profiling of locking. Only available when Suricata was built with<br \/>\n# &#8211;enable-profiling-locks.<br \/>\nlocks:<br \/>\nenabled: no<br \/>\nfilename: lock_stats.log<br \/>\nappend: yes<\/p>\n<p>pcap-log:<br \/>\nenabled: no<br \/>\nfilename: pcaplog_stats.log<br \/>\nappend: yes<\/p>\n<p>##<br \/>\n## Netfilter integration<br \/>\n##<\/p>\n<p># When running in NFQ inline mode, it is possible to use a simulated<br \/>\n# non-terminal NFQUEUE verdict.<br \/>\n# This permits sending all needed packet to Suricata via this rule:<br \/>\n# iptables -I FORWARD -m mark ! &#8211;mark $MARK\/$MASK -j NFQUEUE<br \/>\n# And below, you can have your standard filtering ruleset. To activate<br \/>\n# this mode, you need to set mode to &#8216;repeat&#8217;<br \/>\n# If you want a packet to be sent to another queue after an ACCEPT decision<br \/>\n# set the mode to &#8216;route&#8217; and set next-queue value.<br \/>\n# On Linux &gt;= 3.1, you can set batchcount to a value &gt; 1 to improve performance<br \/>\n# by processing several packets before sending a verdict (worker runmode only).<br \/>\n# On Linux &gt;= 3.6, you can set the fail-open option to yes to have the kernel<br \/>\n# accept the packet if Suricata is not able to keep pace.<br \/>\n# bypass mark and mask can be used to implement NFQ bypass. If bypass mark is<br \/>\n# set then the NFQ bypass is activated. Suricata will set the bypass mark\/mask<br \/>\n# on packet of a flow that need to be bypassed. The Nefilter ruleset has to<br \/>\n# directly accept all packets of a flow once a packet has been marked.<br \/>\nnfq:<br \/>\nmode: accept<br \/>\n# repeat-mark: 1<br \/>\n# repeat-mask: 1<br \/>\n# bypass-mark: 1<br \/>\n# bypass-mask: 1<br \/>\n# route-queue: 2<br \/>\n# batchcount: 20<br \/>\n# fail-open: yes<\/p>\n<p>#nflog support<br \/>\nnflog:<br \/>\n# netlink multicast group<br \/>\n# (the same as the iptables &#8211;nflog-group param)<br \/>\n# Group 0 is used by the kernel, so you can&#8217;t use it<br \/>\n&#8211; group: 2<br \/>\n# netlink buffer size<br \/>\nbuffer-size: 18432<br \/>\n# put default value here<br \/>\n&#8211; group: default<br \/>\n# set number of packets to queue inside kernel<br \/>\nqthreshold: 1<br \/>\n# set the delay before flushing packet in the kernel&#8217;s queue<br \/>\nqtimeout: 100<br \/>\n# netlink max buffer size<br \/>\nmax-size: 20000<\/p>\n<p>##<br \/>\n## Advanced Capture Options<br \/>\n##<\/p>\n<p># General settings affecting packet capture<br \/>\ncapture:<br \/>\n# disable NIC offloading. It&#8217;s restored when Suricata exits.<br \/>\n# Enabled by default.<br \/>\n#disable-offloading: false<br \/>\n#<br \/>\n# disable checksum validation. Same as setting &#8216;-k none&#8217; on the<br \/>\n# commandline.<br \/>\n#checksum-validation: none<\/p>\n<p># Netmap support<br \/>\n#<br \/>\n# Netmap operates with NIC directly in driver, so you need FreeBSD 11+ which has<br \/>\n# built-in Netmap support or compile and install the Netmap module and appropriate<br \/>\n# NIC driver for your Linux system.<br \/>\n# To reach maximum throughput disable all receive-, segmentation-,<br \/>\n# checksum- offloading on your NIC (using ethtool or similar).<br \/>\n# Disabling TX checksum offloading is *required* for connecting OS endpoint<br \/>\n# with NIC endpoint.<br \/>\n# You can find more information at https:\/\/github.com\/luigirizzo\/netmap<br \/>\n#<br \/>\nnetmap:<br \/>\n# To specify OS endpoint add plus sign at the end (e.g. &#8220;eth0+&#8221;)<br \/>\n&#8211; interface: eth2<br \/>\n# Number of capture threads. &#8220;auto&#8221; uses number of RSS queues on interface.<br \/>\n# Warning: unless the RSS hashing is symmetrical, this will lead to<br \/>\n# accuracy issues.<br \/>\n#threads: auto<br \/>\n# You can use the following variables to activate netmap tap or IPS mode.<br \/>\n# If copy-mode is set to ips or tap, the traffic coming to the current<br \/>\n# interface will be copied to the copy-iface interface. If &#8216;tap&#8217; is set, the<br \/>\n# copy is complete. If &#8216;ips&#8217; is set, the packet matching a &#8216;drop&#8217; action<br \/>\n# will not be copied.<br \/>\n# To specify the OS as the copy-iface (so the OS can route packets, or forward<br \/>\n# to a service running on the same machine) add a plus sign at the end<br \/>\n# (e.g. &#8220;copy-iface: eth0+&#8221;). Don&#8217;t forget to set up a symmetrical eth0+ -&gt; eth0<br \/>\n# for return packets. Hardware checksumming must be *off* on the interface if<br \/>\n# using an OS endpoint (e.g. &#8216;ifconfig eth0 -rxcsum -txcsum -rxcsum6 -txcsum6&#8217; for FreeBSD<br \/>\n# or &#8216;ethtool -K eth0 tx off rx off&#8217; for Linux).<br \/>\n#copy-mode: tap<br \/>\n#copy-iface: eth3<br \/>\n# Set to yes to disable promiscuous mode<br \/>\n# disable-promisc: no<br \/>\n# Choose checksum verification mode for the interface. At the moment<br \/>\n# of the capture, some packets may have an invalid checksum due to<br \/>\n# the checksum computation being offloaded to the network card.<br \/>\n# Possible values are:<br \/>\n# &#8211; yes: checksum validation is forced<br \/>\n# &#8211; no: checksum validation is disabled<br \/>\n# &#8211; auto: Suricata uses a statistical approach to detect when<br \/>\n# checksum off-loading is used.<br \/>\n# Warning: &#8216;checksum-validation&#8217; must be set to yes to have any validation<br \/>\n#checksum-checks: auto<br \/>\n# BPF filter to apply to this interface. The pcap filter syntax apply here.<br \/>\n#bpf-filter: port 80 or udp<br \/>\n#- interface: eth3<br \/>\n#threads: auto<br \/>\n#copy-mode: tap<br \/>\n#copy-iface: eth2<br \/>\n# Put default values here<br \/>\n&#8211; interface: default<\/p>\n<p># PF_RING configuration: for use with native PF_RING support<br \/>\n# for more info see http:\/\/www.ntop.org\/products\/pf_ring\/<br \/>\npfring:<br \/>\n&#8211; interface: eth0<br \/>\n# Number of receive threads. If set to &#8216;auto&#8217; Suricata will first try<br \/>\n# to use CPU (core) count and otherwise RSS queue count.<br \/>\nthreads: auto<\/p>\n<p># Default clusterid. PF_RING will load balance packets based on flow.<br \/>\n# All threads\/processes that will participate need to have the same<br \/>\n# clusterid.<br \/>\ncluster-id: 99<\/p>\n<p># Default PF_RING cluster type. PF_RING can load balance per flow.<br \/>\n# Possible values are cluster_flow or cluster_round_robin.<br \/>\ncluster-type: cluster_flow<\/p>\n<p># bpf filter for this interface<br \/>\n#bpf-filter: tcp<\/p>\n<p># If bypass is set then the PF_RING hw bypass is activated, when supported<br \/>\n# by the network interface. Suricata will instruct the interface to bypass<br \/>\n# all future packets for a flow that need to be bypassed.<br \/>\n#bypass: yes<\/p>\n<p># Choose checksum verification mode for the interface. At the moment<br \/>\n# of the capture, some packets may have an invalid checksum due to<br \/>\n# the checksum computation being offloaded to the network card.<br \/>\n# Possible values are:<br \/>\n# &#8211; rxonly: only compute checksum for packets received by network card.<br \/>\n# &#8211; yes: checksum validation is forced<br \/>\n# &#8211; no: checksum validation is disabled<br \/>\n# &#8211; auto: Suricata uses a statistical approach to detect when<br \/>\n# checksum off-loading is used. (default)<br \/>\n# Warning: &#8216;checksum-validation&#8217; must be set to yes to have any validation<br \/>\n#checksum-checks: auto<br \/>\n# Second interface<br \/>\n#- interface: eth1<br \/>\n# threads: 3<br \/>\n# cluster-id: 93<br \/>\n# cluster-type: cluster_flow<br \/>\n# Put default values here<br \/>\n&#8211; interface: default<br \/>\n#threads: 2<\/p>\n<p># For FreeBSD ipfw(8) divert(4) support.<br \/>\n# Please make sure you have ipfw_load=&#8221;YES&#8221; and ipdivert_load=&#8221;YES&#8221;<br \/>\n# in \/etc\/loader.conf or kldload&#8217;ing the appropriate kernel modules.<br \/>\n# Additionally, you need to have an ipfw rule for the engine to see<br \/>\n# the packets from ipfw. For Example:<br \/>\n#<br \/>\n# ipfw add 100 divert 8000 ip from any to any<br \/>\n#<br \/>\n# N.B. This example uses &#8220;8000&#8221; &#8212; this number must mach the values<br \/>\n# you passed on the command line, i.e., -d 8000<br \/>\n#<br \/>\nipfw:<\/p>\n<p># Reinject packets at the specified ipfw rule number. This config<br \/>\n# option is the ipfw rule number AT WHICH rule processing continues<br \/>\n# in the ipfw processing system after the engine has finished<br \/>\n# inspecting the packet for acceptance. If no rule number is specified,<br \/>\n# accepted packets are reinjected at the divert rule which they entered<br \/>\n# and IPFW rule processing continues. No check is done to verify<br \/>\n# this will rule makes sense so care must be taken to avoid loops in ipfw.<br \/>\n#<br \/>\n## The following example tells the engine to reinject packets<br \/>\n# back into the ipfw firewall AT rule number 5500:<br \/>\n#<br \/>\n# ipfw-reinjection-rule-number: 5500<\/p>\n<p>napatech:<br \/>\n# When use_all_streams is set to &#8220;yes&#8221; the initialization code will query<br \/>\n# the Napatech service for all configured streams and listen on all of them.<br \/>\n# When set to &#8220;no&#8221; the streams config array will be used.<br \/>\n#<br \/>\n# This option necessitates running the appropriate NTPL commands to create<br \/>\n# the desired streams prior to running Suricata.<br \/>\n#use-all-streams: no<\/p>\n<p># The streams to listen on when auto-config is disabled or when and threading<br \/>\n# cpu-affinity is disabled. This can be either:<br \/>\n# an individual stream (e.g. streams: [0])<br \/>\n# or<br \/>\n# a range of streams (e.g. streams: [&#8220;0-3&#8221;])<br \/>\n#<br \/>\nstreams: [&#8220;0-3&#8221;]<\/p>\n<p># Stream stats can be enabled to provide fine grain packet and byte counters<br \/>\n# for each thread\/stream that is configured.<br \/>\n#<br \/>\nenable-stream-stats: no<\/p>\n<p># When auto-config is enabled the streams will be created and assigned<br \/>\n# automatically to the NUMA node where the thread resides. If cpu-affinity<br \/>\n# is enabled in the threading section. Then the streams will be created<br \/>\n# according to the number of worker threads specified in the worker-cpu-set.<br \/>\n# Otherwise, the streams array is used to define the streams.<br \/>\n#<br \/>\n# This option is intended primarily to support legacy configurations.<br \/>\n#<br \/>\n# This option cannot be used simultaneously with either &#8220;use-all-streams&#8221;<br \/>\n# or &#8220;hardware-bypass&#8221;.<br \/>\n#<br \/>\nauto-config: yes<\/p>\n<p># Enable hardware level flow bypass.<br \/>\n#<br \/>\nhardware-bypass: yes<\/p>\n<p># Enable inline operation. When enabled traffic arriving on a given port is<br \/>\n# automatically forwarded out its peer port after analysis by Suricata.<br \/>\n#<br \/>\ninline: no<\/p>\n<p># Ports indicates which Napatech ports are to be used in auto-config mode.<br \/>\n# these are the port IDs of the ports that will be merged prior to the<br \/>\n# traffic being distributed to the streams.<br \/>\n#<br \/>\n# When hardware-bypass is enabled the ports must be configured as a segment.<br \/>\n# specify the port(s) on which upstream and downstream traffic will arrive.<br \/>\n# This information is necessary for the hardware to properly process flows.<br \/>\n#<br \/>\n# When using a tap configuration one of the ports will receive inbound traffic<br \/>\n# for the network and the other will receive outbound traffic. The two ports on a<br \/>\n# given segment must reside on the same network adapter.<br \/>\n#<br \/>\n# When using a SPAN-port configuration the upstream and downstream traffic<br \/>\n# arrives on a single port. This is configured by setting the two sides of the<br \/>\n# segment to reference the same port. (e.g. 0-0 to configure a SPAN port on<br \/>\n# port 0).<br \/>\n#<br \/>\n# port segments are specified in the form:<br \/>\n# ports: [0-1,2-3,4-5,6-6,7-7]<br \/>\n#<br \/>\n# For legacy systems when hardware-bypass is disabled this can be specified in any<br \/>\n# of the following ways:<br \/>\n#<br \/>\n# a list of individual ports (e.g. ports: [0,1,2,3])<br \/>\n#<br \/>\n# a range of ports (e.g. ports: [0-3])<br \/>\n#<br \/>\n# &#8220;all&#8221; to indicate that all ports are to be merged together<br \/>\n# (e.g. ports: [all])<br \/>\n#<br \/>\n# This parameter has no effect if auto-config is disabled.<br \/>\n#<br \/>\nports: [0-1,2-3]<\/p>\n<p># When auto-config is enabled the hashmode specifies the algorithm for<br \/>\n# determining to which stream a given packet is to be delivered.<br \/>\n# This can be any valid Napatech NTPL hashmode command.<br \/>\n#<br \/>\n# The most common hashmode commands are: hash2tuple, hash2tuplesorted,<br \/>\n# hash5tuple, hash5tuplesorted and roundrobin.<br \/>\n#<br \/>\n# See Napatech NTPL documentation other hashmodes and details on their use.<br \/>\n#<br \/>\n# This parameter has no effect if auto-config is disabled.<br \/>\n#<br \/>\nhashmode: hash5tuplesorted<\/p>\n<p>##<br \/>\n## Configure Suricata to load Suricata-Update managed rules.<br \/>\n##<\/p>\n<p>#default-rule-path: \/etc\/suricata\/rules<br \/>\ndefaul-rule-path: \/var\/lib\/suricata\/rules<br \/>\nrule-files:<br \/>\n&#8211; suricata.rules<\/p>\n<p>##<br \/>\n## Auxiliary configuration files.<br \/>\n##<\/p>\n<p>classification-file: \/etc\/suricata\/classification.config<br \/>\nreference-config-file: \/etc\/suricata\/reference.config<br \/>\n# threshold-file: \/etc\/suricata\/threshold.config<\/p>\n<p>##<br \/>\n## Include other configs<br \/>\n##<\/p>\n<p># Includes: Files included here will be handled as if they were in-lined<br \/>\n# in this configuration file. Files with relative pathnames will be<br \/>\n# searched for in the same directory as this configuration file. You may<br \/>\n# use absolute pathnames too.<br \/>\n# You can specify more than 2 configuration files, if needed.<br \/>\n#include: include1.yaml<br \/>\n#include: include2.yaml<\/p>\n","protected":false},"excerpt":{"rendered":"<p>%YAML 1.1 &#8212; # Suricata configuration file. In addition to the comments describing all # options in this file, full documentation can be found at: # https:\/\/suricata.readthedocs.io\/en\/latest\/configuration\/suricata-yaml.html ## ## Step 1: Inform Suricata about your network ## vars: # more specific is better for alert accuracy and performance address-groups: #HOME_NET: &#8220;[192.168.0.0\/16,10.0.0.0\/8,172.16.0.0\/12]&#8221; HOME_NET: &#8220;[192.168.2.0\/23]&#8221; #HOME_NET: &#8220;[10.0.0.0\/8]&#8221; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[222],"tags":[135,134],"class_list":["post-2568","post","type-post","status-publish","format-standard","hentry","category-ips","tag-ips","tag-suricata"],"_links":{"self":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/2568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2568"}],"version-history":[{"count":1,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/2568\/revisions"}],"predecessor-version":[{"id":2569,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/2568\/revisions\/2569"}],"wp:attachment":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2568"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}