blob: 2578f6cc0abcbcc547665d51e24e9b31fd1774af [file] [log] [blame]
Charles Chane1e5e622022-02-16 15:17:05 -08001{{/*
2# Copyright 2020-present Open Networking Foundation
3# SPDX-License-Identifier: Apache-2.0
4*/}}
5
6{{- if .Values.podsecuritypolicy.enabled }}
7apiVersion: policy/v1beta1
8kind: PodSecurityPolicy
9metadata:
10 name: 1-upf
11spec:
12 {{ if or .Values.config.coreDump.enabled .Values.config.upf.privileged }}
13 privileged: true
14 allowPrivilegeEscalation: true
15 {{ else }}
16 privileged: false
17 allowPrivilegeEscalation: false
18 {{ end }}
19 allowedCapabilities:
20 - IPC_LOCK
21 - NET_ADMIN
22 volumes:
23 - 'configMap'
24 - 'emptyDir'
25 - 'secret'
26 {{- if .Values.config.coreDump.enabled }}
27 - 'hostPath'
28 allowedHostPaths:
29 - pathPrefix: "/"
30 - pathPrefix: "/tmp/coredump"
31 {{- end }}
32 seLinux:
33 rule: RunAsAny
34 supplementalGroups:
35 rule: 'MustRunAs'
36 ranges:
37 # Forbid adding the root group.
38 - min: 1
39 max: 65535
40 runAsUser:
41 rule: RunAsAny
42 fsGroup:
43 rule: 'MustRunAs'
44 ranges:
45 # Forbid adding the root group.
46 - min: 1
47 max: 65535
48{{- end }}