Add webhook + fieldpath fuzz tests with scheduled CI#68
Conversation
Signed-off-by: Cyrill Berg <cyrill.berg@opendefense.cloud>
…ecode Signed-off-by: Cyrill Berg <cyrill.berg@opendefense.cloud>
Signed-off-by: Cyrill Berg <cyrill.berg@opendefense.cloud>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis pull request adds comprehensive Go fuzzing infrastructure to the repository. Two new fuzz tests exercise input-parsing logic in fieldpath resolution and webhook request validation, while a new GitHub Actions workflow automates their execution on a schedule and captures any discovered fuzz corpus for analysis. ChangesFuzzing Infrastructure and Tests
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly Related Issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Why
OSSF Scorecard
Fuzzing(Medium) was unsatisfied — noFuzz*functions in the repo. The webhook is the highest-value target: it decodes externally-suppliedAdmissionReviewJSON on the admission hot path, and a panic there fails admission for every gated API call.Addresses issue #57
What
FuzzResolveininternal/fieldpath/— fuzzes the dot-path resolver called from the webhook's deletion-validator loop.FuzzObjectFromRequestininternal/webhook/— fuzzes the admission-request JSON decode + theOldObject/Objectselection..github/workflows/fuzz.yaml— weekly schedule +workflow_dispatchwith configurablefuzztime; matrix over both targets; uploads any discovered corpus on failure. Usesgo-version-file: go.mod.Test plan
go test ./internal/fieldpath/... ./internal/webhook/...passes (seed corpus runs cleanly)FuzzResolvefor 2m locally → 106M execs, 18 interesting inputs, no crashFuzzObjectFromRequestfor 2m locally → 2.6M execs, 282 interesting inputs, no crashactionlintclean on the new workflowFuzzingsatisfiedSummary by CodeRabbit