goss.yaml 1.1 KB

1234567891011121314151617181920212223242526272829
  1. # Copyright Broadcom, Inc. All Rights Reserved.
  2. # SPDX-License-Identifier: APACHE-2.0
  3. file:
  4. /host/proc:
  5. exists: true
  6. filetype: directory
  7. mode: "0555"
  8. owner: root
  9. /host/sys:
  10. exists: true
  11. filetype: directory
  12. mode: "0555"
  13. owner: root
  14. command:
  15. {{- $uid := .Vars.containerSecurityContext.runAsUser }}
  16. {{- $gid := .Vars.podSecurityContext.fsGroup }}
  17. check-user-info:
  18. # The UID and GID should always be either the one specified as vars (always a bigger number that the default)
  19. # or the one randomly defined by openshift (larger values). Otherwise, the chart is still using the default value.
  20. exec: if [ $(id -u) -lt {{ $uid }} ] || [ $(id -G | awk '{print $2}') -lt {{ $gid }} ]; then exit 1; fi
  21. exit-status: 0
  22. {{ if .Vars.automountServiceAccountToken }}
  23. check-sa:
  24. exec: cat /var/run/secrets/kubernetes.io/serviceaccount/token | cut -d '.' -f 2 | xargs -I '{}' echo '{}====' | fold -w 4 | sed '$ d' | tr -d '\n' | base64 -d
  25. exit-status: 0
  26. stdout:
  27. - /serviceaccount.*name.*{{.Env.BITNAMI_APP_NAME }}/
  28. {{ end }}