-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathsecurity_context.yaml
More file actions
93 lines (89 loc) · 1.68 KB
/
security_context.yaml
File metadata and controls
93 lines (89 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#
# Copyright (c) 2024, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
---
# Create a Security Context Contraint
kind: SecurityContextConstraints
apiVersion: security.openshift.io/v1
metadata:
name: lrest-scc
allowPrivilegedContainer: false
allowedCapabilities:
- SYS_NICE
runAsUser:
type: MustRunAs
uid: 54321
seLinuxContext:
type: RunAsAny
fsGroup:
type: MustRunAs
ranges:
- min: 54321
max: 54321
supplementalGroups:
type: MustRunAs
ranges:
- min: 54321
max: 54321
---
# Create a Security Context Contraint
kind: SecurityContextConstraints
apiVersion: security.openshift.io/v1
metadata:
name: lrest-root-user-scc
allowPrivilegedContainer: false
allowedCapabilities:
- SYS_NICE
runAsUser:
type: MustRunAsRange
uidRangeMin: 0
uidRangeMax: 54321
seLinuxContext:
type: RunAsAny
fsGroup:
type: MustRunAs
ranges:
- min: 0
max: 54325
supplementalGroups:
type: MustRunAs
ranges:
- min: 0
max: 54321
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: lrest-sa
namespace: cdbnamespace
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-lrest-scc
namespace: cdbnamespace
rules:
- apiGroups:
- security.openshift.io
verbs:
- use
resources:
- securitycontextconstraints
resourceNames:
- lrest-scc
- lrest-root-user-scc
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-lrest-scc
namespace: cdbnamespace
subjects:
- kind: ServiceAccount
name: lrest-sa
namespace: cdbnamespace
roleRef:
kind: Role
name: use-lrest-scc
apiGroup: rbac.authorization.k8s.io