Skip to content

Commit

Permalink
add clusterfuzzlite PR fuzzing. (#2784)
Browse files Browse the repository at this point in the history
Signed-off-by: Sepehrdad Sh <26747519+sepehrdaddev@users.noreply.github.com>
  • Loading branch information
sepehrdaddev authored Dec 8, 2023
1 parent 75bc9df commit 39eb3ef
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .clusterfuzzlite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM gcr.io/oss-fuzz-base/base-builder-go

COPY . $SRC/skipper
COPY ./.clusterfuzzlite/build.sh $SRC/

WORKDIR $SRC/skipper
24 changes: 24 additions & 0 deletions .clusterfuzzlite/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -eu
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

for target in $(find $SRC/skipper/fuzz/fuzz_targets -name 'Fuzz*.go'); do
target_basename=$(basename -s .go $target)

compile_go_fuzzer github.com/zalando/skipper/fuzz/fuzz_targets $target_basename $target_basename gofuzz
done

mv $SRC/skipper/fuzz/dictionaries/*.dict $OUT/
5 changes: 5 additions & 0 deletions .clusterfuzzlite/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: go
fuzzing_engines:
- libfuzzer
sanitizers:
- address
34 changes: 34 additions & 0 deletions .github/workflows/cflite_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: ClusterFuzzLite PR fuzzing
on:
pull_request:
paths:
- '**'
permissions: read-all
jobs:
PR:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
sanitizer:
- address
steps:
- name: Build Fuzzers (${{ matrix.sanitizer }})
id: build
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
with:
language: go
github-token: ${{ secrets.GITHUB_TOKEN }}
sanitizer: ${{ matrix.sanitizer }}
- name: Run Fuzzers (${{ matrix.sanitizer }})
id: run
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fuzz-seconds: 300
mode: 'code-change'
sanitizer: ${{ matrix.sanitizer }}
output-sarif: true

0 comments on commit 39eb3ef

Please sign in to comment.