mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-27 05:04:52 +00:00
Fix: Restricted profile comply with PSS (#117543)
* restricted profile comply with PSA v1.27 * add test case * Reflect review comments * Reflect review comments 2 * Reflect review comments 3
This commit is contained in:
23
hack/testdata/pod-restricted-localhost.yaml
vendored
Normal file
23
hack/testdata/pod-restricted-localhost.yaml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
run: target
|
||||
name: target
|
||||
spec:
|
||||
securityContext:
|
||||
seccompProfile:
|
||||
type: Localhost
|
||||
localhostProfile: dummy.json
|
||||
containers:
|
||||
- image: busybox
|
||||
name: target
|
||||
command: ["/bin/sh", "-c", "sleep 100"]
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
runAsNonRoot: true
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
22
hack/testdata/pod-restricted-runtime-default.yaml
vendored
Normal file
22
hack/testdata/pod-restricted-runtime-default.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
run: target
|
||||
name: target
|
||||
spec:
|
||||
securityContext:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- image: busybox
|
||||
name: target
|
||||
command: ["/bin/sh", "-c", "sleep 100"]
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
runAsNonRoot: true
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
Reference in New Issue
Block a user