@@ -186,6 +186,12 @@ func TestAddKMSPluginSidecarToPodSpec(t *testing.T) {
186186 corev1 .ResourceCPU : resource .MustParse ("10m" ),
187187 },
188188 },
189+ SecurityContext : & corev1.SecurityContext {
190+ ReadOnlyRootFilesystem : ptr .To (true ),
191+ AllowPrivilegeEscalation : ptr .To (false ),
192+ Capabilities : & corev1.Capabilities {Drop : []corev1.Capability {"ALL" }},
193+ SeccompProfile : & corev1.SeccompProfile {Type : corev1 .SeccompProfileTypeRuntimeDefault },
194+ },
189195 VolumeMounts : []corev1.VolumeMount {socketMount , refDataMount },
190196 },
191197 },
@@ -233,6 +239,12 @@ func TestAddKMSPluginSidecarToPodSpec(t *testing.T) {
233239 corev1 .ResourceCPU : resource .MustParse ("10m" ),
234240 },
235241 },
242+ SecurityContext : & corev1.SecurityContext {
243+ ReadOnlyRootFilesystem : ptr .To (true ),
244+ AllowPrivilegeEscalation : ptr .To (false ),
245+ Capabilities : & corev1.Capabilities {Drop : []corev1.Capability {"ALL" }},
246+ SeccompProfile : & corev1.SeccompProfile {Type : corev1 .SeccompProfileTypeRuntimeDefault },
247+ },
236248 VolumeMounts : []corev1.VolumeMount {socketMount , refDataMount },
237249 },
238250 {
@@ -259,6 +271,12 @@ func TestAddKMSPluginSidecarToPodSpec(t *testing.T) {
259271 corev1 .ResourceCPU : resource .MustParse ("10m" ),
260272 },
261273 },
274+ SecurityContext : & corev1.SecurityContext {
275+ ReadOnlyRootFilesystem : ptr .To (true ),
276+ AllowPrivilegeEscalation : ptr .To (false ),
277+ Capabilities : & corev1.Capabilities {Drop : []corev1.Capability {"ALL" }},
278+ SeccompProfile : & corev1.SeccompProfile {Type : corev1 .SeccompProfileTypeRuntimeDefault },
279+ },
262280 VolumeMounts : []corev1.VolumeMount {socketMount , refDataMount },
263281 },
264282 },
@@ -487,6 +505,12 @@ func TestAddKMSPluginSidecarToPodSpec(t *testing.T) {
487505 corev1 .ResourceCPU : resource .MustParse ("10m" ),
488506 },
489507 },
508+ SecurityContext : & corev1.SecurityContext {
509+ ReadOnlyRootFilesystem : ptr .To (true ),
510+ AllowPrivilegeEscalation : ptr .To (false ),
511+ Capabilities : & corev1.Capabilities {Drop : []corev1.Capability {"ALL" }},
512+ SeccompProfile : & corev1.SeccompProfile {Type : corev1 .SeccompProfileTypeRuntimeDefault },
513+ },
490514 VolumeMounts : []corev1.VolumeMount {socketMount , refDataMount },
491515 },
492516 },
0 commit comments