From 547b1bb8b109177494136a308c0b043b3c429951 Mon Sep 17 00:00:00 2001 From: "Felipe V.C. Serafim" <43246350+fevisera@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:52:54 +0200 Subject: [PATCH] [bitnami/notation] Add tests for notation (#51887) * [bitnami/notation] Add tests for notation Signed-off-by: sfelipe * Update Signed-off-by: sfelipe --------- Signed-off-by: sfelipe --- .vib/notation/goss/goss.yaml | 14 ++++++ .vib/notation/goss/notation.yaml | 7 +++ .vib/notation/goss/vars.yaml | 6 +++ .vib/notation/vib-verify.json | 73 ++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 .vib/notation/goss/goss.yaml create mode 100644 .vib/notation/goss/notation.yaml create mode 100644 .vib/notation/goss/vars.yaml create mode 100644 .vib/notation/vib-verify.json diff --git a/.vib/notation/goss/goss.yaml b/.vib/notation/goss/goss.yaml new file mode 100644 index 000000000000..4a19bedd9e04 --- /dev/null +++ b/.vib/notation/goss/goss.yaml @@ -0,0 +1,14 @@ +# Copyright VMware, Inc. +# SPDX-License-Identifier: APACHE-2.0 + +gossfile: + # Goss tests exclusive to the current container + ../../notation/goss/notation.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-app-version.yaml: {} + ../../common/goss/templates/check-binaries.yaml: {} + ../../common/goss/templates/check-broken-symlinks.yaml: {} + ../../common/goss/templates/check-ca-certs.yaml: {} + ../../common/goss/templates/check-linked-libraries.yaml: {} + ../../common/goss/templates/check-sed-in-place.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/notation/goss/notation.yaml b/.vib/notation/goss/notation.yaml new file mode 100644 index 000000000000..90fe565b2b29 --- /dev/null +++ b/.vib/notation/goss/notation.yaml @@ -0,0 +1,7 @@ +# Copyright VMware, Inc. +# SPDX-License-Identifier: APACHE-2.0 + +command: + generate-test-key: + exec: notation cert generate-test --default "domain.com" + exit-status: 0 diff --git a/.vib/notation/goss/vars.yaml b/.vib/notation/goss/vars.yaml new file mode 100644 index 000000000000..8f6e450275d6 --- /dev/null +++ b/.vib/notation/goss/vars.yaml @@ -0,0 +1,6 @@ +binaries: + - notation +root_dir: /opt/bitnami +version: + bin_name: notation + flag: version diff --git a/.vib/notation/vib-verify.json b/.vib/notation/vib-verify.json new file mode 100644 index 000000000000..d8044bad523d --- /dev/null +++ b/.vib/notation/vib-verify.json @@ -0,0 +1,73 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64", + "linux/arm64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "notation/goss/goss.yaml", + "vars_file": "notation/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-notation" + } + } + } + }, + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + } + } +}