diff --git a/test/e2e/magic_catalog.go b/test/e2e/magic_catalog.go index 1067f8543a..4397162eab 100644 --- a/test/e2e/magic_catalog.go +++ b/test/e2e/magic_catalog.go @@ -11,6 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/utils/pointer" k8scontrollerclient "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -259,8 +260,6 @@ func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod { volumeMountName string = "fbc-catalog" ) - readOnlyRootFilesystem := false - return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: c.podName, @@ -268,6 +267,11 @@ func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod { Labels: c.makeCatalogSourcePodLabels(), }, Spec: corev1.PodSpec{ + SecurityContext: &corev1.PodSecurityContext{ + SeccompProfile: &corev1.SeccompProfile{ + Type: corev1.SeccompProfileTypeRuntimeDefault, + }, + }, Containers: []corev1.Container{ { Name: "catalog", @@ -304,7 +308,13 @@ func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod { }, }, SecurityContext: &corev1.SecurityContext{ - ReadOnlyRootFilesystem: &readOnlyRootFilesystem, + ReadOnlyRootFilesystem: pointer.Bool(false), + AllowPrivilegeEscalation: pointer.Bool(false), + Capabilities: &corev1.Capabilities{ + Drop: []corev1.Capability{"ALL"}, + }, + RunAsNonRoot: pointer.Bool(true), + RunAsUser: pointer.Int64(1001), }, ImagePullPolicy: corev1.PullAlways, TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,