cncf / cncf-fuzzing

✨🔐 CNCF Fuzzers
https://cncf.io/projects
Apache License 2.0
111 stars 41 forks source link

Keycloak: Add mock web server service and relative dependencies #426

Closed arthurscchan closed 1 year ago

arthurscchan commented 1 year ago

Some fuzzer class requires HTTP connection to get response and further process on those response. For example the fuzzers in #423 and #425. In order to accommodate this setting, this PR add the okhttp3.MockWebServer service and related dependencies to allow these fuzzers to create a MockWebServer for random response. The fuzzer points the http auth url to the MockWebServer initialise during fuzzer initialisation process and generate random mock response to trigger those response processing logic for fuzzing. By default, HTTP connection are banned by Jazzer BugDetectors. Specific exclusion predicate can be set to allow HTTP connection to specific hostname and port. This is done in the fuzzerInitialize of the fuzzers to ensure only connection to the localhost mock web server is allowed.