Question 620
At Horizon observability, in a disposable simulated environment during a monitored release window: A reviewed manifest ./policies/metrics-api-deny-ingress.yaml selects app=metrics-api in namespace observability and declares policyTypes: [Ingress] with no allowed ingress peers. Work only within the stated target and verify before declaring success. Which operational control most directly prevents this failure or configuration drift?
Explanation
Correct Answer
Test security policies from allowed and denied sources rather than trusting YAML alone. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n observability apply -f ./policies/metrics-api-deny-ingress.yaml after validating selectors and the CNI's policy enforcement support. The relevant mechanism is: A selecting NetworkPolicy with ingress isolation and no allow rules denies new ingress to selected Pods except protocol-specific policy behavior; it does not itself control egress.
Incorrect Answers
This routine guards against another mechanism: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The recurring exposure in the current case is: A selecting NetworkPolicy with ingress isolation and no allow rules denies new ingress to selected Pods except protocol-specific policy behavior; it does not itself control egress. The matching preventive check is “Test security policies from allowed and denied sources rather than trusting YAML alone”.
That safeguard is relevant to: Gateway API separates infrastructure listener ownership from application route attachments and depends on controller support. The current failure instead follows from: A selecting NetworkPolicy with ingress isolation and no allow rules denies new ingress to selected Pods except protocol-specific policy behavior; it does not itself control egress. Its prevention measure is “Test security policies from allowed and denied sources rather than trusting YAML alone”.
This routine guards against another mechanism: Ingress TLS termination relies on a controller and a referenced TLS Secret; updating a Service alone does not install certificates. The recurring exposure in the current case is: A selecting NetworkPolicy with ingress isolation and no allow rules denies new ingress to selected Pods except protocol-specific policy behavior; it does not itself control egress. The matching preventive check is “Test security policies from allowed and denied sources rather than trusting YAML alone”.