Skip to content

Commit

Permalink
Fuzzing: Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: AdamKorcz <adam@adalogics.com>
  • Loading branch information
AdamKorcz committed Sep 30, 2021
1 parent c4377ce commit 6e1d541
Show file tree
Hide file tree
Showing 2 changed files with 471 additions and 0 deletions.
24 changes: 24 additions & 0 deletions fuzzing/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.16-buster as builder

RUN apt-get update && apt-get install -y git vim clang
RUN git clone https://github.com/fluxcd/notification-controller /notification-controller

WORKDIR /notification-controller
RUN mkdir /notification-controller/fuzz
COPY fuzz.go /notification-controller/controllers/
RUN go mod tidy

RUN cd / \
&& go get -u github.com/dvyukov/go-fuzz/go-fuzz@latest github.com/dvyukov/go-fuzz/go-fuzz-build@latest
RUN go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
RUN go get github.com/AdaLogics/go-fuzz-headers
RUN go mod download golang.org/x/sync
RUN go mod download github.com/dvyukov/go-fuzz

RUN mkdir /fuzzers
RUN cd /notification-controller/controllers \
&& go-fuzz-build -libfuzzer -func=Fuzz \
&& clang -o /fuzzers/Fuzz reflect-fuzz.a \
-fsanitize=fuzzer

RUN cd /notification-controller/controllers && /fuzzers/Fuzz
Loading

0 comments on commit 6e1d541

Please sign in to comment.