AWS Security ChangesHomeSearch

AWS eks: Clarify network policy pod-name matching behavior

Service: eks · 2026-11-25 · Security-related medium

File: eks/latest/userguide/network-policies-troubleshooting.md · Type: network

Summary

Rewrites the troubleshooting section to explain that the network policy agent identifies pods by namespace plus the name segment before the last hyphen, so policies can apply to pods they don't select; adds guidance to make pod name prefixes unique or use a controller.

Security assessment

The change documents a concrete weakness (referenced as aws-network-policy-agent issue #327) where network policy rules leak across pods sharing a name prefix, causing unintended allow/deny of traffic; this directly affects the correctness of a network segmentation control.

Evidence

+**Issue** : A pod is blocked or allowed by a network policy that doesn’t select it.

Diff

diff --git a/eks/latest/userguide/network-policies-troubleshooting.md b/eks/latest/userguide/network-policies-troubleshooting.md
index 9f40211..d3feff9 100644
--- a//eks/latest/userguide/network-policies-troubleshooting.md
+++ b//eks/latest/userguide/network-policies-troubleshooting.md
@@ -32 +32 @@ Note
-Note that network policies are only applied to pods that are made by Kubernetes _Deployments_. For more limitations of the network policies in the VPC CNI, see [Considerations](./cni-network-policy.html#cni-network-policy-considerations).
+Network policies apply to pods that a controller creates and to pods that you create directly. Pods in the same namespace whose names are the same before the last hyphen share network policy rules. For more information, see A network policy applies to pods that it doesn’t select. For more limitations of the network policies in the VPC CNI, see [Considerations](./cni-network-policy.html#cni-network-policy-considerations).
@@ -526 +526 @@ If you make a network policy `kind: NetworkPolicy` and it doesn’t affect the p
-### Network policy agent doesn’t support standalone pods
+### A network policy applies to pods that it doesn’t select
@@ -528 +528 @@ If you make a network policy `kind: NetworkPolicy` and it doesn’t affect the p
-**Issue** : Network policies applied to standalone pods may have inconsistent behavior.
+**Issue** : A pod is blocked or allowed by a network policy that doesn’t select it.
@@ -530 +530,3 @@ If you make a network policy `kind: NetworkPolicy` and it doesn’t affect the p
-**Solution** : The Network Policy agent currently only supports pods that are deployed as part of a deployment/replicaset. If network policies are applied to standalone pods, there might be some inconsistencies in the behavior. This is documented at the top of this page, in the [Considerations](./cni-network-policy.html#cni-network-policy-considerations), and in the [aws-network-policy-agent GitHub issue #327](https://github.com/aws/aws-network-policy-agent/issues/327) on GitHub. Deploy pods as part of a deployment or replicaset for consistent network policy behavior.
+**Solution** : The network policy agent identifies a pod by its namespace and the part of its name before the last hyphen (`-`). Pods on the same node that share this identifier share one set of network policy rules. The agent applies the rules of every policy that selects any of these pods to all of them. For example, a pod named `db-debug` that you create directly shares the identifier `db` with the pod `db-0` of a StatefulSet named `db`. A policy that selects only `db-debug` also applies to `db-0`. The shared rules can remain on the other pods after you delete the selected pod.
+
+To give each pod only the policies that select it, make the part of each pod name before the last hyphen unique in its namespace. You can also create the pods with a controller such as a Deployment. For more information, see [Considerations](./cni-network-policy.html#cni-network-policy-considerations) and [aws-network-policy-agent issue #327](https://github.com/aws/aws-network-policy-agent/issues/327) on GitHub.