Documentation
¶
Overview ¶
Command fptraffic records the traffic of a real application as a HAR file, for the false-positive run (hack/fp-run.sh, make fp-run; #600, #707). It plays a few users of the application, each with the requests its front end (or its API clients) sends, in a browser's order and with a browser's headers. Every request is one a user of the application sends: the denials of a policy on this traffic are its false positives. The applications (-app), each in its own file:
- juice-shop: OWASP Juice Shop, an online shop with an Angular front end and a REST API (juiceshop.go).
- gitea: Gitea, a code forge: its web UI and its REST API, with Markdown issues and comments, code and attachments (gitea.go).
- wordpress: WordPress, a CMS: its admin, the block editor's REST calls, media uploads, comments and searches (wordpress.go).
- directus: Directus, a headless CMS's JSON API: REST with JSON filters, GraphQL, file uploads (directus.go).
It records the requests only, with the response's status: no response body (the application's content) is in the file, and the address it was sent to is replaced by -public-url everywhere in the requests. Free text (reviews, posts, issues, searches) is drawn from fixed lists with a fixed seed, so a recording against the same version has the same requests, apart from IDs, nonces and tokens the application hands out. Passwords are the made-up users' own; sessions and tokens are the throwaway ones of the recording's container.
docker run --rm -d -p 3000:3000 bkimminich/juice-shop:<JUICE_SHOP_VERSION> go run ./hack/fptraffic -app juice-shop -target http://127.0.0.1:3000 -out hack/fptraffic/juice-shop.har.gz
make fp-har runs both (hack/fptraffic/record.sh, APP=<app>), with the versions in hack/versions.env, on a new application.