From a328c8873548d2fb2e88fb8ac2b03d9669d112fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20J=2E=20Salmer=C3=B3n-Garc=C3=ADa?= Date: Tue, 23 Jul 2024 15:21:56 +0200 Subject: [PATCH] [bitnami/volsync] ci: :construction_worker: Add VIB integration (#69505) Signed-off-by: Javier Salmeron Garcia --- .vib/volsync/goss/goss.yaml | 13 +++++++ .vib/volsync/goss/vars.yaml | 23 ++++++++++++ .vib/volsync/vib-verify.json | 73 ++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 .vib/volsync/goss/goss.yaml create mode 100644 .vib/volsync/goss/vars.yaml create mode 100644 .vib/volsync/vib-verify.json diff --git a/.vib/volsync/goss/goss.yaml b/.vib/volsync/goss/goss.yaml new file mode 100644 index 000000000000..9f52ef8baa6a --- /dev/null +++ b/.vib/volsync/goss/goss.yaml @@ -0,0 +1,13 @@ +# Copyright Broadcom, Inc. All Rights Reserved. +# SPDX-License-Identifier: APACHE-2.0 + +gossfile: + # 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-directories.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/volsync/goss/vars.yaml b/.vib/volsync/goss/vars.yaml new file mode 100644 index 000000000000..0d246a7cb7f1 --- /dev/null +++ b/.vib/volsync/goss/vars.yaml @@ -0,0 +1,23 @@ +binaries: + - manager + - restic + - rclone + - syncthing + - diskrsync + - diskrsync-tcp +sed_in_place: + exclude_paths: + # Ignore scripts provided by upstream volsync + - /opt/bitnami/volsync/mover-.*/.* +directories: + - mode: "0755" + paths: + - /opt/bitnami/volsync/mover-rclone + - /opt/bitnami/volsync/mover-restic + - /opt/bitnami/volsync/mover-rsync + - /opt/bitnami/volsync/mover-rsync-tls + - /opt/bitnami/volsync/mover-syncthing +root_dir: /opt/bitnami +version: + bin_name: restic + flag: version diff --git a/.vib/volsync/vib-verify.json b/.vib/volsync/vib-verify.json new file mode 100644 index 000000000000..ffc94d7e4923 --- /dev/null +++ b/.vib/volsync/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": "volsync/goss/goss.yaml", + "vars_file": "volsync/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-volsync" + } + } + } + }, + { + "action_id": "trivy", + "params": { + "threshold": "LOW", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + } + } +}