forked from dmachard/DNS-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
461 lines (435 loc) · 14.5 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# If turned on, log some applications messages
trace:
# debug informations
verbose: true
# log malformed packet
log-malformed: false
# filename is the file to write logs to.
filename: ""
# maximum size in megabytes of the log file it gets rotated
max-size: 10
# maximum number of old log files to retain
max-backups: 10
# list of supported collectors
collectors:
# dnstap standard
dnstap:
# to enable, set the enable to true
enable: true
# listen on ip
listen-ip: 0.0.0.0
# listening on port
listen-port: 6000
# unix socket path
sock-path: null
# tls support
tls-support: false
# certificate server file
cert-file: ""
# private key server file
key-file: ""
# dns traffic
dns-sniffer:
# to enable, set the enable to true
enable: false
# filter on source and destination port
port: 53
# if "" bind on all interfaces
device: wlp2s0
# capture dns queries
capture-dns-queries: true
# capture dns replies
capture-dns-replies: true
# read text file
tail:
# to enable, set the enable to true
enable: false
# file to follow
file-path: null
# Use the exact layout numbers described https://golang.org/src/time/format.go
time-layout: "2006-01-02T15:04:05.999999999Z07:00"
# regexp pattern for queries
# example for unbound: "query: (?P<queryip>[^ ]*) (?P<domain>[^ ]*) (?P<qtype>[^ ]*)"
pattern-query: "^(?P<timestamp>[^ ]*) (?P<identity>[^ ]*) (?P<qr>.*_QUERY) (?P<rcode>[^ ]*)
(?P<queryip>[^ ]*) (?P<queryport>[^ ]*) (?P<family>[^ ]*) (?P<protocol>[^ ]*)
(?P<length>[^ ]*)b (?P<domain>[^ ]*) (?P<qtype>[^ ]*) (?P<latency>[^ ]*)$"
# regexp pattern for replies
# example for unbound: "reply: (?P<queryip>[^ ]*) (?P<domain>[^ ]*) (?P<qtype>[^ ]*) IN (?P<rcode>[^ ]*) (?P<latency>[^ ]*)"
pattern-reply: "^(?P<timestamp>[^ ]*) (?P<identity>[^ ]*) (?P<qr>.*_RESPONSE) (?P<rcode>[^ ]*)
(?P<queryip>[^ ]*) (?P<queryport>[^ ]*) (?P<family>[^ ]*) (?P<protocol>[^ ]*) (?P<length>[^ ]*)b
(?P<domain>[^ ]*) (?P<qtype>[^ ]*) (?P<latency>[^ ]*)$"
# protobuf powerdns
powerdns:
# to enable, set the enable to true
enable: false
# listen on ip
listen-ip: 0.0.0.0
# listening on port
listen-port: 6001
# settings for subprocessors
subprocessors:
# this option can be useful to reduce the size of your dns logs
quiet-text:
# AQ: AUTH_QUERY
# AR: AUTH_RESPONSE
# RQ: RESOLVER_QUERY
# RR: RESOLVER_RESPONSE
# CQ: CLIENT_QUERY
# CR: CLIENT_RESPONSE
# FQ: FORWARDER_QUERY
# FR: FORWARDER_RESPONSE
# SQ: STUB_QUERY
# SR: STUB_RESPONSE
# TQ: TOOL_QUERY
# TR: TOOL_RESPONSE
dnstap: false
# Q: QUERY
# R: REPLY
dns: false
# Statistics engine to compute some metrics on dns usage observed
statistics:
# default number of items on top
top-max-items: 100
# expected common qtype list, other will be considered as suspicious
common-qtypes: [ "A", "AAAA", "CNAME", "TXT", "PTR", "NAPTR", "DNSKEY", "SRV", "SOA", "NS", "MX", "DS" ]
# a length greater than this value will be considered as suspicious
threshold-qname-len: 80
# a size greater than this value will be considered as suspicious
# value in bytes
threshold-packet-len: 1000
# threshold to set a domain considered as slow, value in second
threshold-slow: 0.5
# prometheus prefix
prometheus-prefix: "dnscollector"
# Use this option to protect user privacy
user-privacy:
# IP-Addresses are anonymities by zeroing the host-part of an address.
anonymize-ip: false
# Reduce Qname to second level only, for exemple mail.google.com be replaced by google.com
minimaze-qname: false
# Convert all domain to lowercase
# Wwww.GooGlE.com will be equal to www.google.com
qname-lowercase: true
# The cache is used to compute latency between replies and queries
# This cache can be disabled if your dns server already add the latency in the dns packet
# Disable this feature to improve performance
cache:
# enable or disable
enable: true
# Ttl in second, max time to keep the query record in memory
query-timeout: 5
# Server identity, if empty the hostname is used
# This settings is used in dnstap logger as dnstap-identity
server-id: ""
# filtering feature to ignore some specific qname
# dns logs is not redirected to loggers if the filtering regexp matched
filtering:
# path file of the fqdn drop list, domains list must be a full qualified domain name
drop-fqdn-file: ""
# path file of the domain drop list, domains list can be a partial domain name with regexp expression
drop-domain-file: ""
# path file of the query IP drop list, one IP address or subnet per line
drop-queryip-file: ""
# path file of the query IP keep list, one IP address or subnet per line
keep-queryip-file: ""
# drop specific responses according to the return code (NOERROR, ...). This list is empty by default
# Example to ignore NOERROR dns packets
# drop-rcodes:
# - NOERROR
drop-rcodes: []
# forward received queries to configured loggers ?
log-queries: true
# forward received replies to configured loggers ?
log-replies: true
# geoip maxmind support, more information on https://www.maxmind.com/en/geoip-demo
# this feature can be used to append additional informations like country, city, asn
# according to the query ip
geoip:
# path file to your mmdb country database
mmdb-country-file: ""
# path file to your mmdb city database
mmdb-city-file: ""
# path file to your mmdb ASN database
mmdb-asn-file: ""
# specific the default text log format used on all loggers supporting this mode
# all available directives:
# - timestamp-rfc3339ns: timestamp rfc3339 format, with nano support
# - timestamp-unixms: unix timestamp with ms support
# - timestamp-unixus: unix timestamp with us support
# - timestamp-unixns: unix timestamp with nano support
# - localtime: local time
# - identity: dnstap identity
# - operation: dnstap operation
# - opcode: dns opcode (integer)
# - rcode: dns return code
# - queryip: dns query ip
# - queryport: dns query port
# - responseip: dns response ip
# - responseport: dns response port
# - id: dns id
# - family: ip protocol version INET or INET6
# - protocol: protocol UDP, TCP
# - length: the length of the query or reply
# - qtype: dns qtype
# - qname: dns qname
# - latency: computed latency between queries and replies
# - answercount: the number of answer
# - continent: continent code
# - country: country iso code
# - city: city name
# - as-number: autonomous system number
# - as-owner: autonomous system organization
# - ttl: answer ttl, only the first one value
# - answer: rdata answer, only the first one, prefer to use the JSON format if you wamt all answers
# - malformed: malformed dns packet, integer value 1/0
# - qr: query or reply flag, string value Q/R
# - tc: truncated flag
# - aa: authoritative answer
# - ra: recursion available
# - ad: authenticated data
# - edns-csubnet: client subnet
text-format: "timestamp-rfc3339ns identity operation rcode queryip queryport family protocol length qname qtype latency"
# list of loggers
loggers:
# print received dns traffic to sdtout
stdout:
# to enable, set the enable to true
enable: true
# output format: text|json
mode: text
# output text format, please refer to the default text format to see all available directives
# use this parameter if you want a specific format
text-format: ""
# rest api server
webserver:
# to enable, set the enable to true
enable: true
# listening IP
listen-ip: 0.0.0.0
# listening port
listen-port: 8080
# default login
basic-auth-login: admin
# default password
basic-auth-pwd: changeme
# tls support
tls-support: false
# certificate server file
cert-file: ""
# private key server file
key-file: ""
# prometheus metrics server
prometheus:
# to enable, set the enable to true
enable: false
# listening IP
listen-ip: 0.0.0.0
# listening port
listen-port: 8081
# default login
basic-auth-login: admin
# default password
basic-auth-pwd: changeme
# tls support
tls-support: false
# certificate server file
cert-file: ""
# private key server file
key-file: ""
# prometheus prefix
prometheus-prefix: "dnscollector"
# write captured dns traffic to text files with rotation and compression support
logfile:
# to enable, set the enable to true
enable: false
# output logfile name
file-path: /tmp/test.log
# maximum size in megabytes of the file before rotation
# A minimum of max-size*max-files megabytes of space disk must be available
max-size: 100
# maximum number of files to retain.
# Set to zero if you want to disable this feature
max-files: 10
# flush buffer to log file every X seconds
flush-interval: 10
# compress log file
compress: false
# compress interval
# checking every X seconds if new log files must be compressed
compress-interval: 5
# run external script after each file compress step
compress-postcommand: null
# output format: text|json
mode: text
# output text format, please refer to the default text format to see all available directives
# use this parameter if you want a specific format
text-format: ""
# run external script after each file rotation
postrotate-command: null
# delete file on script success
postrotate-delete-success: true
# resend captured dns traffic to another dnstap collector or to unix socket
dnstap:
# to enable, set the enable to true
enable: false
# remote address
remote-address: 10.0.0.1
# remote tcp port
remote-port: 6000
# unix socket path
sock-path: null
# interval in second between retry reconnect
retry-interval: 5
# enable tls
tls-support: false
# insecure skip verify
tls-insecure: false
# resend captured dns traffic to a tcp remote destination or to unix socket
tcpclient:
# to enable, set the enable to true
enable: false
# network transport to use: tcp|unix
transport: tcp
# remote address
remote-address: 127.0.0.1
# remote tcp port
remote-port: 9999
# unix socket path
sock-path: null
# interval in second between retry reconnect
retry-interval: 5
# enable tls
tls-support: false
# insecure skip verify
tls-insecure: false
# output format: text|json
mode: json
# output text format, please refer to the default text format to see all available directives
# use this parameter if you want a specific format
text-format: ""
# delimiter to use between payload sent
delimiter: "\n"
# redirect captured dns traffic to a remote syslog server or local one
syslog:
# to enable, set the enable to true
enable: false
# Set the syslog logging severity
severity: INFO
# Set the syslog logging facility
facility: DAEMON
# Transport to use to a remote log daemon or local one
# local|tcp|udp|unix or tcp+tls
transport: local
# Remote address host:port
remote-address: ""
# output text format, please refer to the default text format to see all available directives
# use this parameter if you want a specific format
text-format: ""
# output format: text|json
mode: text
# enable tls
tls-support: false
# insecure skip verify
tls-insecure: false
# resend captured dns traffic to a remote fluentd server or to unix socket
fluentd:
# to enable, set the enable to true
enable: false
# network transport to use: tcp|unix
transport: tcp
# remote address
remote-address: 127.0.0.1
# remote tcp port
remote-port: 24224
# unix socket path
sock-path: null
# interval in second between retry reconnect
retry-interval: 5
# tag name
tag: "dns.collector"
# enable tls
tls-support: false
# insecure skip verify
tls-insecure: false
# write captured dns traffic to network pcap file
pcapfile:
# to enable, set the enable to true
enable: false
# output logfile name
file-path: null
# maximum size in megabytes of the file before rotation
max-size: 100
# maximum number of files to retain.
max-files: 10
# compress pcap file
compress: false
# compress interval
# checking every X seconds if new log files must be compressed
compress-interval: 5
# run external script after each file rotation
postrotate-command: null
# delete file on script success
postrotate-delete-success: true
# resend captured dns traffic to a InfluxDB database
influxdb:
# to enable, set the enable to true
enable: false
# InfluxDB server url
server-url: "http://localhost:8086"
# authentication token
auth-token: ""
# enable tls
tls-support: false
# insecure skip verify
tls-insecure: false
# bucket
bucket: "db_dns"
# Organization
organization: "dnscollector"
# resend captured dns traffic to a Loki Server
lokiclient:
# to enable, set the enable to true
enable: false
# Loki server url
server-url: "http://lokiwriter.home.lab/loki/api/v1/push"
# Job name
job-name: "dnscollector"
# output format: text|json
mode: text
# flush batch every X seconds
flush-interval: 5
# batch size for log entries in bytes
batch-size: 1048576
# interval in second between before to retry to send log entries
retry-interval: 10
# output text format, please refer to the default text format to see all available directives
# use this parameter if you want a specific format
text-format: "localtime identity qr queryip family protocol qname qtype rcode"
# Proxy URL
proxy-url: ""
# insecure skip verify
tls-insecure: false
# basic auth login
basic-auth-login: ""
# basic auth password
basic-auth-pwd: ""
# tenant/organisation id. If omitted or empty, no X-Scope-OrgID header is sent.
tenant-id: ""
# forward to statsd proxy
statsd:
# to enable, set the enable to true
enable: false
# network transport to use: udp|tcp
transport: udp
# remote address
remote-address: 127.0.0.1
# remote tcp port
remote-port: 8125
# enable tls
tls-support: false
# insecure skip verify
tls-insecure: false
# prefix
prefix: "dnscollector"
# flush every X seconds
flush-interval: 10