Closed denist-huma closed 2 years ago
the docs says
SeccompDefault is an optional kubelet feature gate as well as corresponding --seccomp-default command line flag. Both have to be enabled simultaneously to use the feature.
do you have the command line flag enabled on the kubelet?
cc @saschagrunert I think maybe the docs have the feature-gate but not the flag, maybe we should add that.|
I haven't had a chance to work with this yet.
@BenTheElder a yeah, the kind config needs to have the kubelet flag as well :+1:
@denist-huma we will not mutate the existing security context (or the deprecated annotations) with that alpha feature. Reason is to be able to turn it off again without causing any harm to running workloads. It's just a kubelet scoped feature which changes the profile right before passing it to the container runtime. crictl inspect …
should give you the runtime spec, which contains the full seccomp profile for verification.
Note: We may change that when graduating the feature to make it more visible to end users. There were also plans to show the seccomp profile in the kubectl describe
output.
(FYI: you can call crictl
like docker exec kind-control-plane crictl inspect
)
should we file a k/website issue / PR for the kubelet flag?
(FYI: you can call
crictl
likedocker exec kind-control-plane crictl inspect
)should we file a k/website issue / PR for the kubelet flag?
Yes, I take care of it today.
Thanks @saschagrunert https://github.com/kubernetes/website/pull/31534 worked for me.
$ docker exec -it kind-worker bash -c \
> 'crictl inspect $(crictl ps --name=test-container -q) | jq .info.runtimeSpec.linux.seccomp'
@denist-huma the profile should be under .info.runtimeSpec.linux.seccomp
, like described there:
https://deploy-preview-31534--kubernetes-io-main-staging.netlify.app/docs/tutorials/security/seccomp/#enable-the-use-of-runtimedefault-as-the-default-seccomp-profile-for-all-workloads
Thanks!
What happened:
As I understood from the https://kubernetes.io/docs/tutorials/security/seccomp/#enable-the-use-of-runtimedefault-as-the-default-seccomp-profile-for-all-workloads, I expect Kind to patch my pod with the RuntimeDefault seccomp profile. I see that it is not the case. Let's test with a workload from docs:
What you expected to happen:
to output a JSON from
How to reproduce it (as minimally and precisely as possible):
prepare Kind
Anything else we need to know?:
Environment:
kind version
): kind v0.11.1 go1.16.3 linux/amd64kubectl version
):docker info
):Server: Containers: 7 Running: 2 Paused: 0 Stopped: 5 Images: 171 Server Version: 20.10.12 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: cgroupfs Cgroup Version: 1 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc Default Runtime: runc Init Binary: docker-init containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d runc version: v1.0.2-0-g52b36a2 init version: de40ad0 Security Options: apparmor seccomp Profile: default Kernel Version: 5.11.0-37-generic Operating System: Ubuntu 20.04.3 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 15.41GiB Name: L560 ID: VBQU:DI5A:UJCA:J4JE:HGAV:OOT5:6OO5:QIEO:LEYP:37RR:QSWH:4STC Docker Root Dir: /var/lib/docker Debug Mode: false Username: silaradost Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false