@@ -220,34 +220,6 @@ outputs:
220
220
dump-all-headers : {{OPNsense.IDS.general.eveLog.http.dumpAllHeaders}}
221
221
{% endif %}
222
222
{% endif %}
223
- # - dns:
224
- # This configuration uses the new DNS logging format,
225
- # the old configuration is still available:
226
- # https://docs.suricata.io/en/latest/output/eve/eve-json-output.html#dns-v1-format
227
-
228
- # As of Suricata 5.0, version 2 of the eve dns output
229
- # format is the default.
230
- # version: 2
231
-
232
- # Enable/disable this logger. Default: enabled.
233
- # enabled: yes
234
-
235
- # Control logging of requests and responses:
236
- # - requests: enable logging of DNS queries
237
- # - responses: enable logging of DNS answers
238
- # By default both requests and responses are logged.
239
- # requests: no
240
- # responses: no
241
-
242
- # Format of answer logging:
243
- # - detailed: array item per answer
244
- # - grouped: answers aggregated by type
245
- # Default: all
246
- # formats: [detailed, grouped]
247
-
248
- # DNS record types to log, based on the query type.
249
- # Default: all.
250
- # types: [a, aaaa, cname, mx, ns, ptr, txt]
251
223
{% if not helpers.empty('OPNsense.IDS.general.eveLog.tls.enable') %}
252
224
- tls :
253
225
extended : {{ 'no' if helpers.empty('OPNsense.IDS.general.eveLog.tls.extended') else 'yes' }}
@@ -259,19 +231,25 @@ outputs:
259
231
custom : [{{ OPNsense.IDS.general.eveLog.tls.custom }}]
260
232
{% endif %}
261
233
{% endif %}
262
- # - files:
263
- force-magic : no # force logging magic on all logged files
264
- # force logging of checksums, available hash functions are md5,
265
- # sha1 and sha256
266
- # force-hash: [md5]
267
234
268
235
- drop :
269
236
alerts : yes # log alerts that caused drops
270
237
flows : start # start or all: 'start' logs only a single drop
271
238
# per flow direction. All logs each dropped pkt.
272
239
273
- # - smtp:
274
- # extended: yes # enable this for extended logging information
240
+ - ssh
241
+
242
+ {% set eveLog_types_enabled = (OPNsense.IDS.general.eveLog.types.enabled|default('')).split(',') %}
243
+ {% set eveLog_types_extended = (OPNsense.IDS.general.eveLog.types.extended|default('')).split(',') %}
244
+ {% for opt in eveLog_types_enabled %}
245
+ - {{opt}}:
246
+ {% if opt == 'files' and opt in eveLog_types_extended %}
247
+ force-magic : yes # force logging magic on all logged files
248
+ # force logging of checksums, available hash functions are md5,
249
+ # sha1 and sha256
250
+ # force-hash: [md5]
251
+ {% elif opt == 'smtp' and opt in eveLog_types_extended %}
252
+ extended : yes # enable this for extended logging information
275
253
# this includes: bcc, message-id, subject, x_mailer, user-agent
276
254
# custom fields logging from the list:
277
255
# reply-to, bcc, message-id, subject, x-mailer, user-agent, received,
@@ -282,43 +260,18 @@ outputs:
282
260
# for the body you need to set app-layer.protocols.smtp.mime.body-md5
283
261
# to yes
284
262
# md5: [body, subject]
285
-
286
- # - dnp3
287
- # - ftp
288
- # - rdp
289
- # - nfs
290
- # - smb
291
- # - tftp
292
- # - ike
293
- # - dcerpc
294
- # - krb5
295
- # - bittorrent-dht
296
- # - snmp
297
- # - rfb
298
- # - sip
299
- # - quic
300
- # - dhcp:
301
- # enabled: yes
263
+ {% elif opt == 'dhcp' and opt in eveLog_types_extended %}
302
264
# When extended mode is on, all DHCP messages are logged
303
265
# with full detail. When extended mode is off (the
304
266
# default), just enough information to map a MAC address
305
267
# to an IP address is logged.
306
- # extended: no
307
- - ssh
308
- # - mqtt:
309
- # passwords: yes # enable output of passwords
310
- # - http2
311
- # - pgsql:
312
- # enabled: no
313
- # passwords: yes # enable output of passwords. Disabled by default
314
- # - stats:
315
- # totals: yes # stats for all threads merged together
316
- # threads: no # per thread stats
317
- # deltas: no # include delta values
318
- # bi-directional flows
319
- # - flow
320
- # uni-directional flows
321
- # - netflow
268
+ extended : yes
269
+ {% elif opt == 'mqtt' and opt in eveLog_types_extended %}
270
+ passwords : yes # enable output of passwords
271
+ {% elif opt == 'pgsql' and opt in eveLog_types_extended %}
272
+ passwords : yes # enable output of passwords. Disabled by default
273
+ {% endif %}
274
+ {% endfor %}
322
275
323
276
# Metadata event type. Triggered whenever a pktvar is saved
324
277
# and will include the pktvars, flowvars, flowbits and
@@ -942,7 +895,7 @@ app-layer:
942
895
#encryption-handling: default
943
896
944
897
pgsql:
945
- enabled: no
898
+ enabled: {{ 'yes' if 'pgsql' in eveLog_types_enabled else 'no' }}
946
899
# Stream reassembly size for PostgreSQL. By default, track it completely.
947
900
stream-depth: 0
948
901
# Maximum number of live PostgreSQL transactions per flow
@@ -998,14 +951,14 @@ app-layer:
998
951
#log-url-scheme: yes
999
952
# Set to yes to compute the md5 of the mail body. You will then
1000
953
# be able to journalize it.
1001
- body-md5: no
954
+ body-md5: {{ 'yes' if 'smtp' in eveLog_types_extended else 'no' }}
1002
955
# Configure inspected-tracker for file_data keyword
1003
956
inspected-tracker:
1004
957
content-limit: 100000
1005
958
content-inspect-min-size: 32768
1006
959
content-inspect-window: 4096
1007
960
imap:
1008
- enabled: detection-only
961
+ enabled: {{ 'yes' if 'imap' in eveLog_types_enabled else ' detection-only' }}
1009
962
smb:
1010
963
enabled: yes
1011
964
detection-ports:
@@ -1171,7 +1124,7 @@ app-layer:
1171
1124
1172
1125
# DNP3
1173
1126
dnp3:
1174
- enabled: no
1127
+ enabled: {{ 'yes' if 'dnp3' in eveLog_types_enabled else 'no' }}
1175
1128
detection-ports:
1176
1129
dp: 20000
1177
1130
@@ -1192,7 +1145,7 @@ app-layer:
1192
1145
enabled: yes
1193
1146
1194
1147
sip:
1195
- # enabled: yes
1148
+ enabled: {{ ' yes' if 'sip' in eveLog_types_enabled else 'no' }}
1196
1149
1197
1150
# Limit for the maximum number of asn1 frames to decode (default 256)
1198
1151
asn1-max-frames: 256
0 commit comments