Skip to content

Commit

Permalink
#78 Added RESTler fuzzer scripts (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
vityaman authored Apr 24, 2024
1 parent bc1be8b commit 579a52c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ gradle :botalka:bootJar
### Start infrastructure

```bash
docker compose down
docker compose up --build --force-recreate
```

Expand All @@ -35,3 +34,9 @@ docker compose up --build --force-recreate
docker exec -it lms-database bash
psql -h localhost -p 5432 -d $POSTGRES_DB -U $POSTGRES_USER
```

### Connect to fuzzer

```bash
docker exec -it lms-fuzzer sh
```
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ services:
POSTGRES_PASSWORD: postgres
networks:
- lms-network
fuzzer:
container_name: lms-fuzzer
image: restler
stdin_open: true
tty: true
restart: always
volumes:
- .:/lms
networks:
- lms-network
profiles:
- fuzzing
networks:
lms-network:
driver: bridge
6 changes: 6 additions & 0 deletions fuzzing/analyze.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

RESTler/resultsAnalyzer/Restler.ResultsAnalyzer analyze /Fuzz/RestlerResults

less runSummary.json
less errorBuckets.json
5 changes: 5 additions & 0 deletions fuzzing/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

API_SPEC=lms/botalka/src/main/resources/static/openapi/api.yml
RESTler/restler/Restler compile \
--api_spec $API_SPEC
6 changes: 6 additions & 0 deletions fuzzing/fuzz.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

RESTler/restler/Restler fuzz \
--settings lms/fuzzing/settings.json \
--grammar_file Compile/grammar.py \
--dictionary_file Compile/dict.json
8 changes: 8 additions & 0 deletions fuzzing/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"host": "lms-botalka",
"target_port": 8080,
"no_ssl": true,
"custom_non_bug_codes": ["400"],
"fuzzing_mode": "random-walk",
"time_budget": 1
}

0 comments on commit 579a52c

Please sign in to comment.