-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
184 lines (174 loc) · 4.14 KB
/
docker-compose.yml
File metadata and controls
184 lines (174 loc) · 4.14 KB
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
services:
# client-internal su rete interna
client_internal:
build:
context: ./client_internal
container_name: client_internal
networks:
internal-net:
ipv4_address: 172.20.0.2
tty: true
sysctls:
- net.ipv4.conf.all.accept_redirects=1
cap_add:
- NET_ADMIN
command: tail -f /dev/null
# client-external su rete esterna
client_external:
build:
context: ./client_external
container_name: client_external
networks:
external-net:
ipv4_address: 172.21.0.2
tty: true
sysctls:
- net.ipv4.conf.all.accept_redirects=1
cap_add:
- NET_ADMIN
command: tail -f /dev/null
# client wifi su rete wifi
client_wifi:
build:
context: ./client_wifi
container_name: client_wifi
networks:
wifi-net:
ipv4_address: 172.22.0.2
tty: true
sysctls:
- net.ipv4.conf.all.accept_redirects=1
cap_add:
- NET_ADMIN
command: tail -f /dev/null
# Snort + Squid + iptables. Smista richieste verso pep.
gateway:
build:
context: ./gateway
container_name: gateway
volumes:
- ./logs/squid:/var/log/squid
- ./logs/snort:/var/log/snort
- ./pdp/data/blacklist:/app/blacklist
ports:
- "3128:3128"
networks:
internal-net:
ipv4_address: 172.20.0.3
external-net:
ipv4_address: 172.21.0.3
wifi-net:
ipv4_address: 172.22.0.3
zt-gateway:
ipv4_address: 172.24.0.2
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
tty: true
command: ["/bin/bash", "-c", "/etc/init.d/squid start && tail -f /dev/null"]
# Verifica politiche di accesso e chiama il PDP
pep:
build:
context: ./pep
container_name: pep
env_file:
- ./pep/.env
ports:
- "3100:3100"
networks:
zt-gateway:
ipv4_address: 172.24.0.3
zt-core:
ipv4_address: 172.25.0.2
volumes:
- ./pep/users_db.json:/app/users_db.json
depends_on:
- pdp
# Decide in base a policy (es. reputazione IP, orario, etc.)
pdp:
build:
context: ./pdp
container_name: pdp
networks:
zt-core:
ipv4_address: 172.25.0.3
cap_add:
- NET_ADMIN
volumes:
- ./pdp/data/trust_db.json:/app/trust_db.json
- ./pdp/data/blacklist:/app/data/blacklist
env_file:
- ./pdp/.env
# Risorsa protetta
db:
image: postgres:latest
container_name: db
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
networks:
zt-core:
ipv4_address: 172.25.0.4
ports:
- "5432:5432"
volumes:
- ./db/schema.sql:/docker-entrypoint-initdb.d/01_schema.sql
- ./db/data.sql:/docker-entrypoint-initdb.d/02_data.sql
- ./db/certs:/certs:ro
- ./db/init/03_ssl.sh:/docker-entrypoint-initdb.d/03_ssl.sh:ro
- db_data:/var/lib/postgresql/data
splunk:
image: splunk/splunk:latest
container_name: splunk
platform: linux/amd64
environment:
- SPLUNK_START_ARGS=--accept-license
- SPLUNK_PASSWORD=${SPLUNK_PASSWORD}
ports:
- "8000:8000"
- "8088:8088"
- "8089:8089"
networks:
zt-core:
ipv4_address: 172.25.0.5
volumes:
- ./logs/squid:/var/log/squid
- ./logs/snort:/var/log/snort
- ./splunk-apps/log_inputs:/opt/splunk/etc/apps/log_inputs
- ./splunk-apps/dashboard:/opt/splunk/etc/apps/dashboard
- ./splunk-apps/lookups:/opt/splunk/etc/apps/search/lookups
- splunk_etc:/opt/splunk/etc
- splunk_var:/opt/splunk/var
networks:
internal-net:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
external-net:
driver: bridge
ipam:
config:
- subnet: 172.21.0.0/16
wifi-net:
driver: bridge
ipam:
config:
- subnet: 172.22.0.0/16
zt-gateway:
driver: bridge
ipam:
config:
- subnet: 172.24.0.0/16
zt-core:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/16
volumes:
db_data:
splunk_etc:
splunk_var: