forked from jmpsec/osctrl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
248 lines (239 loc) · 6.8 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
version: "2.4"
services:
######################################### NGINX #########################################
nginx:
container_name: 'osctrl-nginx'
image: nginx:${NGINX_VERSION}
restart: unless-stopped
ports:
- 8000:80
- 8443:443
networks:
- default
- osctrl-backend
volumes:
- type: bind
source: ./deploy/docker/conf/nginx/nginx.conf
target: /etc/nginx/nginx.conf
- type: bind
source: ./deploy/docker/conf/nginx/osctrl.conf
target: /etc/nginx/conf.d/osctrl.conf
- type: bind
source: ./deploy/docker/conf/tls/tls.crt
target: /etc/ssl/certs/osctrl.crt
- type: bind
source: ./deploy/docker/conf/tls/tls.key
target: /etc/ssl/private/osctrl.key
depends_on:
- osctrl-tls
- osctrl-admin
- osctrl-api
healthcheck:
test: ["CMD", "curl", "-f", "-k", "https://localhost"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
cpus: 2
mem_limit: 150M
######################################### osctrl-tls #########################################
osctrl-tls:
image: jmpsec/osctrl-tls:v${OSCTRL_VERSION}
container_name: 'osctrl-tls'
restart: unless-stopped
environment:
#### TLS settings ####
- SERVICE_LISTENER=0.0.0.0
- SERVICE_PORT=9000
- SERVICE_HOST=0.0.0.0
- SERVICE_AUTH=none
- SERVICE_LOGGER=stdout
#### Database settings ####
- DB_HOST=postgres
- DB_NAME=${POSTGRES_DB_NAME}
- DB_USER=${POSTGRES_DB_USERNAME}
- DB_PASS=${POSTGRES_DB_PASSWORD}
#### Redis settings ####
- REDIS_HOST=redis
networks:
- osctrl-backend
depends_on:
- postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
cpus: 2
mem_limit: 150M
######################################### osctrl-admin #########################################
osctrl-admin:
container_name: 'osctrl-admin'
restart: unless-stopped
image: jmpsec/osctrl-admin:v${OSCTRL_VERSION}
environment:
#### TLS settings ####
- SERVICE_LISTENER=0.0.0.0
- SERVICE_PORT=9001
- SERVICE_HOST=0.0.0.0
- SERVICE_AUTH=db
- JWT_SECRET=${JWT_SECRET}
- SERVICE_LOGGER=stdout
#### Database settings ####
- DB_HOST=postgres
- DB_NAME=${POSTGRES_DB_NAME}
- DB_USER=${POSTGRES_DB_USERNAME}
- DB_PASS=${POSTGRES_DB_PASSWORD}
#### Redis settings ####
- REDIS_HOST=redis
networks:
- osctrl-backend
depends_on:
- postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9001"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
cpus: 2
mem_limit: 150M
######################################### osctrl-api #########################################
osctrl-api:
container_name: 'osctrl-api'
restart: unless-stopped
image: jmpsec/osctrl-api:v${OSCTRL_VERSION}
environment:
#### TLS settings ####
- SERVICE_LISTENER=0.0.0.0
- SERVICE_PORT=9002
- SERVICE_HOST=0.0.0.0
- SERVICE_AUTH=jwt
- JWT_SECRET=${JWT_SECRET}
- SERVICE_LOGGER=stdout
#### Database settings ####
- DB_HOST=postgres
- DB_NAME=${POSTGRES_DB_NAME}
- DB_USER=${POSTGRES_DB_USERNAME}
- DB_PASS=${POSTGRES_DB_PASSWORD}
#### Redis settings ####
- REDIS_HOST=redis
networks:
- osctrl-backend
depends_on:
- postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9002"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
cpus: 2
mem_limit: 150M
######################################### PostgreSQL #########################################
postgres:
container_name: 'osctrl-postgres'
restart: unless-stopped
image: postgres:${POSTGRES_VERSION}
environment:
- POSTGRES_DB=${POSTGRES_DB_NAME}
- POSTGRES_USER=${POSTGRES_DB_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_DB_PASSWORD}
networks:
- osctrl-backend
volumes:
- postgres-db:/var/lib/postgresql/data
healthcheck:
test: ["pg_isready", "-U", "$${POSTGRES_USER}", "-d", "$${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
cpus: 2
mem_limit: 1G
######################################### Redis #########################################
redis:
container_name: 'osctrl-redis'
restart: unless-stopped
image: redis:${REDIS_VERSION}
networks:
- osctrl-backend
volumes:
- redis-data:/data
cpus: 1
mem_limit: 100M
######################################### osctrl-cli #########################################
# osctrl-cli is the component that creates the osctrl env and admin user
##############################################################################################
osctrl-cli:
container_name: 'osctrl-cli'
restart: unless-stopped
image: jmpsec/osctrl-cli:v${OSCTRL_VERSION}
tty: true # entrypoint executes `/bin/sh`
environment:
#### osctrl env ####
- ENV_NAME=dev
- CERT_FILE=/opt/osctrl/config/osctrl.crt
- HOST=osctrl-nginx
#### osctrl admin ####
- OSCTRL_USER=${OSCTRL_USER}
- OSCTRL_PASS=${OSCTRL_PASS}
#### Database settings ####
- DB_HOST=postgres
- DB_NAME=${POSTGRES_DB_NAME}
- DB_USER=${POSTGRES_DB_USERNAME}
- DB_PASS=${POSTGRES_DB_PASSWORD}
networks:
- osctrl-backend
depends_on:
- postgres
healthcheck:
test: ["CMD", "/opt/osctrl/bin/osctrl-cli", "check"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 60s
cpus: 1
mem_limit: 100M
######################################### osquery #########################################
ubuntu-osquery:
restart: unless-stopped
build:
context: .
dockerfile: deploy/docker/Dockerfile-osquery
args:
OSQUERY_VERSION: ${OSQUERY_VERSION}
OSCTRL_VERSION: ${OSCTRL_VERSION}
environment:
#### osquery enroll ####
- ENV_NAME=dev
- HOST=osctrl-nginx
#### Database settings ####
- DB_HOST=postgres
- DB_NAME=${POSTGRES_DB_NAME}
- DB_USER=${POSTGRES_DB_USERNAME}
- DB_PASS=${POSTGRES_DB_PASSWORD}
networks:
- osctrl-backend
volumes:
- osquery-data:/var/osquery
- osquery-conf:/etc/osquery
depends_on:
- osctrl-tls
- osctrl-api
- postgres
healthcheck:
test: ["CMD", "test", "-f", "/var/run/osqueryd.pidfile"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 60s
cpus: 1
mem_limit: 150M
networks:
osctrl-backend:
volumes:
postgres-db:
redis-data:
osquery-data:
osquery-conf: