diff --git a/.vib/cypress/goss/cypress.yaml b/.vib/cypress/goss/cypress.yaml new file mode 100644 index 000000000000..2c69dff18e97 --- /dev/null +++ b/.vib/cypress/goss/cypress.yaml @@ -0,0 +1,19 @@ +# Copyright VMware, Inc. +# SPDX-License-Identifier: APACHE-2.0 + +user: + cypress: + exists: true + uid: 1001 + gid: 0 +command: + verify-cypress: + exec: cypress verify + exit-status: 0 + stdout: + - "Verified Cypress" + info-cypress-check-chromium: + exec: cypress info + exit-status: 0 + stdout: + - "Chromium" diff --git a/.vib/cypress/goss/goss.yaml b/.vib/cypress/goss/goss.yaml new file mode 100644 index 000000000000..4b4f54b96bdd --- /dev/null +++ b/.vib/cypress/goss/goss.yaml @@ -0,0 +1,14 @@ +# Copyright VMware, Inc. +# SPDX-License-Identifier: APACHE-2.0 + +gossfile: + # Goss tests exclusive to the current container + ../../cypress/goss/cypress.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-directories.yaml: {} + ../../common/goss/templates/check-linked-libraries.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/cypress/goss/vars.yaml b/.vib/cypress/goss/vars.yaml new file mode 100644 index 000000000000..2b350fec36d8 --- /dev/null +++ b/.vib/cypress/goss/vars.yaml @@ -0,0 +1,11 @@ +binaries: + - node + - cypress +root_dir: /opt/bitnami +directories: + - paths: + - /opt/bitnami/node + - /opt/bitnami/node/lib/node_modules/cypress +version: + bin_name: cypress + flag: --version diff --git a/.vib/cypress/vib-verify.json b/.vib/cypress/vib-verify.json new file mode 100644 index 000000000000..b5e864eafe03 --- /dev/null +++ b/.vib/cypress/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": "cypress/goss/goss.yaml", + "vars_file": "cypress/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-cypress" + } + } + } + }, + { + "action_id": "trivy", + "params": { + "threshold": "LOW", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + } + } +}