Skip to content

Commit 07995d0

Browse files
committed
Improved the content Flow.
1 parent 2101166 commit 07995d0

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

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

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,43 @@ 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/) enabled, then Pods use the `RuntimeDefault` seccomp profile whenever
276+
no other seccomp profile is specified. Otherwise, the default is `Unconfined`.
277+
{{< /note >}}
278+
279+
Here's a manifest for a Pod that requests the `RuntimeDefault` seccomp profile
280+
for all its containers:
281+
282+
{{< codenew file="pods/security/seccomp/ga/default-pod.yaml" >}}
283+
284+
Create that Pod:
285+
```shell
286+
kubectl apply -f https://k8s.io/examples/pods/security/seccomp/ga/default-pod.yaml
287+
```
288+
289+
```shell
290+
kubectl get pod default-pod
291+
```
292+
293+
The Pod should be showing as having started successfully:
294+
```
295+
NAME READY STATUS RESTARTS AGE
296+
default-pod 1/1 Running 0 20s
297+
```
298+
299+
Finally, now that you saw that work OK, clean up:
300+
301+
```shell
302+
kubectl delete pod default-pod --wait --now
303+
```
304+
268305
## Create a Pod with a seccomp profile for syscall auditing
269306

270307
To start off, apply the `audit.json` profile, which will log all syscalls of the
@@ -493,43 +530,6 @@ kubectl delete service fine-pod --wait
493530
kubectl delete pod fine-pod --wait --now
494531
```
495532

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-
533533
## {{% heading "whatsnext" %}}
534534

535535
You can learn more about Linux seccomp:

0 commit comments

Comments
 (0)