From 44686eaa5878b61b505ddb41266544ba23796946 Mon Sep 17 00:00:00 2001 From: pierwill <19642016+pierwill@users.noreply.github.com> Date: Mon, 13 Jul 2020 21:14:49 -0700 Subject: [PATCH] Add initial influxdb integration (#4038) - Updates project.yaml to specify libfuzzer as fuzzing engine - Adds a basic Dockerfile - Add a build.sh script for initial target Co-authored-by: pierwill --- projects/influxdb/Dockerfile | 23 +++++++++++++++++++++++ projects/influxdb/build.sh | 31 +++++++++++++++++++++++++++++++ projects/influxdb/project.yaml | 6 +++++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 projects/influxdb/Dockerfile create mode 100644 projects/influxdb/build.sh diff --git a/projects/influxdb/Dockerfile b/projects/influxdb/Dockerfile new file mode 100644 index 000000000..e00af1465 --- /dev/null +++ b/projects/influxdb/Dockerfile @@ -0,0 +1,23 @@ +# Copyright 2020 Google Inc. +# +# 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 +MAINTAINER william@influxdata.com +RUN go get github.com/influxdata/influxdb +RUN go get github.com/dgrijalva/jwt-go + +COPY build.sh $SRC/ +WORKDIR $SRC/ diff --git a/projects/influxdb/build.sh b/projects/influxdb/build.sh new file mode 100644 index 000000000..a8f982d08 --- /dev/null +++ b/projects/influxdb/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash -eu +# Copyright 2020 Google Inc. +# +# 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. +# +################################################################################ + +function compile_fuzzer { + path=$1 + function=$2 + fuzzer=$3 + + # Instrument all Go files relevant to this fuzzer + go-fuzz -func $function -o $fuzzer.a $path + + # Instrumented, compiled Go ($fuzzer.a) + fuzzing engine = fuzzer binary + $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer +} + +# TODO commit fuzz test in project repo +compile_fuzzer github.com/influxdata/influxdb/jsonweb FuzzJsonWeb fuzzjsonweb diff --git a/projects/influxdb/project.yaml b/projects/influxdb/project.yaml index 80f1040b2..56066ed38 100644 --- a/projects/influxdb/project.yaml +++ b/projects/influxdb/project.yaml @@ -3,4 +3,8 @@ language: go primary_contact: "william@influxdata.com" auto_ccs: - "palbert@influxdata.com" - - "ryan@influxdata.com" \ No newline at end of file + - "ryan@influxdata.com" +fuzzing_engines: + - libfuzzer +sanitizers: + - address \ No newline at end of file