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 <pierwill@users.noreply.github.com>
This commit is contained in:
pierwill 2020-07-13 21:14:49 -07:00 committed by GitHub
parent 55a4e1d88a
commit 44686eaa58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 1 deletions

View File

@ -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/

View File

@ -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

View File

@ -3,4 +3,8 @@ language: go
primary_contact: "william@influxdata.com"
auto_ccs:
- "palbert@influxdata.com"
- "ryan@influxdata.com"
- "ryan@influxdata.com"
fuzzing_engines:
- libfuzzer
sanitizers:
- address