Reject privileged containers with native admission control
+
Write a policy and binding from memory, then prove both enforcement and namespace scope. This is a focused retrieval drill: no webhook and no third-party policy engine.
+
+
Timed task: 15 minutes
+
Apply lab/lesson-31-fixture.yaml. Create lab/lesson-31-answer.yaml from scratch with exactly two resources:
+
+
one ValidatingAdmissionPolicy; and
+
one ValidatingAdmissionPolicyBinding.
+
+
The policy must evaluate Pod CREATE and UPDATE requests. It must reject a Pod when any regular container or init container explicitly sets securityContext.privileged: true.
+
The binding must enforce the policy with Deny only in namespaces labelled cks-training=admission. Use a helpful validation message. Do not reject containers that omit securityContext or omit privileged.
+
+
Retrieval target: optional fields are the trap. Your CEL must safely handle a missing securityContext and a missing privileged field. Remember that the policy defines logic and request matching; the binding supplies enforcement action and namespace scope.
Expected: allowed is admitted, denied is rejected with your message, and outside-scope is admitted.
+
+
Retrieval check
+
+
Question
+
Where should the namespace selector and Deny action be configured?
+
+
+
+
+
+
+
+
Documentation target
+
Use the official Validating Admission Policy documentation only after your first attempt. Inspect local schemas with kubectl explain validatingadmissionpolicy.spec and kubectl explain validatingadmissionpolicybinding.spec.
+
+
What to send me
+
Save the answer, run the three checks, then say check. I will review only the first issue at a time. Ask me a follow-up question whenever a field or CEL expression is unclear.
Separate a failed attack from a successful compromise
+
Suspicious intent is not the same as successful impact. Reconstruct the incident from the authenticated principal, affected resources, timestamps, and HTTP response codes.
+
+
Timed task: 12 minutes
+
Analyze lab/lesson-32-audit.jsonl with a structured JSON tool. Create lab/lesson-32-answer.md containing concise answers to these questions:
+
+
Which suspicious RBAC request failed, who made it, and what evidence proves it failed?
+
Which principal completed the successful attack sequence?
+
What was the first successful escalation event? Include timestamp, verb, resource type, namespace, and resource name.
+
Which credential-bearing object was accessed successfully?
+
What runtime action followed?
+
Give three immediate containment actions in operational order.
+
+
Also include the exact command you used. Do not identify a principal by audit ID, and do not describe a rejected request as a completed privilege escalation.
+
+
Incident reflex: read responseStatus.code before claiming impact. Then pivot on user.username, source IP, and time. Contain the authority first, isolate execution second, and rotate exposed credentials after access is stopped.
Save the incident note, then say check. I will list all detected issues and help you correct only one per round. Ask me a follow-up question if any audit field is unclear.