d3d3712c4cc7667f2644e61569fd56fb75d8b469
[ta/caas-security.git] / rbac_manifests / caas-default-psp.yaml
1 ---
2 # Copyright 2019 Nokia
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 apiVersion: extensions/v1beta1
17 kind: PodSecurityPolicy
18 metadata:
19   name: caas-default
20 spec:
21   privileged: false
22   allowPrivilegeEscalation: true
23   readOnlyRootFilesystem: false
24   hostIPC: false
25   hostNetwork: false
26   hostPID: false
27   volumes:
28     - 'configMap'
29     - 'downwardAPI'
30     - 'emptyDir'
31     - 'persistentVolumeClaim'
32     - 'projected'
33     - 'secret'
34     - 'hostPath'
35   seLinux:
36     rule: RunAsAny
37   supplementalGroups:
38     rule: RunAsAny
39   runAsUser:
40     rule: RunAsAny
41   fsGroup:
42     rule: RunAsAny
43 ---
44 apiVersion: rbac.authorization.k8s.io/v1
45 kind: ClusterRole
46 metadata:
47   name: caas:default-psp
48 rules:
49 - apiGroups:     ['extensions']
50   resources:     ['podsecuritypolicies']
51   verbs:         ['use']
52   resourceNames: ['caas-default']
53 ---
54 apiVersion: rbac.authorization.k8s.io/v1
55 kind: ClusterRoleBinding
56 metadata:
57   name: caas:default-psp
58 roleRef:
59   kind: ClusterRole
60   name: caas:default-psp
61   apiGroup: rbac.authorization.k8s.io
62 subjects:
63 # Authorize system:nodes group to be able to create mirror pods
64 - kind: Group
65   apiGroup: rbac.authorization.k8s.io
66   name: system:nodes
67 - kind: Group
68   apiGroup: rbac.authorization.k8s.io
69   name: system:serviceaccounts