@@ -11,6 +11,7 @@ import (
11
11
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12
12
utilerrors "k8s.io/apimachinery/pkg/util/errors"
13
13
"k8s.io/apimachinery/pkg/util/intstr"
14
+ "k8s.io/utils/pointer"
14
15
k8scontrollerclient "sigs.k8s.io/controller-runtime/pkg/client"
15
16
)
16
17
@@ -259,15 +260,18 @@ func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod {
259
260
volumeMountName string = "fbc-catalog"
260
261
)
261
262
262
- readOnlyRootFilesystem := false
263
-
264
263
return & corev1.Pod {
265
264
ObjectMeta : metav1.ObjectMeta {
266
265
Name : c .podName ,
267
266
Namespace : c .namespace ,
268
267
Labels : c .makeCatalogSourcePodLabels (),
269
268
},
270
269
Spec : corev1.PodSpec {
270
+ SecurityContext : & corev1.PodSecurityContext {
271
+ SeccompProfile : & corev1.SeccompProfile {
272
+ Type : corev1 .SeccompProfileTypeRuntimeDefault ,
273
+ },
274
+ },
271
275
Containers : []corev1.Container {
272
276
{
273
277
Name : "catalog" ,
@@ -304,7 +308,13 @@ func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod {
304
308
},
305
309
},
306
310
SecurityContext : & corev1.SecurityContext {
307
- ReadOnlyRootFilesystem : & readOnlyRootFilesystem ,
311
+ ReadOnlyRootFilesystem : pointer .Bool (false ),
312
+ AllowPrivilegeEscalation : pointer .Bool (false ),
313
+ Capabilities : & corev1.Capabilities {
314
+ Drop : []corev1.Capability {"ALL" },
315
+ },
316
+ RunAsNonRoot : pointer .Bool (true ),
317
+ RunAsUser : pointer .Int64 (1001 ),
308
318
},
309
319
ImagePullPolicy : corev1 .PullAlways ,
310
320
TerminationMessagePolicy : corev1 .TerminationMessageFallbackToLogsOnError ,
0 commit comments