File tree Expand file tree Collapse file tree 12 files changed +2
-105
lines changed
controller/postgrescluster
testing/kuttl/e2e/security-context Expand file tree Collapse file tree 12 files changed +2
-105
lines changed Original file line number Diff line number Diff line change 38
38
allowPrivilegeEscalation : false
39
39
readOnlyRootFilesystem : true
40
40
runAsNonRoot : true
41
- seccompProfile :
42
- type : RuntimeDefault
43
41
serviceAccountName : pgo
Original file line number Diff line number Diff line change @@ -22,7 +22,3 @@ Read more about how you can [get started]({{< relref "quickstart/_index.md" >}})
22
22
23
23
- It is now possible to perform major PostgreSQL version upgrades when using an external WAL directory.
24
24
- The documentation for pgAdmin 4 now clearly states that any pgAdmin user created by PGO will have a ` @pgo ` suffix.
25
-
26
- ## Changes
27
-
28
- - The ` seccompProfile ` field in the ` securityContext ` for all containers is now set to ` RuntimeDefault ` in order to properly restrict syscalls.
Original file line number Diff line number Diff line change @@ -563,8 +563,6 @@ func TestAddPGBackRestToInstancePodSpec(t *testing.T) {
563
563
privileged: false
564
564
readOnlyRootFilesystem: true
565
565
runAsNonRoot: true
566
- seccompProfile:
567
- type: RuntimeDefault
568
566
volumeMounts:
569
567
- mountPath: /etc/pgbackrest/server
570
568
name: pgbackrest-server
@@ -612,8 +610,6 @@ func TestAddPGBackRestToInstancePodSpec(t *testing.T) {
612
610
privileged: false
613
611
readOnlyRootFilesystem: true
614
612
runAsNonRoot: true
615
- seccompProfile:
616
- type: RuntimeDefault
617
613
volumeMounts:
618
614
- mountPath: /etc/pgbackrest/server
619
615
name: pgbackrest-server
@@ -669,8 +665,6 @@ func TestAddPGBackRestToInstancePodSpec(t *testing.T) {
669
665
privileged: false
670
666
readOnlyRootFilesystem: true
671
667
runAsNonRoot: true
672
- seccompProfile:
673
- type: RuntimeDefault
674
668
volumeMounts:
675
669
- mountPath: /etc/pgbackrest/server
676
670
name: pgbackrest-server
@@ -718,8 +712,6 @@ func TestAddPGBackRestToInstancePodSpec(t *testing.T) {
718
712
privileged: false
719
713
readOnlyRootFilesystem: true
720
714
runAsNonRoot: true
721
- seccompProfile:
722
- type: RuntimeDefault
723
715
volumeMounts:
724
716
- mountPath: /etc/pgbackrest/server
725
717
name: pgbackrest-server
Original file line number Diff line number Diff line change @@ -2510,8 +2510,6 @@ containers:
2510
2510
privileged: false
2511
2511
readOnlyRootFilesystem: true
2512
2512
runAsNonRoot: true
2513
- seccompProfile:
2514
- type: RuntimeDefault
2515
2513
volumeMounts:
2516
2514
- mountPath: /etc/pgbackrest/conf.d
2517
2515
name: pgbackrest-config
Original file line number Diff line number Diff line change @@ -991,8 +991,6 @@ containers:
991
991
privileged: false
992
992
readOnlyRootFilesystem: true
993
993
runAsNonRoot: true
994
- seccompProfile:
995
- type: RuntimeDefault
996
994
terminationMessagePath: /dev/termination-log
997
995
terminationMessagePolicy: File
998
996
volumeMounts:
@@ -1046,8 +1044,6 @@ containers:
1046
1044
privileged: false
1047
1045
readOnlyRootFilesystem: true
1048
1046
runAsNonRoot: true
1049
- seccompProfile:
1050
- type: RuntimeDefault
1051
1047
terminationMessagePath: /dev/termination-log
1052
1048
terminationMessagePolicy: File
1053
1049
volumeMounts:
@@ -1103,8 +1099,6 @@ containers:
1103
1099
privileged: false
1104
1100
readOnlyRootFilesystem: true
1105
1101
runAsNonRoot: true
1106
- seccompProfile:
1107
- type: RuntimeDefault
1108
1102
terminationMessagePath: /dev/termination-log
1109
1103
terminationMessagePolicy: File
1110
1104
volumeMounts:
Original file line number Diff line number Diff line change @@ -20,9 +20,6 @@ import (
20
20
)
21
21
22
22
// RestrictedPodSecurityContext returns a v1.PodSecurityContext with safe defaults.
23
- // Note: All current containers have security context set by `RestrictedSecurityContext`
24
- // which has recommended limits; if more pods/containers are added
25
- // make sure to set the SC on the container
26
23
// See https://docs.k8s.io/concepts/security/pod-security-standards/
27
24
func RestrictedPodSecurityContext () * corev1.PodSecurityContext {
28
25
return & corev1.PodSecurityContext {
@@ -46,12 +43,5 @@ func RestrictedSecurityContext() *corev1.SecurityContext {
46
43
47
44
// Fail to start the container if its image runs as UID 0 (root).
48
45
RunAsNonRoot : Bool (true ),
49
-
50
- // Restrict syscalls with RuntimeDefault seccomp.
51
- // Set this on the container-level to avoid interfering
52
- // with sidecars and injected containers.
53
- SeccompProfile : & corev1.SeccompProfile {
54
- Type : corev1 .SeccompProfileTypeRuntimeDefault ,
55
- },
56
46
}
57
47
}
Original file line number Diff line number Diff line change @@ -97,11 +97,8 @@ func TestRestrictedSecurityContext(t *testing.T) {
97
97
"Containers must be required to run as non-root users." )
98
98
}
99
99
100
- if assert .Check (t , sc .SeccompProfile != nil ) {
101
- assert .Assert (t , sc .SeccompProfile .Type == "RuntimeDefault" ,
102
- "Seccomp profile must be explicitly set to one of the allowed values." )
103
- }
104
-
100
+ assert .Assert (t , sc .SeccompProfile == nil ,
101
+ "The RuntimeDefault seccomp profile must be required, or allow specific additional profiles." )
105
102
})
106
103
107
104
if assert .Check (t , sc .ReadOnlyRootFilesystem != nil ) {
Original file line number Diff line number Diff line change @@ -241,8 +241,6 @@ containers:
241
241
privileged: false
242
242
readOnlyRootFilesystem: true
243
243
runAsNonRoot: true
244
- seccompProfile:
245
- type: RuntimeDefault
246
244
volumeMounts:
247
245
- mountPath: /etc/pgadmin
248
246
name: pgadmin-startup
@@ -280,8 +278,6 @@ initContainers:
280
278
privileged: false
281
279
readOnlyRootFilesystem: true
282
280
runAsNonRoot: true
283
- seccompProfile:
284
- type: RuntimeDefault
285
281
volumeMounts:
286
282
- mountPath: /etc/pgadmin
287
283
name: pgadmin-startup
@@ -477,8 +473,6 @@ containers:
477
473
privileged: false
478
474
readOnlyRootFilesystem: true
479
475
runAsNonRoot: true
480
- seccompProfile:
481
- type: RuntimeDefault
482
476
volumeMounts:
483
477
- mountPath: /etc/pgadmin
484
478
name: pgadmin-startup
@@ -520,8 +514,6 @@ initContainers:
520
514
privileged: false
521
515
readOnlyRootFilesystem: true
522
516
runAsNonRoot: true
523
- seccompProfile:
524
- type: RuntimeDefault
525
517
volumeMounts:
526
518
- mountPath: /etc/pgadmin
527
519
name: pgadmin-startup
Original file line number Diff line number Diff line change @@ -571,8 +571,6 @@ func TestAddServerToInstancePod(t *testing.T) {
571
571
privileged: false
572
572
readOnlyRootFilesystem: true
573
573
runAsNonRoot: true
574
- seccompProfile:
575
- type: RuntimeDefault
576
574
volumeMounts:
577
575
- mountPath: /etc/pgbackrest/server
578
576
name: pgbackrest-server
@@ -619,8 +617,6 @@ func TestAddServerToInstancePod(t *testing.T) {
619
617
privileged: false
620
618
readOnlyRootFilesystem: true
621
619
runAsNonRoot: true
622
- seccompProfile:
623
- type: RuntimeDefault
624
620
volumeMounts:
625
621
- mountPath: /etc/pgbackrest/server
626
622
name: pgbackrest-server
@@ -705,8 +701,6 @@ func TestAddServerToRepoPod(t *testing.T) {
705
701
privileged: false
706
702
readOnlyRootFilesystem: true
707
703
runAsNonRoot: true
708
- seccompProfile:
709
- type: RuntimeDefault
710
704
volumeMounts:
711
705
- mountPath: /etc/pgbackrest/server
712
706
name: pgbackrest-server
@@ -749,8 +743,6 @@ func TestAddServerToRepoPod(t *testing.T) {
749
743
privileged: false
750
744
readOnlyRootFilesystem: true
751
745
runAsNonRoot: true
752
- seccompProfile:
753
- type: RuntimeDefault
754
746
volumeMounts:
755
747
- mountPath: /etc/pgbackrest/server
756
748
name: pgbackrest-server
Original file line number Diff line number Diff line change @@ -141,8 +141,6 @@ containers:
141
141
privileged: false
142
142
readOnlyRootFilesystem: true
143
143
runAsNonRoot: true
144
- seccompProfile:
145
- type: RuntimeDefault
146
144
volumeMounts:
147
145
- mountPath: /etc/pgbouncer
148
146
name: pgbouncer-config
@@ -171,8 +169,6 @@ containers:
171
169
privileged: false
172
170
readOnlyRootFilesystem: true
173
171
runAsNonRoot: true
174
- seccompProfile:
175
- type: RuntimeDefault
176
172
volumeMounts:
177
173
- mountPath: /etc/pgbouncer
178
174
name: pgbouncer-config
@@ -249,8 +245,6 @@ containers:
249
245
privileged: false
250
246
readOnlyRootFilesystem: true
251
247
runAsNonRoot: true
252
- seccompProfile:
253
- type: RuntimeDefault
254
248
volumeMounts:
255
249
- mountPath: /etc/pgbouncer
256
250
name: pgbouncer-config
@@ -284,8 +278,6 @@ containers:
284
278
privileged: false
285
279
readOnlyRootFilesystem: true
286
280
runAsNonRoot: true
287
- seccompProfile:
288
- type: RuntimeDefault
289
281
volumeMounts:
290
282
- mountPath: /etc/pgbouncer
291
283
name: pgbouncer-config
@@ -353,8 +345,6 @@ containers:
353
345
privileged: false
354
346
readOnlyRootFilesystem: true
355
347
runAsNonRoot: true
356
- seccompProfile:
357
- type: RuntimeDefault
358
348
volumeMounts:
359
349
- mountPath: /etc/pgbouncer
360
350
name: pgbouncer-config
@@ -387,8 +377,6 @@ containers:
387
377
privileged: false
388
378
readOnlyRootFilesystem: true
389
379
runAsNonRoot: true
390
- seccompProfile:
391
- type: RuntimeDefault
392
380
volumeMounts:
393
381
- mountPath: /etc/pgbouncer
394
382
name: pgbouncer-config
You can’t perform that action at this time.
0 commit comments