KCSA · Domain 5: Platform Security · 16% of the exam
Task 5.5: PKI
The cluster's certificate authorities, component and client certificates, the certificates API, signers and rotation.
Study it
Service mesh, PKI and connectivity
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the CNCF documentation page that proves it.
Question 1 · choose 1
A platform team builds an internal approver that reviews CertificateSigningRequests for the kubernetes.io/kube-apiserver-client signer and approves the valid ones through the Kubernetes API. Following the least-privilege example in the certificates documentation, which permissions should its service account receive?
Aupdate on certificatesigningrequests only, which covers approval as part of the object
BRead access to CSRs, update on certificatesigningrequests/approval and approve on that signer
Capprove on signers named kubernetes.io/kube-apiserver-client only
Dcreate on certificatesigningrequests and sign on signers named kubernetes.io/*
Show the answer and why
Aupdate on certificatesigningrequests only, which covers approval as part of the object
Incorrect
Approval is a separate subresource, and the approver also needs the approve verb on the specific signer.
BRead access to CSRs, update on certificatesigningrequests/approval and approve on that signer
Correct
The documentation lists get, list and watch on certificatesigningrequests, update on their approval subresource, and the approve verb on the signers resource with the signer's name as resourceName.
Capprove on signers named kubernetes.io/kube-apiserver-client only
Incorrect
The approve verb on the signer is required, but approving also needs update on the certificatesigningrequests/approval subresource.
Dcreate on certificatesigningrequests and sign on signers named kubernetes.io/*
Incorrect
create lets a client submit requests and sign is the signer's permission to issue certificates; neither approves requests, and a wildcard over all built-in signers is broader than needed.
Besides reading the requests, approving a CSR takes two grants: update on certificatesigningrequests/approval and approve on the signers resource, named for the signer (or a domain wildcard). Naming only the one signer keeps the approver from approving certificates for other signers.
An administrator enables serverTLSBootstrap (the beta kubelet serving certificate rotation, on by default) on every kubelet so that kubelet serving certificates come from the cluster's certificates API, and the serving requests now wait in Pending. Nodes join and leave through autoscaling many times a day, so approving by hand does not scale. The security team adds one condition: an attacker who steals the credentials of one node must not obtain a serving certificate for another node's names. What should the platform team set up?
ABind the nodes to the selfnodeclient auto-approval ClusterRole so the built-in approver handles them
BA job that approves pending requests made by a node account that ask only for serving usages
CHave the kubelets use the kubernetes.io/kube-apiserver-client-kubelet signer, which can be auto-approved
DA custom approver checking the requesting node, serving usages and that the SANs are that node's
Show the answer and why
ABind the nodes to the selfnodeclient auto-approval ClusterRole so the built-in approver handles them
Incorrect
That role lets the built-in approver approve client certificate renewals for nodes; the approving controllers in core Kubernetes do not approve kubelet serving certificates.
BA job that approves pending requests made by a node account that ask only for serving usages
Incorrect
The requesting node chooses the subjectAltNames, so a stolen node identity could still ask for another node's addresses; the approval must also check that the SANs belong to the node that made the request.
CHave the kubelets use the kubernetes.io/kube-apiserver-client-kubelet signer, which can be auto-approved
Incorrect
That signer issues kubelet client certificates, honored by the API server for client authentication; it does not issue serving certificates.
DA custom approver checking the requesting node, serving usages and that the SANs are that node's
Correct
The TLS bootstrapping page says a deployment-specific approver for kubelet serving certificates should approve only requests made by a node, asking for serving usages, and whose IP and DNS subjectAltNames belong to the requesting node.
kube-controller-manager never auto-approves the kubernetes.io/kubelet-serving signer, so serving requests need a custom approving controller or manual approval. To scale safely, the approver checks that the request comes from the node itself, asks only for serving usages and names only that node's IP addresses and DNS names; otherwise one stolen node identity could obtain a certificate for another node.
In a cluster installed with kubeadm, where are most of the cluster's certificates stored?
AIn a Secret named cluster-pki in the default namespace
BIn /etc/kubernetes/pki on the control plane nodes
CIn etcd under a reserved key
DInside the kubectl binary on each workstation
Show the answer and why
AIn a Secret named cluster-pki in the default namespace
Incorrect
kubeadm keeps the cluster certificates as files on the control plane nodes.
BIn /etc/kubernetes/pki on the control plane nodes
Correct
The PKI documentation says that with kubeadm most certificates are stored in /etc/kubernetes/pki.
CIn etcd under a reserved key
Incorrect
etcd stores API objects; kubeadm writes its PKI files to disk.
DInside the kubectl binary on each workstation
Incorrect
Clients hold kubeconfig files, not the cluster's PKI.
kubeadm generates the cluster's CA and component certificates and keeps most of them in /etc/kubernetes/pki on control plane nodes, so access to that directory must be tightly controlled.
How long does a CertificateSigningRequest that stays Pending remain before Kubernetes deletes it automatically?
A1 hour
B24 hours
C7 days
DNever; it waits until someone approves or denies it
Show the answer and why
A1 hour
Incorrect
One hour applies to approved, denied and failed requests.
B24 hours
Correct
The certificates documentation says pending requests are automatically deleted after 24 hours.
C7 days
Incorrect
The documented limit for pending requests is 24 hours.
DNever; it waits until someone approves or denies it
Incorrect
Pending requests are garbage collected after 24 hours.
CertificateSigningRequests are cleaned up automatically: approved, denied and failed ones after an hour, pending ones after 24 hours, and all of them once the issued certificate has expired.