Skip to content

Commit d797432

Browse files
authored
Merge pull request #39109 from Shubham82/improve_flow
Improved the content Flow.
2 parents dd80522 + 9ae7378 commit d797432

File tree

1 file changed

+38
-37
lines changed

1 file changed

+38
-37
lines changed

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

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,44 @@ docker exec -it kind-worker bash -c \
265265
}
266266
```
267267

268+
## Create Pod that uses the container runtime default seccomp profile
269+
270+
Most container runtimes provide a sane set of default syscalls that are allowed
271+
or not. You can adopt these defaults for your workload by setting the seccomp
272+
type in the security context of a pod or container to `RuntimeDefault`.
273+
274+
{{< note >}}
275+
If you have the `SeccompDefault` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
276+
enabled, then Pods use the `RuntimeDefault` seccomp profile whenever
277+
no other seccomp profile is specified. Otherwise, the default is `Unconfined`.
278+
{{< /note >}}
279+
280+
Here's a manifest for a Pod that requests the `RuntimeDefault` seccomp profile
281+
for all its containers:
282+
283+
{{< codenew file="pods/security/seccomp/ga/default-pod.yaml" >}}
284+
285+
Create that Pod:
286+
```shell
287+
kubectl apply -f https://k8s.io/examples/pods/security/seccomp/ga/default-pod.yaml
288+
```
289+
290+
```shell
291+
kubectl get pod default-pod
292+
```
293+
294+
The Pod should be showing as having started successfully:
295+
```
296+
NAME READY STATUS RESTARTS AGE
297+
default-pod 1/1 Running 0 20s
298+
```
299+
300+
Finally, now that you saw that work OK, clean up:
301+
302+
```shell
303+
kubectl delete pod default-pod --wait --now
304+
```
305+
268306
## Create a Pod with a seccomp profile for syscall auditing
269307

270308
To start off, apply the `audit.json` profile, which will log all syscalls of the
@@ -493,43 +531,6 @@ kubectl delete service fine-pod --wait
493531
kubectl delete pod fine-pod --wait --now
494532
```
495533

496-
## Create Pod that uses the container runtime default seccomp profile
497-
498-
Most container runtimes provide a sane set of default syscalls that are allowed
499-
or not. You can adopt these defaults for your workload by setting the seccomp
500-
type in the security context of a pod or container to `RuntimeDefault`.
501-
502-
{{< note >}}
503-
If you have the `SeccompDefault` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) enabled, then Pods use the `RuntimeDefault` seccomp profile whenever
504-
no other seccomp profile is specified. Otherwise, the default is `Unconfined`.
505-
{{< /note >}}
506-
507-
Here's a manifest for a Pod that requests the `RuntimeDefault` seccomp profile
508-
for all its containers:
509-
510-
{{< codenew file="pods/security/seccomp/ga/default-pod.yaml" >}}
511-
512-
Create that Pod:
513-
```shell
514-
kubectl apply -f https://k8s.io/examples/pods/security/seccomp/ga/default-pod.yaml
515-
```
516-
517-
```shell
518-
kubectl get pod default-pod
519-
```
520-
521-
The Pod should be showing as having started successfully:
522-
```
523-
NAME READY STATUS RESTARTS AGE
524-
default-pod 1/1 Running 0 20s
525-
```
526-
527-
Finally, now that you saw that work OK, clean up:
528-
529-
```shell
530-
kubectl delete pod default-pod --wait --now
531-
```
532-
533534
## {{% heading "whatsnext" %}}
534535

535536
You can learn more about Linux seccomp:

0 commit comments

Comments
 (0)