forked from Information-Warfare-Center/CSI-SIEM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
567 lines (553 loc) · 18.1 KB
/
docker-compose.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
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# Copyright (c) 2020 Battelle Energy Alliance, LLC. All rights reserved.
version: '3.7'
################################################################################
# Commonly tweaked configuration options
#-------------------------------------------------------------------------------
x-auth-variables: &auth-variables
# authentication method: encrypted HTTP basic authentication ('true') vs LDAP ('false')
NGINX_BASIC_AUTH : 'true'
# NGINX LDAP (NGINX_BASIC_AUTH=false) can support LDAP, LDAPS, or LDAP+StartTLS.
# For StartTLS, set NGINX_LDAP_TLS_STUNNEL=true to issue the StartTLS command
# and use stunnel to tunnel the connection.
NGINX_LDAP_TLS_STUNNEL : 'false'
# When NGINX_LDAP_TLS_STUNNEL=true, which protocol to use when initiating the
# "extendedReq(1) LDAP_START_TLS_OID" command: winldap or openldap
NGINX_LDAP_TLS_STUNNEL_PROTOCOL : 'winldap'
# stunnel will require and verify certificates for StartTLS when one or more
# trusted CA certificate files are placed in the ./nginx/ca-trust directory.
# For additional security, hostname or IP address checking of the associated
# CA certificate(s) can be enabled by providing these values.
NGINX_LDAP_TLS_STUNNEL_CHECK_HOST : ''
NGINX_LDAP_TLS_STUNNEL_CHECK_IP : ''
NGINX_LDAP_TLS_STUNNEL_VERIFY_LEVEL : 2
x-nginx-variables: &nginx-variables
# Whether or not to write nginx's access.log and error.log to Elasticsearch
NGINX_LOG_ACCESS_AND_ERRORS : 'false'
x-moloch-variables: &moloch-variables
MANAGE_PCAP_FILES : 'false'
MOLOCH_ANALYZE_PCAP_THREADS : 1
MAXMIND_GEOIP_DB_LICENSE_KEY : '0'
x-zeek-variables: &zeek-variables
ZEEK_AUTO_ANALYZE_PCAP_FILES : 'true'
ZEEK_AUTO_ANALYZE_PCAP_THREADS : 1
ZEEK_EXTRACTOR_MODE : 'none'
EXTRACTED_FILE_IGNORE_EXISTING : 'false'
EXTRACTED_FILE_PRESERVATION : 'quarantined'
EXTRACTED_FILE_MIN_BYTES : 64
EXTRACTED_FILE_MAX_BYTES : 134217728
VTOT_API2_KEY : '0'
VTOT_REQUESTS_PER_MINUTE : 4
EXTRACTED_FILE_ENABLE_CLAMAV : 'false'
EXTRACTED_FILE_ENABLE_FRESHCLAM : 'false'
EXTRACTED_FILE_PIPELINE_DEBUG : 'false'
EXTRACTED_FILE_PIPELINE_DEBUG_EXTRA : 'false'
x-logstash-variables: &logstash-variables
LOGSTASH_OUI_LOOKUP : 'true'
LOGSTASH_REVERSE_DNS : 'false'
# ES_EXTERNAL_HOSTS : '10.0.0.123:9200'
# ES_EXTERNAL_SSL : 'true'
# ES_EXTERNAL_SSL_CERTIFICATE_VERIFICATION : 'false'
# For security, ES_EXTERNAL_USER and ES_EXTERNAL_PASSWORD should be stored in Logstash keystore using ./scripts/auth_setup
# See also volume mount for logstash.keystore below.
# ES_EXTERNAL_USER : 'janedoe'
# ES_EXTERNAL_PASSWORD : 'secret'
x-kibana-variables: &kibana-variables
KIBANA_OFFLINE_REGION_MAPS : 'true'
x-curator-variables: &curator-variables
# get index dates from actual date index was created (creation_date) vs. extracted from index name (name)
CURATOR_TIME_SOURCE : 'name'
# for managing automatic closing of older Elasticsearch indices (to conserve memory)
CURATOR_CLOSE_UNITS : years
CURATOR_CLOSE_COUNT : 10
# for managing automatic deleting of older Elasticsearch indices (to reduce disk consumption)
CURATOR_DELETE_UNITS : years
CURATOR_DELETE_COUNT : 99
# for managing automatic deleting of Elasticsearch indices based on cumulative size (to reduce disk consumption)
CURATOR_DELETE_GIGS : 1000000
# for managing automatic snapshots of Elasticsearch indices
CURATOR_SNAPSHOT_DISABLED : 'True'
# name of Elasticsearch snapshot repository under path.repo
CURATOR_SNAPSHOT_REPO : 'logs'
# controls compression of Elasticsearch snapshots managed by the curator
CURATOR_SNAPSHOT_COMPRESSED : 'false'
x-common-upload-variables: &common-upload-variables
AUTO_TAG : 'true'
PCAP_PIPELINE_DEBUG : 'false'
PCAP_PIPELINE_DEBUG_EXTRA : 'false'
PCAP_PIPELINE_IGNORE_PREEXISTING : 'false'
PCAP_MONITOR_HOST : 'pcap-monitor'
x-common-lookup-variables: &common-lookup-variables
FREQ_LOOKUP : 'false'
x-common-beats-variables: &common-beats-variables
BEATS_SSL : 'false'
x-pcap-capture-variables: &pcap-capture-variables
PCAP_ENABLE_NETSNIFF : 'false'
PCAP_ENABLE_TCPDUMP : 'false'
PCAP_IFACE : 'eth0'
PCAP_ROTATE_MEGABYTES : 1024
PCAP_ROTATE_MINUTES : 10
PCAP_FILTER : ''
################################################################################
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.6.2
restart: "no"
hostname: elasticsearch
environment:
logger.level : 'INFO'
bootstrap.memory_lock : 'true'
ES_JAVA_OPTS : '-Xms4g -Xmx4g -Xss256k -Djava.security.egd=file:/dev/./urandom'
VIRTUAL_HOST : 'es.malcolm.local'
discovery.type : 'single-node'
# cluster.initial_master_nodes : 'elasticsearch'
cluster.routing.allocation.disk.threshold_enabled : 'false'
cluster.routing.allocation.node_initial_primaries_recoveries : 8
indices.query.bool.max_clause_count : 2048
path.repo : '/opt/elasticsearch/backup'
expose:
- 9200
ulimits:
memlock:
soft: -1
hard: -1
cap_add:
- IPC_LOCK
volumes:
- ./elasticsearch:/usr/share/elasticsearch/data:delegated
- ./elasticsearch-backup:/opt/elasticsearch/backup:delegated
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost:9200"]
interval: 30s
timeout: 15s
retries: 3
start_period: 180s
kibana:
build:
context: .
dockerfile: Dockerfiles/kibana.Dockerfile
image: malcolmnetsec/kibana-oss:2.1.0
restart: "no"
hostname: kibana
environment:
<< : *kibana-variables
ELASTICSEARCH_URL : 'http://elasticsearch:9200'
VIRTUAL_HOST : 'kibana.malcolm.local'
CREATE_ES_MOLOCH_SESSION_INDEX : 'true'
MOLOCH_INDEX_PATTERN : 'sessions2-*'
MOLOCH_INDEX_PATTERN_ID : 'sessions2-*'
MOLOCH_INDEX_TIME_FIELD : 'firstPacket'
depends_on:
- elasticsearch
expose:
- 5601
- 28991
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost:5601/kibana/api/status"]
interval: 30s
timeout: 15s
retries: 3
start_period: 210s
elastalert:
build:
context: .
dockerfile: Dockerfiles/elastalert.Dockerfile
image: malcolmnetsec/elastalert:2.1.0
restart: "no"
hostname: elastalert
environment:
ELASTICSEARCH_URL : 'http://elasticsearch:9200'
ES_HOST : 'elasticsearch'
ES_PORT : 9200
VIRTUAL_HOST : 'elastalert.malcolm.local'
depends_on:
- elasticsearch
expose:
- 3030
- 3333
volumes:
- ./elastalert/config/elastalert.yaml:/opt/elastalert/config.yaml
- ./elastalert/config/smtp-auth.yaml:/opt/elastalert/smtp-auth.yaml:ro
- ./elastalert/config/config.json:/opt/elastalert-server/config/config.json
- ./elastalert/rules/:/opt/elastalert/rules/
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost:3030"]
interval: 30s
timeout: 15s
retries: 3
start_period: 210s
curator:
build:
context: .
dockerfile: Dockerfiles/curator.Dockerfile
image: malcolmnetsec/curator:2.1.0
restart: "no"
hostname: curator
environment:
<< : *curator-variables
ES_HOST : 'elasticsearch'
ES_PORT : 9200
depends_on:
- elasticsearch
volumes:
- ./curator/config/action_file.yml:/config/action_file.yml
healthcheck:
test: ["CMD", "pidof", "cron"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
logstash:
build:
context: .
dockerfile: Dockerfiles/logstash.Dockerfile
image: malcolmnetsec/logstash-oss:2.1.0
restart: "no"
hostname: logstash
environment:
<< : *logstash-variables
<< : *common-beats-variables
<< : *common-lookup-variables
ES_HOSTS : 'elasticsearch:9200'
LS_JAVA_OPTS : '-Xms2g -Xmx2g -Djava.security.egd=file:/dev/./urandom'
depends_on:
- elasticsearch
expose:
- 5044
- 9001
- 9600
volumes:
- ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
- ./logstash/pipelines:/usr/share/logstash/malcolm-pipelines.available:ro
# - ./logstash/certs/logstash.keystore:/usr/share/logstash/config/logstash.keystore:ro
- ./logstash/certs/ca.crt:/certs/ca.crt:ro
- ./logstash/certs/server.crt:/certs/server.crt:ro
- ./logstash/certs/server.key:/certs/server.key:ro
- ./cidr-map.txt:/usr/share/logstash/config/cidr-map.txt:ro
- ./host-map.txt:/usr/share/logstash/config/host-map.txt:ro
- ./net-map.json:/usr/share/logstash/config/net-map.json:ro
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost:9600"]
interval: 30s
timeout: 15s
retries: 3
start_period: 600s
filebeat:
build:
context: .
dockerfile: Dockerfiles/filebeat.Dockerfile
image: malcolmnetsec/filebeat-oss:2.1.0
restart: "no"
hostname: filebeat
environment:
<< : *nginx-variables
<< : *common-upload-variables
<< : *common-beats-variables
FILEBEAT_LOG_PATH : '/data/zeek/current'
FILEBEAT_NGINX_LOG_PATH : '/data/nginx'
FILEBEAT_LOG_CLEANUP_MINUTES : 180
FILEBEAT_ZIP_CLEANUP_MINUTES : 360
FILEBEAT_SCAN_FREQUENCY : '10s'
FILEBEAT_CLEAN_INACTIVE : '45m'
FILEBEAT_IGNORE_OLDER : '30m'
FILEBEAT_CLOSE_INACTIVE : '30s'
FILEBEAT_CLOSE_RENAMED : 'true'
FILEBEAT_CLOSE_REMOVED : 'true'
FILEBEAT_CLOSE_EOF : 'true'
FILEBEAT_CLEAN_REMOVED : 'true'
depends_on:
- logstash
volumes:
- nginx-log-path:/data/nginx:ro
- ./zeek-logs:/data/zeek
- ./filebeat/certs/ca.crt:/certs/ca.crt:ro
- ./filebeat/certs/client.crt:/certs/client.crt:ro
- ./filebeat/certs/client.key:/certs/client.key:ro
- ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
healthcheck:
test: ["CMD", "supervisorctl", "status", "filebeat"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
moloch:
build:
context: .
dockerfile: Dockerfiles/moloch.Dockerfile
image: malcolmnetsec/moloch:2.1.0
restart: "no"
hostname: moloch
env_file:
- ./auth.env
environment:
<< : *common-upload-variables
<< : *moloch-variables
MOLOCH_VERSION : '2.3.1'
VIRTUAL_HOST : 'moloch.malcolm.local'
ES_HOST : 'elasticsearch'
ES_PORT : 9200
ES_MAX_SHARDS_PER_NODE : 2500
VIEWER : 'on'
WISE : 'on'
ulimits:
memlock:
soft: -1
hard: -1
depends_on:
- elasticsearch
expose:
- 8000
- 8005
- 8081
volumes:
- ./pcap:/data/pcap
- ./moloch-logs:/data/moloch/logs
- ./moloch-raw:/data/moloch/raw
- ./moloch/etc/config.ini:/data/moloch/etc/config.ini:ro
- ./moloch/etc/user_settings.json:/data/moloch/etc/user_settings.json:ro
- ./moloch/wise/source.zeeklogs.js:/data/moloch/wiseService/source.zeeklogs.js:ro
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost:8005/_ns_/nstest.html"]
interval: 90s
timeout: 30s
retries: 3
start_period: 210s
zeek:
build:
context: .
dockerfile: Dockerfiles/zeek.Dockerfile
image: malcolmnetsec/zeek:2.1.0
restart: "no"
hostname: zeek
environment:
<< : *common-upload-variables
<< : *zeek-variables
ulimits:
memlock:
soft: -1
hard: -1
depends_on:
- elasticsearch
volumes:
- ./pcap:/pcap
- ./zeek-logs/upload:/zeek/upload
- ./zeek-logs/extract_files:/zeek/extract_files
- ./zeek/config/local.zeek:/opt/zeek/share/zeek/site/local.zeek:ro
- ./zeek/config/cryptomining:/opt/zeek/share/zeek/site/cryptomining:ro
- ./zeek/config/producer-consumer-ratio:/opt/zeek/share/zeek/site/producer-consumer-ratio:ro
- ./zeek/config/dnstunnel.zeek:/opt/zeek/share/zeek/site/dnstunnel.zeek:ro
- ./zeek/config/rdp:/opt/zeek/share/zeek/site/rdp:ro
- ./zeek/config/smtp:/opt/zeek/share/zeek/site/smtp:ro
- ./zeek/config/dns-zone-trans.zeek:/opt/zeek/share/zeek/site/dns-zone-trans.zeek:ro
- ./zeek/config/creditcardcaptures:/opt/zeek/share/zeek/site/creditcardcaptures:ro
- ./zeek/config/ftp-bruteforce.zeek:/opt/zeek/share/zeek/site/ftp-bruteforce.zeek:ro
- ./zeek/config/http-stalling.zeek:/opt/zeek/share/zeek/site/http-stalling.zeek:ro
- ./zeek/config/http-attack.zeek:/opt/zeek/share/zeek/site/http-attack.zeek:ro
- ./zeek/config/http-pass.zeek:/opt/zeek/share/zeek/site/http-pass.zeek:ro
- ./zeek/config/http-basic-auth.zeek:/opt/zeek/share/zeek/site/http-basic-auth.zeek:ro
- ./zeek/config/tor.zeek:/opt/zeek/share/zeek/site/tor.zeek:ro
- ./zeek/config/udpscan.zeek:/opt/zeek/share/zeek/site/udpscan.zeek:ro
# - ./zeek/config/dir-mod.zeek:/opt/zeek/share/zeek/site/dir-mod.zeek:ro
- ./zeek/config/ssh-attack.zeek:/opt/zeek/share/zeek/site/ssh-attack.zeek:ro
healthcheck:
test: ["CMD", "supervisorctl", "status", "pcap-zeek"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
file-monitor:
build:
context: .
dockerfile: Dockerfiles/file-monitor.Dockerfile
image: malcolmnetsec/file-monitor:2.1.0
restart: "no"
hostname: filemon
environment:
<< : *zeek-variables
expose:
- 3310
volumes:
- ./zeek-logs/extract_files:/data/zeek/extract_files
- ./zeek-logs/current:/data/zeek/logs
healthcheck:
test: ["CMD", "supervisorctl", "status", "watcher", "scanner", "logger"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
pcap-capture:
build:
context: .
dockerfile: Dockerfiles/pcap-capture.Dockerfile
image: malcolmnetsec/pcap-capture:2.1.0
restart: "no"
network_mode: host
ulimits:
memlock:
soft: -1
hard: -1
cap_add:
- IPC_LOCK
- NET_ADMIN
- NET_RAW
- SYS_ADMIN
environment:
<< : *pcap-capture-variables
volumes:
- ./pcap/upload:/pcap
healthcheck:
test: ["CMD", "supervisorctl", "status"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
pcap-monitor:
build:
context: .
dockerfile: Dockerfiles/pcap-monitor.Dockerfile
image: malcolmnetsec/pcap-monitor:2.1.0
restart: "no"
hostname: pcapmon
environment:
<< : *common-upload-variables
ELASTICSEARCH_URL : 'http://elasticsearch:9200'
depends_on:
- elasticsearch
expose:
- 30441
volumes:
- ./zeek-logs:/zeek
- ./pcap:/pcap
healthcheck:
test: ["CMD", "supervisorctl", "status", "watch-upload", "pcap-publisher"]
interval: 30s
timeout: 15s
retries: 3
start_period: 90s
upload:
build:
context: .
dockerfile: Dockerfiles/file-upload.Dockerfile
image: malcolmnetsec/file-upload:2.1.0
restart: "no"
hostname: upload
env_file:
- ./auth.env
environment:
SITE_NAME : 'Capture File and Log Archive Upload'
VIRTUAL_HOST : 'upload.malcolm.local'
depends_on:
- moloch
expose:
- 80
ports:
- 127.0.0.1:8022:22
volumes:
- ./pcap/upload:/var/www/upload/server/php/chroot/files
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
htadmin:
image: malcolmnetsec/htadmin:2.1.0
build:
context: .
dockerfile: Dockerfiles/htadmin.Dockerfile
restart: "no"
hostname: htadmin
environment:
<< : *auth-variables
VIRTUAL_HOST : 'htadmin.malcolm.local'
expose:
- 80
volumes:
- ./htadmin/config.ini:/var/www/htadmin/config/config.ini:rw
- ./htadmin/metadata:/var/www/htadmin/config/metadata:rw
- ./nginx/htpasswd:/var/www/htadmin/config/htpasswd:rw
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
freq:
image: malcolmnetsec/freq:2.1.0
build:
context: .
dockerfile: Dockerfiles/freq.Dockerfile
restart: "no"
hostname: freq
environment:
<< : *common-lookup-variables
VIRTUAL_HOST : 'freq.malcolm.local'
expose:
- 10004
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost:10004"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
name-map-ui:
image: malcolmnetsec/name-map-ui:2.1.0
build:
context: .
dockerfile: Dockerfiles/name-map-ui.Dockerfile
restart: "no"
hostname: name-map-ui
environment:
VIRTUAL_HOST : 'name-map-ui.malcolm.local'
expose:
- 8080
volumes:
- ./cidr-map.txt:/var/www/html/maps/cidr-map.txt:ro
- ./host-map.txt:/var/www/html/maps/host-map.txt:ro
- ./net-map.json:/var/www/html/maps/net-map.json:rw
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost:8080/fpm-ping"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
nginx-proxy:
build:
context: .
dockerfile: Dockerfiles/nginx.Dockerfile
image: malcolmnetsec/nginx-proxy:2.1.0
restart: "no"
hostname: nginx-proxy
environment:
<< : *auth-variables
<< : *nginx-variables
depends_on:
- moloch
- kibana
- upload
- htadmin
- name-map-ui
ports:
- "443:443"
- "488:488"
- "3030:3030"
- "5601:5601"
- "8443:8443"
- "9200:9200"
- "9600:9600"
volumes:
- nginx-log-path:/var/log/nginx:rw
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/nginx_ldap.conf:/etc/nginx/nginx_ldap.conf:ro
- ./nginx/htpasswd:/etc/nginx/.htpasswd:ro
- ./nginx/ca-trust:/etc/nginx/ca-trust:ro
- ./nginx/certs:/etc/nginx/certs:ro
- ./nginx/certs/dhparam.pem:/etc/nginx/dhparam/dhparam.pem:ro
healthcheck:
test: ["CMD", "curl", "--insecure", "--silent", "https://localhost:443"]
interval: 30s
timeout: 15s
retries: 3
start_period: 120s
# shared named volume so filebeat can access nginx access logs
volumes:
nginx-log-path: