Skip to content

Commit 216056f

Browse files
authored
Merge pull request #37 from VRIG-RITSEC/distributed-database
added proper fix for script
2 parents d4af5d8 + d1e7c26 commit 216056f

File tree

2 files changed

+188
-6
lines changed

2 files changed

+188
-6
lines changed

Scripts/fuzzer-stats.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,15 @@ main() {
7474

7575
# Get global statistics
7676
echo -e "${GREEN}=== Global Statistics ===${NC}"
77-
global_stats=$(run_query "SELECT total_programs, total_executions, total_crashes, active_fuzzers FROM global_statistics;")
78-
if [ -n "$global_stats" ]; then
77+
global_stats=$(run_query "SELECT total_programs, total_executions, total_crashes, active_fuzzers FROM global_statistics;" | xargs)
78+
if [ -n "$global_stats" ] && [ "$global_stats" != "" ]; then
7979
IFS='|' read -r total_programs total_executions total_crashes active_fuzzers <<< "$global_stats"
8080
echo -e " ${YELLOW}Total Programs:${NC} $(format_number "$total_programs")"
8181
echo -e " ${YELLOW}Total Executions:${NC} $(format_number "$total_executions")"
8282
echo -e " ${YELLOW}Total Crashes:${NC} ${RED}$(format_number "$total_crashes")${NC}"
8383
echo -e " ${YELLOW}Active Fuzzers:${NC} $(format_number "$active_fuzzers")"
84+
else
85+
echo -e " ${YELLOW}No global statistics available${NC}"
8486
fi
8587
echo ""
8688

@@ -89,7 +91,7 @@ main() {
8991
echo ""
9092

9193
# Header
92-
printf "%-6s %-20s %-10s %-12s %-12s %-10s %-15s\n" \
94+
printf "%-6s %-20s %-10s %-12s %-12s %-12s %-10s %-15s\n" \
9395
"ID" "Name" "Status" "Execs/s" "Programs" "Executions" "Crashes" "Highest Coverage %"
9496
echo "--------------------------------------------------------------------------------------------------------"
9597

@@ -125,15 +127,15 @@ main() {
125127
status_color="${RED}"
126128
fi
127129

128-
printf "%-6s %-20s ${status_color}%-10s${NC} %-12s %-12s %-12s %-10s %-15s\n" \
130+
printf "%-6s %-20s ${status_color}%-10s${NC} %-12s %-12s %-12s ${RED}%-10s${NC} ${CYAN}%-15s${NC}\n" \
129131
"$fuzzer_id" \
130132
"$fuzzer_name" \
131133
"$status" \
132134
"$execs_formatted" \
133135
"$(format_number "$programs")" \
134136
"$(format_number "$executions")" \
135-
"${RED}$(format_number "$crashes")${NC}" \
136-
"${CYAN}${cov_formatted}%${NC}"
137+
"$(format_number "$crashes")" \
138+
"${cov_formatted}%"
137139
done <<< "$fuzzer_data"
138140
fi
139141
echo ""

docker-compose.workers.yml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,186 @@ services:
7272
memory: 1G
7373

7474

75+
# Worker 3 - Fuzzilli Container
76+
fuzzer-worker-3:
77+
build:
78+
context: /home/tropic/vrig/fuzzilli-vrig-proj/fuzzillai
79+
dockerfile: Cloud/VRIG/Dockerfile.distributed
80+
container_name: fuzzer-worker-3
81+
environment:
82+
- POSTGRES_URL=postgresql://fuzzilli:fuzzilli123@postgres-master:5432/fuzzilli_master
83+
- FUZZER_INSTANCE_NAME=fuzzer-3
84+
- TIMEOUT=2500
85+
- MIN_MUTATIONS_PER_SAMPLE=25
86+
- DEBUG_LOGGING=false
87+
depends_on:
88+
postgres-master:
89+
condition: service_healthy
90+
volumes:
91+
- fuzzer_data_3:/home/app/Corpus
92+
- /home/tropic/vrig/fuzzilli-vrig-proj/fuzzbuild:/home/app/fuzzbuild:ro
93+
restart: unless-stopped
94+
healthcheck:
95+
test: ["CMD-SHELL", "pgrep -f FuzzilliCli || exit 1"]
96+
interval: 30s
97+
timeout: 10s
98+
retries: 3
99+
start_period: 60s
100+
networks:
101+
- fuzzing-network
102+
deploy:
103+
resources:
104+
limits:
105+
memory: 2G
106+
reservations:
107+
memory: 1G
108+
109+
110+
# Worker 4 - Fuzzilli Container
111+
fuzzer-worker-4:
112+
build:
113+
context: /home/tropic/vrig/fuzzilli-vrig-proj/fuzzillai
114+
dockerfile: Cloud/VRIG/Dockerfile.distributed
115+
container_name: fuzzer-worker-4
116+
environment:
117+
- POSTGRES_URL=postgresql://fuzzilli:fuzzilli123@postgres-master:5432/fuzzilli_master
118+
- FUZZER_INSTANCE_NAME=fuzzer-4
119+
- TIMEOUT=2500
120+
- MIN_MUTATIONS_PER_SAMPLE=25
121+
- DEBUG_LOGGING=false
122+
depends_on:
123+
postgres-master:
124+
condition: service_healthy
125+
volumes:
126+
- fuzzer_data_4:/home/app/Corpus
127+
- /home/tropic/vrig/fuzzilli-vrig-proj/fuzzbuild:/home/app/fuzzbuild:ro
128+
restart: unless-stopped
129+
healthcheck:
130+
test: ["CMD-SHELL", "pgrep -f FuzzilliCli || exit 1"]
131+
interval: 30s
132+
timeout: 10s
133+
retries: 3
134+
start_period: 60s
135+
networks:
136+
- fuzzing-network
137+
deploy:
138+
resources:
139+
limits:
140+
memory: 2G
141+
reservations:
142+
memory: 1G
143+
144+
145+
# Worker 5 - Fuzzilli Container
146+
fuzzer-worker-5:
147+
build:
148+
context: /home/tropic/vrig/fuzzilli-vrig-proj/fuzzillai
149+
dockerfile: Cloud/VRIG/Dockerfile.distributed
150+
container_name: fuzzer-worker-5
151+
environment:
152+
- POSTGRES_URL=postgresql://fuzzilli:fuzzilli123@postgres-master:5432/fuzzilli_master
153+
- FUZZER_INSTANCE_NAME=fuzzer-5
154+
- TIMEOUT=2500
155+
- MIN_MUTATIONS_PER_SAMPLE=25
156+
- DEBUG_LOGGING=false
157+
depends_on:
158+
postgres-master:
159+
condition: service_healthy
160+
volumes:
161+
- fuzzer_data_5:/home/app/Corpus
162+
- /home/tropic/vrig/fuzzilli-vrig-proj/fuzzbuild:/home/app/fuzzbuild:ro
163+
restart: unless-stopped
164+
healthcheck:
165+
test: ["CMD-SHELL", "pgrep -f FuzzilliCli || exit 1"]
166+
interval: 30s
167+
timeout: 10s
168+
retries: 3
169+
start_period: 60s
170+
networks:
171+
- fuzzing-network
172+
deploy:
173+
resources:
174+
limits:
175+
memory: 2G
176+
reservations:
177+
memory: 1G
178+
179+
180+
# Worker 6 - Fuzzilli Container
181+
fuzzer-worker-6:
182+
build:
183+
context: /home/tropic/vrig/fuzzilli-vrig-proj/fuzzillai
184+
dockerfile: Cloud/VRIG/Dockerfile.distributed
185+
container_name: fuzzer-worker-6
186+
environment:
187+
- POSTGRES_URL=postgresql://fuzzilli:fuzzilli123@postgres-master:5432/fuzzilli_master
188+
- FUZZER_INSTANCE_NAME=fuzzer-6
189+
- TIMEOUT=2500
190+
- MIN_MUTATIONS_PER_SAMPLE=25
191+
- DEBUG_LOGGING=false
192+
depends_on:
193+
postgres-master:
194+
condition: service_healthy
195+
volumes:
196+
- fuzzer_data_6:/home/app/Corpus
197+
- /home/tropic/vrig/fuzzilli-vrig-proj/fuzzbuild:/home/app/fuzzbuild:ro
198+
restart: unless-stopped
199+
healthcheck:
200+
test: ["CMD-SHELL", "pgrep -f FuzzilliCli || exit 1"]
201+
interval: 30s
202+
timeout: 10s
203+
retries: 3
204+
start_period: 60s
205+
networks:
206+
- fuzzing-network
207+
deploy:
208+
resources:
209+
limits:
210+
memory: 2G
211+
reservations:
212+
memory: 1G
213+
214+
215+
# Worker 7 - Fuzzilli Container
216+
fuzzer-worker-7:
217+
build:
218+
context: /home/tropic/vrig/fuzzilli-vrig-proj/fuzzillai
219+
dockerfile: Cloud/VRIG/Dockerfile.distributed
220+
container_name: fuzzer-worker-7
221+
environment:
222+
- POSTGRES_URL=postgresql://fuzzilli:fuzzilli123@postgres-master:5432/fuzzilli_master
223+
- FUZZER_INSTANCE_NAME=fuzzer-7
224+
- TIMEOUT=2500
225+
- MIN_MUTATIONS_PER_SAMPLE=25
226+
- DEBUG_LOGGING=false
227+
depends_on:
228+
postgres-master:
229+
condition: service_healthy
230+
volumes:
231+
- fuzzer_data_7:/home/app/Corpus
232+
- /home/tropic/vrig/fuzzilli-vrig-proj/fuzzbuild:/home/app/fuzzbuild:ro
233+
restart: unless-stopped
234+
healthcheck:
235+
test: ["CMD-SHELL", "pgrep -f FuzzilliCli || exit 1"]
236+
interval: 30s
237+
timeout: 10s
238+
retries: 3
239+
start_period: 60s
240+
networks:
241+
- fuzzing-network
242+
deploy:
243+
resources:
244+
limits:
245+
memory: 2G
246+
reservations:
247+
memory: 1G
248+
249+
75250
volumes:
76251
fuzzer_data_1:
77252
fuzzer_data_2:
253+
fuzzer_data_3:
254+
fuzzer_data_4:
255+
fuzzer_data_5:
256+
fuzzer_data_6:
257+
fuzzer_data_7:

0 commit comments

Comments
 (0)