Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions projects/fluxcd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2021 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.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder-go
RUN apt-get update && apt-get install -y wget zlib1g-dev pkg-config
RUN git clone --depth 1 --branch fuzz1 https://github.com/AdamKorcz/kustomize-controller
RUN git clone --depth 1 --branch fuzz1 https://github.com/AdamKorcz/pkg
RUN git clone --depth 1 --branch fuzz1 https://github.com/AdamKorcz/notification-controller

# Go 1.16 is needed to build the notification-controller
RUN cd /tmp \
&& wget https://golang.org/dl/go1.16.8.linux-amd64.tar.gz \
&& tar -xf go1.16.8.linux-amd64.tar.gz

COPY build.sh $SRC/
WORKDIR $SRC
58 changes: 58 additions & 0 deletions projects/fluxcd/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash -eu
# Copyright 2021 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.
#
################################################################################

# Notification-controller

# The notification-controller needs to be built with go 1.16
export OLD_PATH=$PATH
export PATH=/tmp/go/bin:$PATH
# We are now using go 1.16
cd $SRC/notification-controller/controllers
cp ../fuzzing/fuzz.go ./
rm *_test.go
compile_go_fuzzer . Fuzz notification_fuzzer
export PATH=$OLD_PATH

# Kustomize-controller:
cd $SRC/kustomize-controller
sed 's/filippo.io\/age v1.0.0-beta7/filippo.io\/age v1.0.0/g' -i go.mod
mv fuzz/fuzz.go ./controllers/
cd controllers
rm ./*_test.go
compile_go_fuzzer . Fuzz kustomize_fuzzer

# Pkg:
cd $SRC/pkg
mv ./fuzz/tls_fuzzer.go runtime/tls/
mv ./fuzz/conditions_fuzzer.go ./runtime/conditions/
go mod init pkg
cd fuzz
compile_go_fuzzer . FuzzUntar fuzz_untar
compile_go_fuzzer . FuzzLibGit2Error fuzz_libgit_2_error
compile_go_fuzzer . FuzzEventInfof fuzz_event_infof
cd -

cd ./runtime/tls
compile_go_fuzzer . FuzzTlsConfig fuzz_tls_config
cd -

cd ./runtime/conditions
compile_go_fuzzer . FuzzGetterConditions fuzz_getter_conditions
compile_go_fuzzer . FuzzConditionsMatch fuzz_conditions_match
compile_go_fuzzer . FuzzPatchApply fuzz_patch_apply
compile_go_fuzzer . FuzzConditionsUnstructured fuzz_conditions_unstructured
cd $SRC
13 changes: 13 additions & 0 deletions projects/fluxcd/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
homepage: "https://fluxcd.io/"
main_repo: "https://github.com/fluxcd/flux2"
primary_contact: "michael@weave.works"
auto_ccs :
- "stefan@weave.works"
- "hidde@weave.works"
- "david@adalogics.com"
- "adam@adalogics.com"
language: go
fuzzing_engines:
- libfuzzer
sanitizers:
- address