Skip to content

Commit ec696d9

Browse files
Merge pull request #299 from timflannagan/pod-security-context-4.11
manifests/*: comply to restricted pod security level
2 parents 5d74cef + 801683a commit ec696d9

12 files changed

+127
-0
lines changed

manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,19 @@ spec:
2121
labels:
2222
app: package-server-manager
2323
spec:
24+
securityContext:
25+
runAsNonRoot: true
26+
runAsUser: 65534
27+
seccompProfile:
28+
type: RuntimeDefault
2429
serviceAccountName: olm-operator-serviceaccount
2530
priorityClassName: "system-cluster-critical"
2631
containers:
2732
- name: package-server-manager
33+
securityContext:
34+
allowPrivilegeEscalation: false
35+
capabilities:
36+
drop: ["ALL"]
2837
command:
2938
- /bin/psm
3039
- start

manifests/0000_50_olm_06-psm-operator.deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,19 @@ spec:
2121
labels:
2222
app: package-server-manager
2323
spec:
24+
securityContext:
25+
runAsNonRoot: true
26+
runAsUser: 65534
27+
seccompProfile:
28+
type: RuntimeDefault
2429
serviceAccountName: olm-operator-serviceaccount
2530
priorityClassName: "system-cluster-critical"
2631
containers:
2732
- name: package-server-manager
33+
securityContext:
34+
allowPrivilegeEscalation: false
35+
capabilities:
36+
drop: ["ALL"]
2837
command:
2938
- /bin/psm
3039
- start

manifests/0000_50_olm_07-collect-profiles.cronjob.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ spec:
1313
spec:
1414
template:
1515
spec:
16+
securityContext:
17+
runAsNonRoot: true
18+
seccompProfile:
19+
type: RuntimeDefault
1620
serviceAccountName: collect-profiles
1721
priorityClassName: openshift-user-critical
1822
containers:
1923
- name: collect-profiles
24+
securityContext:
25+
allowPrivilegeEscalation: false
26+
capabilities:
27+
drop: ["ALL"]
2028
image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607
2129
imagePullPolicy: IfNotPresent
2230
command:

manifests/0000_50_olm_07-olm-operator.deployment.ibm-cloud-managed.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ spec:
8282
requests:
8383
cpu: 10m
8484
memory: 160Mi
85+
securityContext:
86+
allowPrivilegeEscalation: false
87+
capabilities:
88+
drop: ["ALL"]
8589
nodeSelector:
8690
kubernetes.io/os: linux
8791
tolerations:
@@ -97,3 +101,8 @@ spec:
97101
operator: Exists
98102
tolerationSeconds: 120
99103
priorityClassName: system-cluster-critical
104+
securityContext:
105+
runAsNonRoot: true
106+
runAsUser: 65534
107+
seccompProfile:
108+
type: RuntimeDefault

manifests/0000_50_olm_07-olm-operator.deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ spec:
8282
requests:
8383
cpu: 10m
8484
memory: 160Mi
85+
securityContext:
86+
allowPrivilegeEscalation: false
87+
capabilities:
88+
drop: ["ALL"]
8589
nodeSelector:
8690
kubernetes.io/os: linux
8791
node-role.kubernetes.io/master: ""
@@ -98,3 +102,8 @@ spec:
98102
operator: Exists
99103
tolerationSeconds: 120
100104
priorityClassName: system-cluster-critical
105+
securityContext:
106+
runAsNonRoot: true
107+
runAsUser: 65534
108+
seccompProfile:
109+
type: RuntimeDefault

manifests/0000_50_olm_08-catalog-operator.deployment.ibm-cloud-managed.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ spec:
7878
env:
7979
- name: RELEASE_VERSION
8080
value: "0.0.1-snapshot"
81+
securityContext:
82+
allowPrivilegeEscalation: false
83+
capabilities:
84+
drop: ["ALL"]
8185
nodeSelector:
8286
kubernetes.io/os: linux
8387
tolerations:
@@ -93,3 +97,8 @@ spec:
9397
operator: Exists
9498
tolerationSeconds: 120
9599
priorityClassName: system-cluster-critical
100+
securityContext:
101+
runAsNonRoot: true
102+
runAsUser: 65534
103+
seccompProfile:
104+
type: RuntimeDefault

manifests/0000_50_olm_08-catalog-operator.deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ spec:
7878
env:
7979
- name: RELEASE_VERSION
8080
value: "0.0.1-snapshot"
81+
securityContext:
82+
allowPrivilegeEscalation: false
83+
capabilities:
84+
drop: ["ALL"]
8185
nodeSelector:
8286
kubernetes.io/os: linux
8387
node-role.kubernetes.io/master: ""
@@ -94,3 +98,8 @@ spec:
9498
operator: Exists
9599
tolerationSeconds: 120
96100
priorityClassName: system-cluster-critical
101+
securityContext:
102+
runAsNonRoot: true
103+
runAsUser: 65534
104+
seccompProfile:
105+
type: RuntimeDefault

pkg/manifests/csv.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ spec:
136136
volumeMounts:
137137
- name: tmpfs
138138
mountPath: /tmp
139+
securityContext:
140+
allowPrivilegeEscalation: false
141+
capabilities:
142+
drop: ["ALL"]
139143
volumes:
140144
- name: tmpfs
141145
emptyDir: {}
@@ -150,6 +154,11 @@ spec:
150154
values:
151155
- packageserver
152156
topologyKey: "kubernetes.io/hostname"
157+
securityContext:
158+
runAsNonRoot: true
159+
runAsUser: 65534
160+
seccompProfile:
161+
type: RuntimeDefault
153162
maturity: alpha
154163
version: 0.19.0
155164
apiservicedefinitions:

scripts/catalog-deployment.patch.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@
99
value:
1010
name: RELEASE_VERSION
1111
value: "0.0.1-snapshot"
12+
- command: update
13+
path: spec.template.spec.containers[*].securityContext
14+
value:
15+
allowPrivilegeEscalation: false
16+
capabilities:
17+
drop: ["ALL"]
18+
- command: update
19+
path: spec.template.spec.securityContext
20+
value:
21+
runAsNonRoot: true
22+
runAsUser: 65534
23+
seccompProfile:
24+
type: RuntimeDefault

scripts/generate_crds_manifests.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,19 @@ spec:
114114
labels:
115115
app: package-server-manager
116116
spec:
117+
securityContext:
118+
runAsNonRoot: true
119+
runAsUser: 65534
120+
seccompProfile:
121+
type: RuntimeDefault
117122
serviceAccountName: olm-operator-serviceaccount
118123
priorityClassName: "system-cluster-critical"
119124
containers:
120125
- name: package-server-manager
126+
securityContext:
127+
allowPrivilegeEscalation: false
128+
capabilities:
129+
drop: ["ALL"]
121130
command:
122131
- /bin/psm
123132
- start
@@ -262,10 +271,18 @@ spec:
262271
spec:
263272
template:
264273
spec:
274+
securityContext:
275+
runAsNonRoot: true
276+
seccompProfile:
277+
type: RuntimeDefault
265278
serviceAccountName: collect-profiles
266279
priorityClassName: openshift-user-critical
267280
containers:
268281
- name: collect-profiles
282+
securityContext:
283+
allowPrivilegeEscalation: false
284+
capabilities:
285+
drop: ["ALL"]
269286
image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607
270287
imagePullPolicy: IfNotPresent
271288
command:

scripts/olm-deployment.patch.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@
99
value:
1010
name: RELEASE_VERSION
1111
value: "0.0.1-snapshot"
12+
- command: update
13+
path: spec.template.spec.containers[*].securityContext
14+
value:
15+
allowPrivilegeEscalation: false
16+
capabilities:
17+
drop: ["ALL"]
18+
- command: update
19+
path: spec.template.spec.securityContext
20+
value:
21+
runAsNonRoot: true
22+
runAsUser: 65534
23+
seccompProfile:
24+
type: RuntimeDefault

scripts/packageserver-deployment.patch.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,16 @@
3333
values:
3434
- packageserver
3535
topologyKey: "kubernetes.io/hostname"
36+
- command: update
37+
path: spec.install.spec.deployments[0].spec.template.spec.containers[*].securityContext
38+
value:
39+
allowPrivilegeEscalation: false
40+
capabilities:
41+
drop: ["ALL"]
42+
- command: update
43+
path: spec.install.spec.deployments[0].spec.template.spec.securityContext
44+
value:
45+
runAsNonRoot: true
46+
runAsUser: 65534
47+
seccompProfile:
48+
type: RuntimeDefault

0 commit comments

Comments
 (0)