diff --git a/.vib/harbor-notary-server/goss/goss.yaml b/.vib/harbor-notary-server/goss/goss.yaml new file mode 100644 index 000000000000..f263938c7e7e --- /dev/null +++ b/.vib/harbor-notary-server/goss/goss.yaml @@ -0,0 +1,10 @@ +gossfile: + # Goss tests exclusive to the current container + ../../harbor-notary-server/goss/harbor-notary-server.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../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/harbor-notary-server/goss/harbor-notary-server.yaml b/.vib/harbor-notary-server/goss/harbor-notary-server.yaml new file mode 100644 index 000000000000..b81e2d1b11c4 --- /dev/null +++ b/.vib/harbor-notary-server/goss/harbor-notary-server.yaml @@ -0,0 +1,21 @@ +group: + harbor: + exists: true +user: + harbor: + exists: true +file: + /etc/notary: + exists: true + mode: "0775" + owner: harbor + filetype: directory +command: + # Ensure permissions for Internal TLS + check-permissions-system-certs: + exec: ls -l /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.trust.crt /etc/ssl/certs/ca-certificates.crt 2>/dev/null | grep ".*-rw-rw-r--" + exit-status: 0 + check-notary-server-binary: + exec: notary-server -h + exit-status: 2 + diff --git a/.vib/harbor-notary-server/goss/vars.yaml b/.vib/harbor-notary-server/goss/vars.yaml new file mode 100644 index 000000000000..e8998a418d2a --- /dev/null +++ b/.vib/harbor-notary-server/goss/vars.yaml @@ -0,0 +1,4 @@ +binaries: + - notary-server + - migrate +root_dir: /opt/bitnami diff --git a/.vib/harbor-notary-server/vib-publish.json b/.vib/harbor-notary-server/vib-publish.json index 8b6fe8eab4e6..546b629138ca 100644 --- a/.vib/harbor-notary-server/vib-publish.json +++ b/.vib/harbor-notary-server/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -33,6 +34,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "harbor-notary-server/goss/goss.yaml", + "vars_file": "harbor-notary-server/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-harbor-notary-server" + } + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/harbor-notary-server/vib-verify.json b/.vib/harbor-notary-server/vib-verify.json index a34e8aee9161..f617c78c6b30 100644 --- a/.vib/harbor-notary-server/vib-verify.json +++ b/.vib/harbor-notary-server/vib-verify.json @@ -3,7 +3,8 @@ "resources": { "url": "{SHA_ARCHIVE}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -29,6 +30,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "harbor-notary-server/goss/goss.yaml", + "vars_file": "harbor-notary-server/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-harbor-notary-server" + } + } + } + }, { "action_id": "trivy", "params": {