diff --git a/.vib/mysql/goss/goss.yaml b/.vib/mysql/goss/goss.yaml new file mode 100644 index 0000000000..8a6ef867f7 --- /dev/null +++ b/.vib/mysql/goss/goss.yaml @@ -0,0 +1,34 @@ +command: + mysql-env: + exec: env + exit-status: 0 + stdout: + - "MYSQL_DATABASE=important_db" + stderr: [ ] + timeout: 40000 + mysql-create: + exec: mysql -h localhost -u root -p"$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" -e 'DROP TABLE IF EXISTS TEST; create table TEST( test_id int auto_increment, test_value int, primary key(test_id)); INSERT INTO TEST (TEST_VALUE) VALUES (1993);SELECT * FROM TEST' + exit-status: 0 + stdout: + - "test_id" + - "test_value" + - "1993" + stderr: [ ] + timeout: 40000 + user-id-test: + exec: if [ "$(id -u)" -eq 0 ]; then exit 1; fi + exit-status: 0 + stdout: [] + stderr: [] +file: + {{ printf "/bitnami/mysql/data/%s" .Env.MYSQL_DATABASE }}: + mode: "2750" + filetype: directory + exists: true + /opt/bitnami/mysql/conf/my.cnf: + mode: "0644" + filetype: file + contains: + - "datadir=/bitnami/mysql/data" + - "socket=/opt/bitnami/mysql/tmp/mysql.sock" + exists: true diff --git a/.vib/mysql/vib-publish.json b/.vib/mysql/vib-publish.json index 265c062b86..064a4ad4a9 100644 --- a/.vib/mysql/vib-publish.json +++ b/.vib/mysql/vib-publish.json @@ -17,14 +17,42 @@ ] }, "verify": { + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "/bitnami/mysql" + }, + "runtime_parameters": "YXV0aDogCiAgcm9vdFBhc3N3b3JkOiBDb21wbGljYXRlZFBhc3N3b3JkMTIzNAogIGRhdGFiYXNlOiBpbXBvcnRhbnRfZGIKcHJpbWFyeToKICBzZXJ2aWNlOgogICAgdHlwZTogTG9hZEJhbGFuY2VyCiAgICBwb3J0czogCiAgICAgIG15c3FsOiA4MAo=", + "target_platform": { + "target_platform_id": "{VIB_ENV_TARGET_PLATFORM}", + "size": { + "name": "S4" + } + } + }, "actions": [ { "action_id": "trivy", "params": { "threshold": "CRITICAL", - "vuln_type": [ - "OS" - ] + "vuln_type": ["OS"] + } + }, + { + "action_id": "health-check", + "params": { + "endpoint": "lb-mysql-mysql" + } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib/mysql/goss" + }, + "remote": { + "workload": "sts-mysql" + } } } ] diff --git a/.vib/mysql/vib-verify.json b/.vib/mysql/vib-verify.json index 7cfeff611d..b4bd7445a0 100644 --- a/.vib/mysql/vib-verify.json +++ b/.vib/mysql/vib-verify.json @@ -17,6 +17,19 @@ ] }, "verify": { + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "/bitnami/mysql" + }, + "runtime_parameters": "YXV0aDogCiAgcm9vdFBhc3N3b3JkOiBDb21wbGljYXRlZFBhc3N3b3JkMTIzNAogIGRhdGFiYXNlOiBpbXBvcnRhbnRfZGIKcHJpbWFyeToKICBzZXJ2aWNlOgogICAgdHlwZTogTG9hZEJhbGFuY2VyCiAgICBwb3J0czogCiAgICAgIG15c3FsOiA4MAo=", + "target_platform": { + "target_platform_id": "{VIB_ENV_TARGET_PLATFORM}", + "size": { + "name": "S4" + } + } + }, "actions": [ { "action_id": "trivy", @@ -24,6 +37,23 @@ "threshold": "CRITICAL", "vuln_type": ["OS"] } + }, + { + "action_id": "health-check", + "params": { + "endpoint": "lb-mysql-mysql" + } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib/mysql/goss" + }, + "remote": { + "workload": "sts-mysql" + } + } } ] }