elastic / elastic/beats

Introduce fuzzy testing on Beats

Open
#35,730 3 comments 1 reaction 1 assignee Claimed by @belimawr View on GitHub
enhancement Team:Elastic-Agent
Dominant language
Go
Stars
12.7k
Forks
5k
Avg merge
2d 15m
Merged PRs (30d)
385

Description

> Fuzzing is a type of automated testing which continuously manipulates inputs to a program to find bugs. Go fuzzing uses coverage guidance to intelligently walk through the code being fuzzed to find and report failures to the user.

Go recently [introduced native support for Fuzzing](https://go.dev/security/fuzz/) as part of the `testing` package. We should start using it, the sooner we add it to our codebase with clear example/guides on how to use it, the easier it will be for anyone adding new tests to also use fuzzing where it makes sense.

We recently had some bugs in the TCP and UDP inputs that could have been caught by fuzzy-testing some of the functions used by those inputs.

Here is a couple of functions from those inputs that we could fuzzy-test to ensure they never panic:
https://github.com/elastic/beats/blob/f15240f0a326655842a659eed2cefd1c34d8a1f0/filebeat/input/udp/input.go#L318-L369

https://github.com/efd6/beats/blob/6dd570fb97c0a14ce902f788d90fb29fb099babe/filebeat/input/tcp/input.go#L296-L313

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.