Skip to content

Commit 8101c61

Browse files
committed
(manifests) configure manifests to comply to PSA restricted profile
1 parent a718d73 commit 8101c61

10 files changed

+48
-55
lines changed

Diff for: manifests/0000_50_olm_00-namespace.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ apiVersion: v1
1515
kind: Namespace
1616
metadata:
1717
name: openshift-operators
18+
labels:
19+
pod-security.kubernetes.io/enforce: baseline
20+
pod-security.kubernetes.io/enforce-version: "v1.24"
21+
openshift.io/scc: "anyuid"
1822
annotations:
1923
openshift.io/node-selector: ""
2024
workload.openshift.io/allowed: "management"
2125
include.release.openshift.io/ibm-cloud-managed: "true"
2226
include.release.openshift.io/self-managed-high-availability: "true"
23-
labels:
24-
openshift.io/scc: "anyuid"

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

+8-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ spec:
2121
annotations:
2222
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
2323
spec:
24+
securityContext:
25+
runAsNonRoot: true
26+
seccompProfile:
27+
type: RuntimeDefault
2428
serviceAccountName: olm-operator-serviceaccount
2529
volumes:
2630
- name: srv-cert
@@ -31,6 +35,10 @@ spec:
3135
secretName: pprof-cert
3236
containers:
3337
- name: olm-operator
38+
securityContext:
39+
allowPrivilegeEscalation: false
40+
capabilities:
41+
drop: ["ALL"]
3442
volumeMounts:
3543
- name: srv-cert
3644
mountPath: "/srv-cert"
@@ -82,10 +90,6 @@ spec:
8290
requests:
8391
cpu: 10m
8492
memory: 160Mi
85-
securityContext:
86-
allowPrivilegeEscalation: false
87-
capabilities:
88-
drop: ["ALL"]
8993
nodeSelector:
9094
kubernetes.io/os: linux
9195
tolerations:
@@ -101,8 +105,3 @@ spec:
101105
operator: Exists
102106
tolerationSeconds: 120
103107
priorityClassName: system-cluster-critical
104-
securityContext:
105-
runAsNonRoot: true
106-
runAsUser: 65534
107-
seccompProfile:
108-
type: RuntimeDefault

Diff for: manifests/0000_50_olm_07-olm-operator.deployment.yaml

+8-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ spec:
2121
annotations:
2222
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
2323
spec:
24+
securityContext:
25+
runAsNonRoot: true
26+
seccompProfile:
27+
type: RuntimeDefault
2428
serviceAccountName: olm-operator-serviceaccount
2529
volumes:
2630
- name: srv-cert
@@ -31,6 +35,10 @@ spec:
3135
secretName: pprof-cert
3236
containers:
3337
- name: olm-operator
38+
securityContext:
39+
allowPrivilegeEscalation: false
40+
capabilities:
41+
drop: ["ALL"]
3442
volumeMounts:
3543
- name: srv-cert
3644
mountPath: "/srv-cert"
@@ -82,10 +90,6 @@ spec:
8290
requests:
8391
cpu: 10m
8492
memory: 160Mi
85-
securityContext:
86-
allowPrivilegeEscalation: false
87-
capabilities:
88-
drop: ["ALL"]
8993
nodeSelector:
9094
kubernetes.io/os: linux
9195
node-role.kubernetes.io/master: ""
@@ -102,8 +106,3 @@ spec:
102106
operator: Exists
103107
tolerationSeconds: 120
104108
priorityClassName: system-cluster-critical
105-
securityContext:
106-
runAsNonRoot: true
107-
runAsUser: 65534
108-
seccompProfile:
109-
type: RuntimeDefault

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ spec:
2121
annotations:
2222
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
2323
spec:
24+
securityContext:
25+
runAsNonRoot: true
26+
seccompProfile:
27+
type: RuntimeDefault
2428
serviceAccountName: olm-operator-serviceaccount
2529
volumes:
2630
- name: srv-cert
@@ -31,6 +35,10 @@ spec:
3135
secretName: pprof-cert
3236
containers:
3337
- name: catalog-operator
38+
securityContext:
39+
allowPrivilegeEscalation: false
40+
capabilities:
41+
drop: ["ALL"]
3442
volumeMounts:
3543
- name: srv-cert
3644
mountPath: "/srv-cert"
@@ -55,6 +63,7 @@ spec:
5563
- /srv-cert/tls.key
5664
- --client-ca
5765
- /profile-collector-cert/tls.crt
66+
- --set-workload-user-id=false
5867
image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607
5968
imagePullPolicy: IfNotPresent
6069
ports:
@@ -78,10 +87,6 @@ spec:
7887
env:
7988
- name: RELEASE_VERSION
8089
value: "0.0.1-snapshot"
81-
securityContext:
82-
allowPrivilegeEscalation: false
83-
capabilities:
84-
drop: ["ALL"]
8590
nodeSelector:
8691
kubernetes.io/os: linux
8792
tolerations:
@@ -97,8 +102,3 @@ spec:
97102
operator: Exists
98103
tolerationSeconds: 120
99104
priorityClassName: system-cluster-critical
100-
securityContext:
101-
runAsNonRoot: true
102-
runAsUser: 65534
103-
seccompProfile:
104-
type: RuntimeDefault

