You are reducing the attack surface of the kube-apiserver on a kubeadm cluster. The security team wants to disable anonymous authentication and restrict which users can be impersonated. Which TWO actions achieve these goals? (Choose two.)
Trap 1: Enable the AlwaysPullImages admission plugin so anonymous image…
AlwaysPullImages forces kubelet to pull images on every pod start, which affects image provenance rather than API authentication. It has no relationship to anonymous requests to the apiserver or to impersonation permissions. Enabling it would add registry load without addressing either of the two hardening goals in the scenario.
Trap 2: Set --authorization-mode=AlwaysAllow to simplify authorization…
AlwaysAllow authorizes every authenticated request, which massively broadens what any valid credential can do and is never an acceptable hardening step. It also has nothing to do with anonymous authentication or impersonation. Enabling it would undermine the isolation the security team is trying to achieve and would likely fail a CIS benchmark check.
Trap 3: Set --requestheader-allowed-names to the wildcard so aggregation…
The requestheader-allowed-names flag lists the common names the apiserver accepts on client certificates presented for the front-proxy. Setting it to a wildcard would let any certificate with a matching CA chain impersonate arbitrary users through the aggregation layer, which widens rather than narrows the attack surface and does not disable anonymous access.
- A
Set --anonymous-auth=false on the kube-apiserver and restart the static pod.
Disabling anonymous authentication forces every request to present valid credentials, so unauthenticated probes of the API are rejected with 401. On kubeadm nodes the flag is added to the apiserver manifest in /etc/kubernetes/manifests, and the static pod restarts automatically when the file changes. This directly removes the anonymous user from the request pipeline.
- B
Enable the AlwaysPullImages admission plugin so anonymous image pulls are blocked.
Why it fails: AlwaysPullImages forces kubelet to pull images on every pod start, which affects image provenance rather than API authentication. It has no relationship to anonymous requests to the apiserver or to impersonation permissions. Enabling it would add registry load without addressing either of the two hardening goals in the scenario.
- C
Grant impersonate verbs only to specific ClusterRoles and audit use of the impersonate subresource.
Impersonation is an RBAC-controlled verb on users, groups, serviceaccounts, and the userextras subresource. By default only a few system roles hold it, but any broad grant lets a caller act as another identity. Restricting the impersonate verb to tightly scoped ClusterRoles and auditing its use limits who can pivot identities, which is the second goal stated in the scenario.
- D
Set --authorization-mode=AlwaysAllow to simplify authorization while anonymous access is disabled.
Why it fails: AlwaysAllow authorizes every authenticated request, which massively broadens what any valid credential can do and is never an acceptable hardening step. It also has nothing to do with anonymous authentication or impersonation. Enabling it would undermine the isolation the security team is trying to achieve and would likely fail a CIS benchmark check.
- E
Set --requestheader-allowed-names to the wildcard so aggregation clients can present any common name.
Why it fails: The requestheader-allowed-names flag lists the common names the apiserver accepts on client certificates presented for the front-proxy. Setting it to a wildcard would let any certificate with a matching CA chain impersonate arbitrary users through the aggregation layer, which widens rather than narrows the attack surface and does not disable anonymous access.