Policy Enforcement Modes: CCA practice questions
Whether a packet is checked against policy at all depends on the agent's enforcement mode, set with the Helm value policyEnforcementMode or the agent flag enable-policy. There are three values.
By Ibrahim Yesilay · Published · Updated
Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.
What Policy Enforcement Modes covers in CCA
Whether a packet is checked against policy at all depends on the agent's enforcement mode, set with the Helm value policyEnforcementMode or the agent flag enable-policy. There are three values.
The default mode leaves an endpoint unrestricted until a policy selects it. Selection then switches the endpoint into default deny, but only per direction: a selecting rule with an ingress section restricts ingress, and one with an egress section restricts egress. A pod covered by an ingress-only policy can still send traffic anywhere. The first policy you write for a workload therefore changes its behaviour for that direction from allow-all to allow-listed, which is why adding a narrow rule sometimes breaks unrelated traffic.
The always mode enforces policy on every endpoint, even if no rule selects it, so a pod with no matching allow can send and receive nothing. This includes the health endpoint that every node runs for connectivity checks; the docs recommend adding a cluster-wide policy that lets reserved:health talk to remote-node when you use always.
The never mode turns enforcement off for all endpoints, even those that rules select. Policies stay in the API but have no effect, and all traffic is allowed in both directions.
Individual policies can opt out of triggering default deny. Setting enableDefaultDeny to false for ingress or egress means the rule is ignored when Cilium decides the endpoint's default state. The documented use case is a cluster-wide policy that routes all DNS through the DNS proxy for visibility without blocking anything. There is one limit: the flag does not cover L7 rules. An HTTP rule that does not contain an L7 allow-all still rejects non-matching requests on that port.
Inside an enforced direction there is a second, smaller default. If an endpoint has no L4 policy, all ports are open; once at least one L4 rule applies, only listed ports pass, and ICMP is blocked unless it is related to an allowed connection.
What a denied client experiences is configurable too. Denied packets are dropped silently by default, so applications see timeouts. The experimental option --policy-deny-response=icmp sends ICMP Destination Unreachable back for denied egress traffic, provided the pod's ingress policy lets that ICMP in.
Key points
- The mode is agent-wide: Helm policyEnforcementMode or the agent flag enable-policy.
- In default mode an ingress-only policy leaves egress of the selected pod unrestricted.
- always mode blocks unselected pods, health endpoints included, until something allows them.
- enableDefaultDeny: false stops a rule from triggering default deny, but not for L7 rules.
Three sample questions
9 CCA questions on Policy Enforcement Modes, 9 with explanations. How practice works
Question 1
policyEnforcementMode: always. What happens to traffic of a pod that no CiliumNetworkPolicy or NetworkPolicy selects?- A.All traffic to and from the pod is allowed
- B.All traffic to and from the pod is denied
- C.Only traffic within the same namespace is allowed
- D.Only traffic from system pods is allowed
Correct answer: B
Sources: Cilium docs: Policy Enforcement Modes, Cilium docs: Policy Enforcement
Question 2
- A.default
- B.always
- C.never
- D.selective
Correct answer: A
Sources: Cilium docs: Policy Enforcement Modes, Cilium docs: Policy Enforcement
Question 3
policyEnforcementMode: never. A CiliumNetworkPolicy selects app=db pods and allows ingress only from app=api pods. An app=web pod connects to an app=db pod. What happens?- A.The connection is denied, because the policy selects the app=db pods
- B.The connection is denied, because never means deny everything
- C.It is allowed, because never disables all enforcement
- D.Only the first packet is allowed and later packets are dropped
Correct answer: C
Sources: CNCF CCA curriculum (CCA_Curriculum.pdf), Cilium docs: Policy Enforcement, Cilium docs: Policy Enforcement Modes
Practice this topic
Focus mode keeps every question on Policy Enforcement Modes until you leave it. 10 free guest answers, then a free account; no credit card.
Or open CCA practice across all topics.
Sources
The explanation above was checked against these official documents.
- Cilium docs: Policy Enforcement (checked 2026-10-28)
- Cilium docs: Policy Enforcement Modes (checked 2026-10-28)
- Cilium docs: Layer 4 Policies (checked 2026-10-28)
- Cilium docs: Using Kubernetes Constructs In Policy (checked 2026-10-28)
Frequently asked questions
Is never mode a way to test policies safely?
It disables enforcement completely, even for selected endpoints, so nothing is checked. It removes protection rather than simulating it.