Create a new pod called "nginx-auditing" in the "alpha" namespace using the nginx image. Secure the syscalls that this pod uses by using the local seccomp profile in the pods security context. The auditing.json should be at the "~/" directory.
Solution
### Solution
cp ~/auditing.json /var/lib/kubelet/seccomp/profiles
Add 'seccompDefault: true' to /var/lib/kubelet/config.yaml
streamingConnectionIdleTimeout: 0s
syncFrequency: 0s
volumeStatsAggPeriod: 0s
seccompDefault: true
sudo systemctl restart kubelet
vi ~/seccomp-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx-auditing
spec:
containers:
- image: nginx
name: nginx
securityContext: ## add Security context and apply seccompProfile
seccompProfile:
type: Localhost
localhostProfile: profiles/auditing.json ## as its localhost, profile location should be here
kubectl apply -f ~/seccomp-pod.yaml