File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- #! /bin/sh
21# Copyright 2022 The Witness Contributors
32#
43# Licensed under the Apache License, Version 2.0 (the "License");
1312# See the License for the specific language governing permissions and
1413# limitations under the License.
1514
16-
15+ #! /bin/sh
1716set -e
1817
18+ DIR=" $( cd -- " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
19+ . " $DIR /../../test/common.sh"
20+
21+ if ! checkprograms make docker ; then
22+ exit 1
23+ fi
24+
25+
1926printf " Building witness...\n"
2027make -C ../../ clean build > /dev/null
2128cp ../../bin/witness ./witness
Original file line number Diff line number Diff line change 1- #! /bin/sh
21# Copyright 2022 The Witness Contributors
32#
43# Licensed under the Apache License, Version 2.0 (the "License");
1312# See the License for the specific language governing permissions and
1413# limitations under the License.
1514
15+ #! /bin/sh
1616set -e
1717
18+ DIR=" $( cd -- " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
19+ . " $DIR /../../test/common.sh"
20+
21+ if ! checkprograms awk sha256sum docker tr jq ; then
22+ exit 1
23+ fi
24+
1825printf " \nFinding artifacts with log4j 1.2.17...\n"
1926LOG4JHASH=
$( echo -n dependency:log4j/[email protected] | sha256sum | awk ' {print $1}' ) 2027entryuuid=$( docker run --rm -it --net host witness-log4shell-demo rekor-cli --rekor_server http://localhost:3000 search --sha " $LOG4JHASH " | \
Original file line number Diff line number Diff line change 1- #! /bin/sh
21# Copyright 2022 The Witness Contributors
32#
43# Licensed under the Apache License, Version 2.0 (the "License");
1312# See the License for the specific language governing permissions and
1413# limitations under the License.
1514
15+ #! /bin/sh
1616set -e
1717
18+ DIR=" $( cd -- " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
19+ . " $DIR /../../test/common.sh"
20+
21+ if ! checkprograms docker ; then
22+ exit 1
23+ fi
24+
25+
1826printf " \nVerifying policy on nonvulnerable package...\n"
1927docker run --rm -it --net host -v " $( pwd) :/src" -w /src/nonvuln witness-log4shell-demo witness verify -c ../witness.yaml --artifactfile target/my-app-1.0-SNAPSHOT.jar
2028
Original file line number Diff line number Diff line change 1- #! /bin/sh
21# Copyright 2021 The Witness Contributors
32#
43# Licensed under the Apache License, Version 2.0 (the "License");
1312# See the License for the specific language governing permissions and
1413# limitations under the License.
1514
15+ #! /bin/sh
1616set -e
1717
18+ DIR=" $( cd -- " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
19+ . " $DIR /../../test/common.sh"
20+
21+ if ! checkprograms make docker ; then
22+ exit 1
23+ fi
24+
1825printf " Building witness...\n"
1926make -C ../../ clean build > /dev/null
2027cp ../../bin/witness ./witness
Original file line number Diff line number Diff line change 1+ # Copyright 2022 The Witness Contributors
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # /bin/sh
16+ checkprograms () {
17+ local result=0
18+ for prog in " $@ "
19+ do
20+ if ! command -v $prog > /dev/null; then
21+ printf " $prog is required to run this script. please ensure if is installed and in your PATH\n"
22+ result=1
23+ fi
24+ done
25+
26+ return $result
27+ }
Original file line number Diff line number Diff line change 1515#! /bin/sh
1616set -e
1717
18+ DIR=" $( cd -- " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
19+ . " $DIR /common.sh"
20+
21+ if ! checkprograms make ko ; then
22+ exit 1
23+ fi
24+
1825make -C ../ build
1926rm -f out.tar
2027KO_DOCKER_REPO=null ../bin/witness run -c test.yaml -a oci --trace=false -- ko publish --push=false --tarball out.tar .
Original file line number Diff line number Diff line change 1- #! /bin/bash
21# Copyright 2021 The Witness Contributors
32#
43# Licensed under the Apache License, Version 2.0 (the "License");
1312# See the License for the specific language governing permissions and
1413# limitations under the License.
1514
15+ #! /bin/sh
1616set -e
1717
18+ DIR=" $( cd -- " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
19+ . " $DIR /common.sh"
20+
21+ if ! checkprograms make ; then
22+ exit 1
23+ fi
24+
25+
26+
1827make -C ../ build
1928rm -f ./test-attestation.demo ./testapp ./policy-signed.json
2029../bin/witness -c test.yaml run -- go build -o=testapp .
You can’t perform that action at this time.
0 commit comments