ProductPromotion
Logo

Go.Lang

made by https://0x3d.site

GitHub - jidicula/go-fuzz-action: GitHub Action for Go 1.18 fuzz testing
GitHub Action for Go 1.18 fuzz testing. Contribute to jidicula/go-fuzz-action development by creating an account on GitHub.
Visit Site

GitHub - jidicula/go-fuzz-action: GitHub Action for Go 1.18 fuzz testing

GitHub - jidicula/go-fuzz-action: GitHub Action for Go 1.18 fuzz testing

go-fuzz-action

GitHub Action for Go fuzz testing. This Action runs Go's built-in fuzz testing, added in Go 1.18, on your code.

Do you find this useful?

You can sponsor me here!

Inputs

  • fuzz-time [REQUIRED]: Fuzz target iteration duration, specified as a time.Duration (for example 1h30s). Corresponds to -fuzztime flag for the go test command. Ensure this is less than your job/workflow timeout.
  • packages [optional]: Run fuzz test on these packages. Corresponds to the [packages] input for the go test command.
    • Default: .
  • fuzz-regexp [optional]: Run the fuzz test matching the regular expression. Corresponds to the -fuzz flag for the go test command.
    • Default: Fuzz
  • fuzz-minimize-time [optional]: Fuzz minimization duration, specified as a time.Duration (for example 1h30s). Corresponds to -fuzzminimizetime flag for the go test command. If you provide this input, ensure it is less than your job timeout.
    • Default: 10s
  • go-version [optional]: Which version of Go to use for fuzzing. This will be passed on to actions/setup-go@v3.
    • Default: 1.18

Returns:

  • SUCCESS: if your fuzz tests don't raise a failure within the fuzz-time input constraint.
  • FAILURE: if your fuzz tests raise a failure within the fuzz-time input constraint.
    • The workflow run logs will include instructions on how to download (using the GitHub CLI) the failing seed corpus to your local machine for remediation, regardless of run trigger.
    • If you run this Action in a PR workflow, it'll comment these instructions on your PR:

Usage

⚠️This Action is not tested on windows GitHub Actions runners! Use with windows runner OS at your own risk!

Create a .github/workflows/go-fuzz-test.yml in your repository containing:

name: Go fuzz test
on:
  push:
  pull_request:
jobs:
  fuzz-test:
    name: Fuzz test
    runs-on: ubuntu-latest
    steps:
      - uses: jidicula/[email protected]
        with:
          fuzz-time: 30s

Fuzz test all packages in repo

If you have multiple packages in your repo and you want to fuzz test them all, create a .github/workflows/go-fuzz-test.yml in your repository containing:

name: Go fuzz test
on:
  push:
  pull_request:
jobs:
  fuzz-test:
    name: Fuzz test
    runs-on: ubuntu-latest
    steps:
      - uses: jidicula/[email protected]
        with:
          packages: './...'
          fuzz-time: 30s

Longer minimize time

If you want the fuzz test to spend more time on minimizing the failing input to the smallest possible and most human readable value which will still produce an error, create a .github/workflows/go-fuzz-test.yml in your repository containing:

name: Go fuzz test
on:
  push:
  pull_request:
jobs:
  fuzz-test:
    name: Fuzz test
    runs-on: ubuntu-latest
    steps:
      - uses: jidicula/[email protected]
        with:
          packages: './...'
          fuzz-time: 30s
          fuzz-minimize-time: 1m

Fuzz tests with different regexp

If you have fuzz tests that don't begin with Fuzz (the default regexp), create a .github/workflows/go-fuzz-test.yml in your repository containing:

name: Go fuzz test
on:
  push:
  pull_request:
jobs:
  fuzz-test:
    name: Fuzz test
    runs-on: ubuntu-latest
    steps:
      - uses: jidicula/go-fuzz-action@main
        with:
          packages: './...'
          fuzz-time: 30s
          fuzz-minimize-time: 1m
          fuzz-regexp: OtherFuzzRegexp

Example repo

I haven't figured out how to test this adequately within this repo, so you can verify its behaviour here: https://github.com/jidicula/test-go-fuzz-action/pull/2

Who uses this?

These public repos use this Action.

Articles
to learn more about the golang concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about GoLang.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory