podsecuritypolicy.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {{- if .Values.rbac.pspEnabled }}
  2. {{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
  3. apiVersion: policy/v1beta1
  4. kind: PodSecurityPolicy
  5. metadata:
  6. name: {{ template "grafana.fullname" . }}
  7. labels:
  8. {{- include "grafana.labels" . | nindent 4 }}
  9. annotations:
  10. seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default'
  11. seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
  12. {{- if .Values.rbac.pspUseAppArmor }}
  13. apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
  14. apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
  15. {{- end }}
  16. spec:
  17. privileged: false
  18. allowPrivilegeEscalation: false
  19. requiredDropCapabilities:
  20. # Default set from Docker, with DAC_OVERRIDE and CHOWN
  21. - ALL
  22. volumes:
  23. - 'configMap'
  24. - 'emptyDir'
  25. - 'projected'
  26. - 'csi'
  27. - 'secret'
  28. - 'downwardAPI'
  29. - 'persistentVolumeClaim'
  30. hostNetwork: false
  31. hostIPC: false
  32. hostPID: false
  33. runAsUser:
  34. rule: 'RunAsAny'
  35. seLinux:
  36. rule: 'RunAsAny'
  37. supplementalGroups:
  38. rule: 'MustRunAs'
  39. ranges:
  40. # Forbid adding the root group.
  41. - min: 1
  42. max: 65535
  43. fsGroup:
  44. rule: 'MustRunAs'
  45. ranges:
  46. # Forbid adding the root group.
  47. - min: 1
  48. max: 65535
  49. readOnlyRootFilesystem: false
  50. {{- end }}
  51. {{- end }}