From 38f3b3928fce3e7d11bbbc93606128633cfbd114 Mon Sep 17 00:00:00 2001 From: Martin Petkov Date: Thu, 18 Nov 2021 11:31:18 -0500 Subject: [PATCH] Forseti Config Validator: initial integration (#6695) * Add project config-validator * Build in the policy library files * Fix corpus zip file name * Switch to the official repo, no my fork * Add morgante@ as a cc * Use Morgante's work email --- projects/config-validator/Dockerfile | 25 +++++++++++++++++++++++ projects/config-validator/build.sh | 28 ++++++++++++++++++++++++++ projects/config-validator/project.yaml | 10 +++++++++ 3 files changed, 63 insertions(+) create mode 100644 projects/config-validator/Dockerfile create mode 100755 projects/config-validator/build.sh create mode 100644 projects/config-validator/project.yaml diff --git a/projects/config-validator/Dockerfile b/projects/config-validator/Dockerfile new file mode 100644 index 000000000..e17d15b15 --- /dev/null +++ b/projects/config-validator/Dockerfile @@ -0,0 +1,25 @@ +# 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 + +# Clone the actual repo with the fuzz target. +RUN git clone --depth 1 https://github.com/GoogleCloudPlatform/config-validator $GOPATH/src/github.com/GoogleCloudPlatform/config-validator + +COPY build.sh $SRC/ + +# Required to avoid 'working directory is not part of a module' error. +WORKDIR $GOPATH/src/github.com/GoogleCloudPlatform/config-validator diff --git a/projects/config-validator/build.sh b/projects/config-validator/build.sh new file mode 100755 index 000000000..869c21bf8 --- /dev/null +++ b/projects/config-validator/build.sh @@ -0,0 +1,28 @@ +#!/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. +# +################################################################################ + +# Copy the library files needed to initialize the validator. +mkdir -p $OUT/validatorfiles +cp -a 'test/cf/constraints' $OUT/validatorfiles +cp -a 'test/cf/library' $OUT/validatorfiles +cp -a 'test/cf/templates' $OUT/validatorfiles + +# Copy the corpus. +zip -jr $OUT/fuzz_config_validator_seed_corpus.zip internal/fuzz/corpus + +# Compile the fuzzer. +compile_go_fuzzer github.com/GoogleCloudPlatform/config-validator/internal/fuzz Fuzz fuzz_config_validator diff --git a/projects/config-validator/project.yaml b/projects/config-validator/project.yaml new file mode 100644 index 000000000..84c524af1 --- /dev/null +++ b/projects/config-validator/project.yaml @@ -0,0 +1,10 @@ +homepage: "https://github.com/GoogleCloudPlatform/config-validator/" +main_repo: "https://github.com/GoogleCloudPlatform/config-validator/" +primary_contact: "martin.p.petkov@gmail.com" +auto_ccs: +- morgantep@google.com +language: go +fuzzing_engines: +- libfuzzer +sanitizers: +- address