Review seccomp profile settings

Use an effective seccomp profile to restrict unnecessary system calls.

Description

Seccomp filters the system calls a Linux container can make. If the Pod and container omit the profile, check the node’s seccompDefault setting to find out whether the runtime default applies.

Potential impact

An Unconfined container can make system calls the runtime profile would otherwise block.

Remediation

Set securityContext.seccompProfile.type to RuntimeDefault on the Pod or container. Check container overrides and remove unnecessary privileged mode, which bypasses seccomp. If the app needs a custom Localhost profile, review it and install it on every node where the Pod can run. Test the effective profile with your application image.

Examples

The first Pod uses an unsupported annotation and a misspelled profile value. The second uses the current seccompProfile field.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: pod-test-3
  annotations:
    seccomp.security.alpha.kubernetes.io/defaultProfileName: "rntim/dfl"
spec:
  containers:
    - name: foobar
      image: foo/bar:latest

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: pod-test-1
spec:
  securityContext:
    seccompProfile:
      type: RuntimeDefault
  containers:
    - name: foobar
      image: foo/bar:latest

References