forked from berthayes/cp-siem
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
367 lines (350 loc) · 12 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
---
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
broker:
image: confluentinc/cp-server:7.5.0
hostname: broker
container_name: broker
depends_on:
- zookeeper
ports:
- "9092:9092"
- "9101:9101"
healthcheck:
test: [ "CMD-SHELL", "kafka-topics --list --bootstrap-server localhost:9092" ]
interval: 30s
timeout: 15s
retries: 10
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_REPORTERS_TELEMETRY_AUTO_ENABLE: 'false'
KAFKA_CONFLUENT_BALANCER_ENABLE: 'false'
KAFKA_CONFLUENT_SCHEMA_REGISTRY_URL: http://schema-registry:8081
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_JMX_PORT: 9101
CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous'
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
schema-registry:
image: confluentinc/cp-schema-registry:latest
hostname: schema-registry
container_name: schema-registry
depends_on:
broker:
condition: service_healthy
ports:
- "8081:8081"
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'broker:29092'
connect:
build: kafka-connect
hostname: connect
container_name: connect
user: root
depends_on:
broker:
condition: service_healthy
schema-registry:
condition: service_started
ports:
- "8083:8083"
- "9997:9997"
- "5140:5140/udp"
healthcheck:
interval: 15s
timeout: 15s
retries: 20
test: curl -f http://localhost:8083 || exit 1
environment:
CONNECT_BOOTSTRAP_SERVERS: 'broker:29092'
CONNECT_REST_ADVERTISED_HOST_NAME: connect
CONNECT_REST_PORT: 8083
CONNECT_GROUP_ID: compose-connect-group
CONNECT_CONFIG_STORAGE_TOPIC: _docker-connect-configs
CONNECT_OFFSET_STORAGE_TOPIC: _docker-connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: _docker-connect-status
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
CONNECT_OFFSET_FLUSH_INTERVAL_MS: 10000
CONNECT_KEY_CONVERTER: org.apache.kafka.connect.storage.StringConverter
# CONNECT_KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
CONNECT_VALUE_CONVERTER: io.confluent.connect.avro.AvroConverter
CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
CONNECT_INTERNAL_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_INTERNAL_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_PLUGIN_PATH: "/usr/share/java,/usr/share/confluent-hub-components"
CONNECT_LOG4J_LOGGERS: org.apache.zookeeper=ERROR,org.I0Itec.zkclient=ERROR,org.reflections=ERROR
volumes:
- ./spooldir/:/var/spooldir/
submit-spooldir-source-adhosts:
image: confluentinc/cp-server-connect-base:latest
hostname: submit-spooldir-source-adhosts
container_name: submit-spooldir-source-adhosts
depends_on:
connect:
condition: service_healthy
volumes:
- ./scripts/submit-connector.sh:/usr/bin/submit-connector.sh
- ./kafka-connect/connectors:/connectors
command:
- bash
- -c
- for connector in '/connectors/spooldir-source-adhosts.json' '/connectors/splunk-s2s-source.json' ; do submit-connector.sh $${connector} connect; done
control-center:
image: confluentinc/cp-enterprise-control-center:latest
hostname: control-center
container_name: control-center
user: root
depends_on:
- broker
- schema-registry
- connect
- ksqldb-server
ports:
- "9021:9021"
environment:
CONTROL_CENTER_BOOTSTRAP_SERVERS: 'broker:29092'
CONTROL_CENTER_CONNECT_CONNECT-DEFAULT_CLUSTER: 'connect:8083'
# The control center server connects to ksqlDB through the docker network
CONTROL_CENTER_KSQL_KSQLDB1_URL: "http://ksqldb-server:8088"
# If running locally, your browser must connect to ksqlDB through localhost 8088. If running remotely edit the
# advertised URL to have the appropriate hostname.
CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: ${CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL:-https://localhost:8088}
CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
CONTROL_CENTER_REPLICATION_FACTOR: 1
CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1
CONTROL_CENTER_MODE_ENABLE: "management"
ksqldb-server:
image: confluentinc/cp-ksqldb-server:latest
hostname: ksqldb-server
container_name: ksqldb-server
depends_on:
- broker
- connect
ports:
- "8088:8088"
volumes:
- ./ksqlDB/ksql-extension:/etc/ksql-extension/
- ./mmdb:/opt/mmdb/
environment:
KSQL_CONFIG_DIR: "/etc/ksql"
KSQL_KSQL_EXTENSION_DIR: "/etc/ksql-extension"
KSQL_KSQL_FUNCTIONS_GETGEOFORIP_GEOCITY_DB_PATH: /opt/mmdb/GeoLite2-City.mmdb
KSQL_KSQL_FUNCTIONS_GETASNFORIP_GEOCITY_DB_PATH: /opt/mmdb/GeoLite2-ASN.mmdb
KSQL_BOOTSTRAP_SERVERS: "broker:29092"
KSQL_HOST_NAME: ksqldb-server
KSQL_LISTENERS: "http://0.0.0.0:8088"
KSQL_CACHE_MAX_BYTES_BUFFERING: 0
KSQL_KSQL_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
KSQL_KSQL_CONNECT_URL: "http://connect:8083"
KSQL_KSQL_HIDDEN_TOPICS: '^_.*'
KSQL_KSQL_LOGGING_PROCESSING_STREAM_AUTO_CREATE: "true"
KSQL_KSQL_LOGGING_PROCESSING_TOPIC_AUTO_CREATE: "true"
ksqldb-cli:
image: confluentinc/cp-ksqldb-cli:latest
container_name: ksqldb-cli
depends_on:
- broker
- connect
- ksqldb-server
entrypoint: /bin/sh
tty: true
volumes:
- ./ksqlDB/queries:/queries
# See https://github.com/berthayes/zeek-tcpreplay-kafka
zeek-streamer:
image: localbuild/zeek-tcpreplay-kafka
build:
context: images/zeek-tcpreplay-kafka
platform: linux/amd64
container_name: zeek-streamer
depends_on:
broker:
condition: service_healthy
connect:
condition: service_healthy
hostname: zeek-streamer
entrypoint: /init_dummy.sh
volumes:
- ./scripts/init_dummy.sh:/init_dummy.sh
- ./zeek:/usr/local/zeek/share/zeek/site
- ./pcaps:/pcaps
cap_add:
- NET_ADMIN
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.3.3
container_name: elasticsearch
depends_on:
broker:
condition: service_healthy
connect:
condition: service_healthy
healthcheck:
start_period: 10s
interval: 10s
retries: 20
test: curl --user "elastic:es_pass" -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
ports:
- 9200:9200
- 9300:9300
environment:
ES_JAVA_OPTS: "-Xms1g -Xmx1g"
cluster.name: "elasticsearch-cp-demo"
bootstrap.memory_lock: 'true'
discovery.type: single-node
ELASTIC_PASSWORD: es_pass
xpack.security.enabled: 'false'
kibana:
image: docker.elastic.co/kibana/kibana:8.3.3
container_name: kibana
restart: always
healthcheck:
interval: 10s
retries: 20
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://kibana:5601/api/status || exit 1
depends_on:
- elasticsearch
ports:
- 5601:5601
environment:
NEWSFEED_ENABLED: 'false'
TELEMETRY_OPTIN: 'false'
TELEMETRY_ENABLED: 'false'
SERVER_MAXPAYLOADBYTES: 4194304
KIBANA_AUTOCOMPLETETIMEOUT: 3000
KIBANA_AUTOCOMPLETETERMINATEAFTER: 2500000
splunk:
image: splunk/splunk:8.2.1
depends_on:
broker:
condition: service_healthy
connect:
condition: service_healthy
platform: linux/amd64
container_name: splunk
hostname: splunk
environment:
- SPLUNK_START_ARGS=--accept-license
- SPLUNK_HEC_TOKEN=ef16f05f-40e0-4108-a644-5323e02aaa44
- SPLUNK_PASSWORD
- SPLUNK_APPS_URL=https://raw.githubusercontent.com/JohnnyMirza/confluent_splunk_demo/main/splunk-add-on-for-cisco-asa_410.tgz
ports:
- 8000:8000
- 8090:8090
volumes:
- ./splunk/default.yml:/tmp/defaults/default.yml
- ./splunk/splunk-search/:/opt/splunk/etc/apps/splunk-search
splunk_uf1:
image: splunk/universalforwarder:8.2.1
platform: linux/amd64
hostname: splunk_uf1
container_name: splunk_uf1
depends_on:
- connect
environment:
- SPLUNK_START_ARGS=--accept-license --answer-yes --no-prompt
- SPLUNK_PASSWORD=dingdong
- SPLUNK_APPS_URL=https://raw.githubusercontent.com/JohnnyMirza/confluent_splunk_demo/main/splunk-add-on-for-cisco-asa_410.tgz
volumes:
- ./splunk/splunk-uf1/:/opt/splunkforwarder/etc/apps/splunk-uf1/
ports:
- "3333"
splunk_eventgen:
image: guilhemmarchand/splunk-eventgen:latest
container_name: splunk_eventgen
restart: unless-stopped
user: 'root'
volumes:
- ./splunk/splunk-eventgen/:/opt/splunk-eventgen
ports:
- 6379:6379
- 9500:9500
depends_on:
- splunk_uf1
command: 'splunk_eventgen -v generate /opt/splunk-eventgen/default/eventgen.conf'
sigma-zeek-dns-streams:
image: streamingblocks/confluent-sigma:1.3.0
container_name: sigma-zeek-dns-streams
platform: linux/amd64
depends_on:
broker:
condition: service_healthy
hostname: sigma-zeek-dns-streams
environment:
application_id: 'zeek-dns-rules-streams-app'
bootstrap_servers: 'broker:29092'
schema_registry: 'http://schema-registry:8081'
data_topic: 'dns'
output_topic: 'dns-detection'
field_mapping_file: '/tmp/config/splunk-zeek.yml'
sigma_rules_topic: 'sigma-rules'
sigma_rule_filter_product: 'zeek'
sigma_rule_filter_service: 'dns'
volumes:
- ./sigma:/tmp/config
sigma-splunk-cisco-asa-streams:
image: streamingblocks/confluent-sigma:1.3.0
container_name: sigma-splunk-cisco-asa-streams
platform: linux/amd64
depends_on:
broker:
condition: service_healthy
hostname: sigma-splunk-cisco-asa-streams
environment:
application_id: 'splunk-cisco-asa-rules-streams-app'
bootstrap_servers: 'broker:29092'
schema_registry: 'http://schema-registry:8081'
data_topic: 'splunk-s2s-events'
output_topic: 'splunk-cisco-asa-detection'
field_mapping_file: '/tmp/config/splunk-zeek.yml'
sigma_rules_topic: 'sigma-rules'
sigma_rule_filter_product: 'splunk'
sigma_rule_filter_service: 'cisco:asa'
volumes:
- ./sigma:/tmp/config
sigma-streams-ui:
image: streamingblocks/confluent-sigma-ui:1.3.0
container_name: sigma-streams-ui
platform: linux/amd64
depends_on:
broker:
condition: service_healthy
hostname: sigma-streams-ui
ports:
- 8080:8080
environment:
bootstrap_servers: 'broker:29092'
schema_registry: 'http://schema-registry:8081'
group_id: 'sigma-streams-ui'
auto_offset.reset: 'latest'
key_deserializer: 'org.apache.kafka.common.serialization.StringDeserializer'
value_deserializer: 'org.apache.kafka.common.serialization.StringDeserializer'
topic_list: 'dns, dns-detection, splunk-s2s-events, firewalls'
sigma_rules_topic: 'sigma-rules'