microsoft / onefuzz

A self-hosted Fuzzing-As-A-Service platform
MIT License
2.82k stars 199 forks source link

`Expand` parameters should be passed to tasks via the config rather than function arguments #3565

Open kananb opened 9 months ago

kananb commented 9 months ago

Most tasks initialize an Expand object for expanding variables in target_options. The values for these parameters mostly come from the config that the task is created with, with the exception of a few which are passed directly to the function that initializes the expander.

In some cases, it's clear why these variables need to be passed as arguments to the function. But in others, it's less clear: -supervisor.rs (TODO: link to updated code after merging #3553) ; the primary, and somewhat outlying case. The concerning function is passed a config and several additional arguments that are used as expander values.

In general, we should take a closer look at what variables need to be passed later on in the task's lifetime (as an argument) and which can be refactored to be given as a config value instead.

AB#167691