Repository navigation
Small fixes for fuzzing CI and uploading results - #1175
Conversation
✅ Deploy Preview for urunc canceled.
|
bcff0bc to
89e5225
Compare
|
Hello @pocopepe can you also review this? |
|
thanks @cmainas! This fixes the actual reason the scheduled fuzz runs fail on main (eg. run 40791889402): The allowlist The fuzz workflows only run on schedule/dispatch, so the files in this PR have not run here (the urunc_test runs use a shared Nits:
I intend to approve -- let me know if you want to touch any of the nits first. |
|
Hi @cmainas, thanks for the fixes! looked through it, LGTM. Agree with the SARIF note above, we'll need to handle it before a second target. |
The root `.dockerignore` excludes everything not on its allowlist, and ClusterFuzzLite builds `.clusterfuzzlite/Dockerfile` with the repository root as context. `COPY .clusterfuzzlite/build.sh` therefore fails and the fuzzing workflows cannot build. Add the directory to the allowlist. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
`compile_native_go_fuzzer_v2` only prints a message and exits 0 when it cannot find the fuzz function. After a rename the build would pass, no target would run and the workflow would stay green. To avoid that, check that the binary was produced. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
- Upload `cifuzz-sarif/results.sarif` after batch runs. `output-sarif` only writes the file, so crashes never reached code scanning. - Upload it from a separate job. The ClusterFuzzLite actions run mutable `:v1` images, so the job running them keeps a read-only token, and only the upload job gets `security-events: write`. - Put batch and prune in one concurrency group. Each run downloads the corpus, changes it and uploads it again, so overlapping runs would overwrite each other's corpus. - Prune the corpus weekly instead of daily. Each run rebuilds the fuzzers, and the corpus of a single target grows slowly. - Rename `fuzz_nightly.yml` to `fuzz_batch.yml` to match `fuzz_prune.yml`. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
The `base-builder-go` image is pinned by digest and ships its own Go toolchain. Without updates it would eventually fall behind `go.mod`. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
The pinned SHA is the `v4.39.1` tag, as in `codeql.yml`, not `v3.29.5`. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
89e5225 to
bb6c65c
Compare
The root `.dockerignore` excludes everything not on its allowlist, and ClusterFuzzLite builds `.clusterfuzzlite/Dockerfile` with the repository root as context. `COPY .clusterfuzzlite/build.sh` therefore fails and the fuzzing workflows cannot build. Add the directory to the allowlist. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
`compile_native_go_fuzzer_v2` only prints a message and exits 0 when it cannot find the fuzz function. After a rename the build would pass, no target would run and the workflow would stay green. To avoid that, check that the binary was produced. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
- Upload `cifuzz-sarif/results.sarif` after batch runs. `output-sarif` only writes the file, so crashes never reached code scanning. - Upload it from a separate job. The ClusterFuzzLite actions run mutable `:v1` images, so the job running them keeps a read-only token, and only the upload job gets `security-events: write`. - Put batch and prune in one concurrency group. Each run downloads the corpus, changes it and uploads it again, so overlapping runs would overwrite each other's corpus. - Prune the corpus weekly instead of daily. Each run rebuilds the fuzzers, and the corpus of a single target grows slowly. - Rename `fuzz_nightly.yml` to `fuzz_batch.yml` to match `fuzz_prune.yml`. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
The `base-builder-go` image is pinned by digest and ships its own Go toolchain. Without updates it would eventually fall behind `go.mod`. PR: #1175 Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com> Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk> Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
Description
This is a follow up of #1128. It performs the following fixes:
.dockerignoreonly allows a fixed list of paths and did not include.clusterfuzzlite/, soCOPY .clusterfuzzlite/build.shfailed.output-sarifonly writescifuzz-sarif/results.sarif. The batch workflow now saves it as an artifact and a separateupload-sarifjob uploads it. The ClusterFuzzLite actions run mutable:v1images, so the job running them only gets read access, and only the upload job getssecurity-events: write.fuzz_nightly.ymltofuzz_batch.yml(daily at 00:00 UTC, 30 minutes of fuzzing). and makefuzz_prune.ymlto run weekly (Sundays 13:30 UTC) instead of daily, since each run rebuilds the fuzzers and the corpus of a single target grows slowly. Both share theclusterfuzzlite-corpusconcurrency group, because each run downloads the corpus, changes it and uploads it again.base-builder-goimage digest through dependabot.Related issues
How was this tested?
In a separate repository. Workflow runs:
LLM usage
Opus 5.5
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).