microsoft / restler-fuzzer

RESTler is the first stateful REST API fuzzing tool for automatically testing cloud services through their REST APIs and finding security and reliability bugs in these services.
MIT License
2.52k stars 284 forks source link

random_seed option does not behave as expected #780

Open marina-p opened 1 year ago

marina-p commented 1 year ago

Description

Currently, the random_seed engine setting is applied inconsistently across different checkers/fuzzing modes. This needs to be fixed, as follows:

1) Test mode Test mode should be deterministic by default, and use the same random seed. If users plug in a different random seed via the engine settings, this should be used consistently everywhere (remove any hard-coded constants).

2) Fuzz modes:

By default, fuzz modes should behave the same as 'Test' mode. This minimizes confusion when first setting up RESTler - a user will by default have deterministic runs to improve coverage in 'Test' mode and get clean on the 'Fuzz' modes.

However, a subsequent use case is to add CI/CD coverage, for which the user may want to vary the random seed on each run to get additional coverage over time. A new option should be provided in the engine settings for this (so the user does not need to generate the new seed themselves every time), for example generate_random_seed: true (this will override the random_seed option if specified in the settings file).

The random seed should be logged to the testing summary so it is easily discoverable.

If a user wants to generate the random seed themselves (for example, to deterministically re-run with a particular seed that found a bug), they could do so by plugging in the random_seed value from the testing summary in the engine settings.

Steps to reproduce

See above.

Expected results

No response

Actual results

No response

Environment details

No response

wilbaker commented 1 year ago

@marina-p thanks for filing this! I've not used the random_seed myself and I have a few questions about how this change would work:

marina-p commented 1 year ago

Hello @wilbaker,

Thanks,

Marina