Diff for: manifests/0000_50_olm_08-catalog-operator.deployment.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ spec:
2121
annotations:
2222
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
2323
spec:
24+
securityContext:
25+
runAsNonRoot: true
26+
seccompProfile:
27+
type: RuntimeDefault
2428
serviceAccountName: olm-operator-serviceaccount
2529
volumes:
2630
- name: srv-cert
@@ -31,6 +35,10 @@ spec:
3135
secretName: pprof-cert
3236
containers:
3337
- name: catalog-operator
38+
securityContext:
39+
allowPrivilegeEscalation: false
40+
capabilities:
41+
drop: ["ALL"]
3442
volumeMounts:
3543
- name: srv-cert
3644
mountPath: "/srv-cert"
@@ -55,6 +63,7 @@ spec:
5563
- /srv-cert/tls.key
5664
- --client-ca
5765
- /profile-collector-cert/tls.crt
66+
- --set-workload-user-id=false
5867
image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607
5968
imagePullPolicy: IfNotPresent
6069
ports:
@@ -78,10 +87,6 @@ spec:
7887
env:
7988
- name: RELEASE_VERSION
8089
value: "0.0.1-snapshot"
81-
securityContext:
82-
allowPrivilegeEscalation: false
83-
capabilities:
84-
drop: ["ALL"]
8590
nodeSelector:
8691
kubernetes.io/os: linux
8792
node-role.kubernetes.io/master: ""
@@ -98,8 +103,3 @@ spec:
98103
operator: Exists
99104
tolerationSeconds: 120
100105
priorityClassName: system-cluster-critical
101-
securityContext:
102-
runAsNonRoot: true
103-
runAsUser: 65534
104-
seccompProfile:
105-
type: RuntimeDefault

Diff for: pkg/manifests/csv.yaml

+8-9
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ spec:
8888
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
8989
creationTimestamp: null
9090
spec:
91+
securityContext:
92+
runAsNonRoot: true
93+
seccompProfile:
94+
type: RuntimeDefault
9195
serviceAccountName: olm-operator-serviceaccount
9296
nodeSelector:
9397
kubernetes.io/os: linux
@@ -106,6 +110,10 @@ spec:
106110
tolerationSeconds: 120
107111
containers:
108112
- name: packageserver
113+
securityContext:
114+
allowPrivilegeEscalation: false
115+
capabilities:
116+
drop: ["ALL"]
109117
command:
110118
- /bin/package-server
111119
- -v=4
@@ -136,10 +144,6 @@ spec:
136144
volumeMounts:
137145
- name: tmpfs
138146
mountPath: /tmp
139-
securityContext:
140-
allowPrivilegeEscalation: false
141-
capabilities:
142-
drop: ["ALL"]
143147
volumes:
144148
- name: tmpfs
145149
emptyDir: {}
@@ -154,11 +158,6 @@ spec:
154158
values:
155159
- packageserver
156160
topologyKey: "kubernetes.io/hostname"
157-
securityContext:
158-
runAsNonRoot: true
159-
runAsUser: 65534
160-
seccompProfile:
161-
type: RuntimeDefault
162161
maturity: alpha
163162
version: 0.19.0
164163
apiservicedefinitions:

Diff for: scripts/catalog-deployment.patch.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@
1919
path: spec.template.spec.securityContext
2020
value:
2121
runAsNonRoot: true
22-
runAsUser: 65534
2322
seccompProfile:
2423
type: RuntimeDefault

Diff for: scripts/olm-deployment.patch.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@
1919
path: spec.template.spec.securityContext
2020
value:
2121
runAsNonRoot: true
22-
runAsUser: 65534
2322
seccompProfile:
2423
type: RuntimeDefault

Diff for: scripts/packageserver-deployment.patch.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,5 @@
4343
path: spec.install.spec.deployments[0].spec.template.spec.securityContext
4444
value:
4545
runAsNonRoot: true
46-
runAsUser: 65534
4746
seccompProfile:
4847
type: RuntimeDefault

Diff for: staging/operator-lifecycle-manager/deploy/chart/values.yaml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
rbacApiVersion: rbac.authorization.k8s.io
22
namespace: operator-lifecycle-manager
33
# see https://kubernetes.io/docs/concepts/security/pod-security-admission/ for more details
4-
namespace_psa:
5-
enforceLevel: restricted
6-
enforceVersion: latest
74
catalog_namespace: operator-lifecycle-manager
85
operator_namespace: operators
96
# see https://kubernetes.io/docs/concepts/security/pod-security-admission/ for more details
107
operator_namespace_psa:
118
enforceLevel: baseline
12-
enforceVersion: latest
9+
enforceVersion: '"v1.24"'
1310
minKubeVersion: 1.11.0
1411
writeStatusName: '""'
1512
imagestream: false
@@ -33,7 +30,7 @@ olm:
3330
memory: 160Mi
3431

3532
catalog:
36-
setWorkloadUserID: true
33+
setWorkloadUserID: false
3734
replicaCount: 1
3835
commandArgs: --configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest
3936
image:

0 commit comments

Comments
 (0)