Skip to content

Commit 32bd772

Browse files
authored
Merge pull request #31534 from saschagrunert/seccomp-default-improvements
Improve SeccompDefault documentation
2 parents c93f096 + 4074c2e commit 32bd772

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

content/en/docs/tutorials/security/seccomp.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ of security defaults while preserving the functionality of the workload. It is
174174
possible that the default profiles differ between container runtimes and their
175175
release versions, for example when comparing those from CRI-O and containerd.
176176

177+
{{< note >}}
178+
Enabling the feature will neither change the Kubernetes
179+
`securityContext.seccompProfile` API field nor add the deprecated annotations of
180+
the workload. This provides users the possibility to rollback anytime without
181+
actually changing the workload configuration. Tools like
182+
[`crictl inspect`](https://github.com/kubernetes-sigs/cri-tools) can be used to
183+
verify which seccomp profile is being used by a container.
184+
{{< /note >}}
185+
177186
Some workloads may require a lower amount of syscall restrictions than others.
178187
This means that they can fail during runtime even with the `RuntimeDefault`
179188
profile. To mitigate such a failure, you can:
@@ -203,6 +212,51 @@ kind: Cluster
203212
apiVersion: kind.x-k8s.io/v1alpha4
204213
featureGates:
205214
SeccompDefault: true
215+
nodes:
216+
- role: control-plane
217+
image: kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
218+
kubeadmConfigPatches:
219+
- |
220+
kind: JoinConfiguration
221+
nodeRegistration:
222+
kubeletExtraArgs:
223+
seccomp-default: "true"
224+
- role: worker
225+
image: kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
226+
kubeadmConfigPatches:
227+
- |
228+
kind: JoinConfiguration
229+
nodeRegistration:
230+
kubeletExtraArgs:
231+
feature-gates: SeccompDefault=true
232+
seccomp-default: "true"
233+
```
234+
235+
If the cluster is ready, then running a pod:
236+
237+
```shell
238+
kubectl run --rm -it --restart=Never --image=alpine alpine -- sh
239+
```
240+
241+
Should now have the default seccomp profile attached. This can be verified by
242+
using `docker exec` to run `crictl inspect` for the container on the kind
243+
worker:
244+
245+
```shell
246+
docker exec -it kind-worker bash -c \
247+
'crictl inspect $(crictl ps --name=alpine -q) | jq .info.runtimeSpec.linux.seccomp'
248+
```
249+
250+
```json
251+
{
252+
"defaultAction": "SCMP_ACT_ERRNO",
253+
"architectures": ["SCMP_ARCH_X86_64", "SCMP_ARCH_X86", "SCMP_ARCH_X32"],
254+
"syscalls": [
255+
{
256+
"names": ["..."]
257+
}
258+
]
259+
}
206260
```
207261

208262
## Create a Pod with a seccomp profile for syscall auditing

0 commit comments

Comments
 (0)