Capability update
[ta/caas-security.git] / rbac_manifests / caas-infra-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-infra
20 spec:
21   privileged: true
22   readOnlyRootFilesystem: false
23   hostNetwork: true
24   hostPorts:
25   - min: 0
26     max: 65535
27   volumes:
28     - 'emptyDir'
29     - 'hostPath'
30     - 'persistentVolumeClaim'
31     - 'configMap'
32     - 'secret'
33     - 'rbd'
34   seLinux:
35     rule: RunAsAny
36   supplementalGroups:
37     rule: RunAsAny
38   runAsUser:
39     rule: RunAsAny
40   fsGroup:
41     rule: RunAsAny
42   allowedCapabilities:
43     - NET_BIND_SERVICE
44     - SETGID
45     - SETUID
46     - ALL
47     - IPC_LOCK
48     - SYS_RESOURCE
49     - SYS_PTRACE
50     - SYS_ADMIN
51     - NET_ADMIN
52     - NET_RAW
53 ---
54 apiVersion: rbac.authorization.k8s.io/v1
55 kind: ClusterRole
56 metadata:
57   name: caas:infra-psp
58 rules:
59 - apiGroups:     ['extensions']
60   resources:     ['podsecuritypolicies']
61   verbs:         ['use']
62   resourceNames: ['caas-infra']
63 ---
64 apiVersion: rbac.authorization.k8s.io/v1
65 kind: ClusterRoleBinding
66 metadata:
67   name: caas:infra-psp
68 roleRef:
69   kind: ClusterRole
70   name: caas:infra-psp
71   apiGroup: rbac.authorization.k8s.io
72 subjects:
73 # Authorize system:nodes group to be able to create mirror pods
74 - kind: Group
75   apiGroup: rbac.authorization.k8s.io
76   name: system:nodes
77 - kind: ServiceAccount
78   name: default
79   namespace: kube-system