[VRP] Ensure untrusted fuzzers do not fuzz in long-lived bots - #5323
[VRP] Ensure untrusted fuzzers do not fuzz in long-lived bots#5323PauloVLB wants to merge 8 commits into
Conversation
85c2781 to
0e2fa1e
Compare
79ed510 to
c868b40
Compare
c09e390 to
f3a6d50
Compare
7e42c64 to
8681bdc
Compare
8681bdc to
c094792
Compare
c094792 to
41641d6
Compare
|
This PR has been pending for some time due to competing priorities and the difficulty of validating changes in dev. Given that we don't have "truly untrusted" fuzzers in production yet and I would like to make progress, I believe it is reasonable to test with a fake untrusted fuzzer in the production environment. That is why I am opening this for review without full validation in dev. |
| jobs = get_job_list(jobs_selection) | ||
| selected_mappings = [entity for entity in mappings if entity.job in jobs] | ||
|
|
||
| if not environment.is_uworker(): |
There was a problem hiding this comment.
optional: I've mentioned this on another PR, but it would be very nice to have helper functions that capture what we mean in a more descriptive way. We have separate is_tworker and is_uworker and there is a nuance to using not is_uworker and not is_tworker because it's possible for both is_uworker and is_tworker to be false for our "Trusted" Windows and Mac bots. Perhaps we link the enum of RunTime with their separate capabilities.
fwiw your logic here seems correct :)
There was a problem hiding this comment.
That’s a good point. I agree that it’s a helpful cleanup, I can make a follow-up PR to address it.
41641d6 to
ef323f1
Compare
ViniciustCosta
left a comment
There was a problem hiding this comment.
I had a few questions that we discussed offline and I will drop here:
- Are long-lived bots only running fuzz tasks or is the logic still "get task from queue, if idle, fuzz"?
- Is this also mapped for mac/android/windows bots?
After #5411, only bots under the
Yes. But since untrusted fuzzers cannot be created with non-Linux jobs (#5329), they should not be an issue. |
ef323f1 to
3581724
Compare
Sgtm, thanks Paulo! |
3581724 to
e6ed726
Compare
Problem
Untrusted fuzzers (e.g., external VRP fuzzers) shouldn't run on long-lived bots because they could be malicious or leak sensitive host info. They should only run in isolated, ephemeral environments like Google Cloud Batch.
Proposed Solution
Filter out fuzzers that aren't marked as
trustedfrom being selected by long-lived bots in the task leasing logic.Added runtime assertions (
log_fatal_and_exit) to ensure that if a long-lived bot somehow ends up running an untrusted fuzzer, it will crash immediately before executing any code.Chaining Note
This PR is chained on top of
vrp-untrusted-fuzzer-uiwhich introduces thetrustedfield. Note thattrusteddefaults toTruefor now to maintain compatibility with existing fuzzers without requiring a backfill, but it will be flipped toFalseby default in a future update.Testing
Validated by checking task assignment logic to confirm long-lived bots do not pick up tasks for non-trusted fuzzers.