Skip to content

Commit 9f94346

Browse files
committed
Merge readOnlyRootFilesystem, runAsnonRoot, and allowPrivilegeEscalation in one test
1 parent 5cf1e1d commit 9f94346

File tree

12 files changed

+17
-69
lines changed

12 files changed

+17
-69
lines changed

bundle/tests/scorecard/kuttl/security-context/01-assert.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ spec:
1212
containers:
1313
- name: app
1414
securityContext:
15+
allowPrivilegeEscalation: true
1516
readOnlyRootFilesystem: true
17+
runAsNonRoot: false
1618
status:
1719
replicas: 1
1820
readyReplicas: 1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ spec:
66
applicationImage: k8s.gcr.io/pause:2.0
77
replicas: 1
88
securityContext:
9+
allowPrivilegeEscalation: true
10+
readOnlyRootFilesystem: true
911
runAsNonRoot: false

bundle/tests/scorecard/kuttl/security-context/01-read-only-fs-override.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

bundle/tests/scorecard/kuttl/security-context/02-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
containers:
1313
- name: app
1414
securityContext:
15-
runAsNonRoot: false
15+
privileged: true
1616
status:
1717
replicas: 1
1818
readyReplicas: 1

bundle/tests/scorecard/kuttl/security-context/03-assert.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ spec:
1212
containers:
1313
- name: app
1414
securityContext:
15-
allowPrivilegeEscalation: true
15+
capabilities:
16+
add:
17+
- NET_ADMIN
18+
- SYS_TIME
1619
status:
1720
replicas: 1
1821
readyReplicas: 1

bundle/tests/scorecard/kuttl/security-context/03-privilege-esc-override.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

bundle/tests/scorecard/kuttl/security-context/04-assert.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ spec:
1212
containers:
1313
- name: app
1414
securityContext:
15-
privileged: true
15+
allowPrivilegeEscalation: false
16+
capabilities:
17+
drop:
18+
- ALL
19+
privileged: false
20+
readOnlyRootFilesystem: false
21+
runAsNonRoot: true
1622
status:
1723
replicas: 1
1824
readyReplicas: 1
19-
availableReplicas: 1
25+
updatedReplicas: 1

0 commit comments

Comments
 (0)