Skip to content

Commit 6c06f4e

Browse files
author
Paulo Gomes
committed
The libgit2 libraries are downloaded and verified before
some of the make targets are executed. This assures the provenance of such files before using them and is very important specially for end users running such tests on their machines. Note that has been disabled specially due to recent issues we experienced at CI which can be seen in: #899 Signed-off-by: Paulo Gomes <[email protected]>
1 parent 1ab7626 commit 6c06f4e

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

.github/workflows/cifuzz.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ jobs:
3333
${{ runner.os }}-go
3434
- name: Smoke test Fuzzers
3535
run: make fuzz-smoketest
36+
env:
37+
SKIP_COSIGN_VERIFICATION: true

.github/workflows/e2e.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
uses: fluxcd/pkg/actions/helm@main
4848
- name: Run E2E tests
4949
env:
50+
SKIP_COSIGN_VERIFICATION: true
5051
CREATE_CLUSTER: false
5152
run: make e2e
5253

@@ -76,6 +77,7 @@ jobs:
7677
kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }}
7778
- name: Run e2e tests
7879
env:
80+
SKIP_COSIGN_VERIFICATION: true
7981
KIND_CLUSTER_NAME: ${{ steps.prep.outputs.CLUSTER }}
8082
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
8183
CREATE_CLUSTER: false

.github/workflows/tests.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
${{ runner.os }}-go-
3535
- name: Run tests
3636
env:
37+
SKIP_COSIGN_VERIFICATION: true
3738
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
3839
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
3940
run: make test
@@ -51,6 +52,8 @@ jobs:
5152
go-version: 1.19.x
5253
- name: Run tests
5354
env:
55+
SKIP_COSIGN_VERIFICATION: true
56+
5457
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
5558
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
5659

@@ -87,3 +90,5 @@ jobs:
8790
${{ runner.os }}-go-
8891
- name: Run tests
8992
run: make test
93+
env:
94+
SKIP_COSIGN_VERIFICATION: true

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ GO_TEST_ARGS ?= -race
1212
# Allows for filtering tests based on the specified prefix
1313
GO_TEST_PREFIX ?=
1414

15+
# Defines whether cosign verification should be skipped.
16+
SKIP_COSIGN_VERIFICATION ?= false
17+
1518
# Allows for defining additional Docker buildx arguments,
1619
# e.g. '--push'.
1720
BUILD_ARGS ?=

hack/install-libraries.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ IMG="${IMG:-}"
66
TAG="${TAG:-}"
77
IMG_TAG="${IMG}:${TAG}"
88
DOWNLOAD_URL="https://github.com/fluxcd/golang-with-libgit2/releases/download/${TAG}"
9+
SKIP_COSIGN_VERIFICATION="${SKIP_COSIGN_VERIFICATION:-false}"
910

1011
TMP_DIR=$(mktemp -d)
1112

@@ -48,9 +49,13 @@ cosign_verify(){
4849
assure_provenance() {
4950
[[ $# -eq 1 ]] || fatal 'assure_provenance needs exactly 1 arguments'
5051

51-
cosign_verify "${TMP_DIR}/checksums.txt.pem" \
52-
"${TMP_DIR}/checksums.txt.sig" \
53-
"${TMP_DIR}/checksums.txt"
52+
if "${SKIP_COSIGN_VERIFICATION}"; then
53+
echo 'Skipping cosign verification...'
54+
else
55+
cosign_verify "${TMP_DIR}/checksums.txt.pem" \
56+
"${TMP_DIR}/checksums.txt.sig" \
57+
"${TMP_DIR}/checksums.txt"
58+
fi
5459

5560
pushd "${TMP_DIR}" || exit
5661
if command -v sha256sum; then

0 commit comments

Comments
 (0)